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
5,400
Online Optimization for Max-Norm Regularization Jie Shen Dept. of Computer Science Rutgers University Piscataway, NJ 08854 js2007@rutgers.edu Huan Xu Dept. of Mech. Engineering National Univ. of Singapore Singapore 117575 mpexuh@nus.edu.sg Ping Li Dept. of Statistics Dept. of Computer Science Rutgers University pingli@stat.rutgers.edu Abstract Max-norm regularizer has been extensively studied in the last decade as it promotes an effective low rank estimation of the underlying data. However, maxnorm regularized problems are typically formulated and solved in a batch manner, which prevents it from processing big data due to possible memory bottleneck. In this paper, we propose an online algorithm for solving max-norm regularized problems that is scalable to large problems. Particularly, we consider the matrix decomposition problem as an example, although our analysis can also be applied in other problems such as matrix completion. The key technique in our algorithm is to reformulate the max-norm into a matrix factorization form, consisting of a basis component and a coefficients one. In this way, we can solve the optimal basis and coefficients alternatively. We prove that the basis produced by our algorithm converges to a stationary point asymptotically. Experiments demonstrate encouraging results for the effectiveness and robustness of our algorithm. See the full paper at arXiv:1406.3190. 1 Introduction In the last decade, estimating low rank matrices has attracted increasing attention in the machine learning community owing to its successful applications in a wide range of domains including subspace clustering [13], collaborative filtering [9] and visual texture analysis [25], to name a few. Suppose that we are given an observed data matrix Z of size p × n, i.e., n observations in p ambient dimensions, with each observation being i.i.d. sampled from some unknown distribution, we aim to learn a prediction matrix X with a low rank structure to approximate Z. This problem, together with its many variants, typically involves minimizing a weighted combination of the residual error and matrix rank regularization term. Generally speaking, it is intractable to optimize a matrix rank [15]. To tackle this challenge, researchers suggest alternative convex relaxations to the matrix rank. The two most widely used convex surrogates are the nuclear norm 1 [15] and the max-norm 2 [19]. In the work of [6], Cand`es et al. proved that under mild conditions, solving a convex optimization problem consisting of a nuclear norm regularization and a weighted ℓ1 norm penalty can exactly recover the low-rank component of the underlying data even if a constant fraction of the entries are arbitrarily corrupted. In [20], Srebro and Shraibman studied collaborative filtering and proved that the max-norm regularization formulation enjoyed a lower generalization error than the nuclear norm. Moreover, the max-norm was shown to empirically outperform the nuclear norm in certain practical applications as well [11, 12]. To optimize a max-norm regularized problem, however, algorithms proposed in prior work [12, 16, 19] require to access all the data. In a large scale setting, the applicability of such batch optimiza1Also known as the trace norm, the Ky-Fan n-norm and the Schatten 1-norm. 2Also known as the γ2-norm. 1 tion methods will be hindered by the memory bottleneck. In this paper, by utilizing the matrix factorization form of the max-norm, we propose an online algorithm to solve max-norm regularized problems. The main advantage of online algorithms is that the memory cost is independent from the sample size, which makes online algorithms a good fit for the big data era [14, 18]. Specifically, we are interested in the max-norm regularized matrix decomposition (MRMD) problem. Assume that the observed data matrix Z can be decomposed into a low rank component X and a sparse one E, we aim to simultaneously and accurately estimate the two components, by solving the following convex program: min X,E 1 2 ∥Z −X −E∥2 F + λ1 2 ∥X∥2 max + λ2∥E∥1,1. (1.1) Here ∥·∥F denotes the Frobenius norm, ∥·∥max is the max-norm (which promotes low rank), ∥·∥1,1 is the ℓ1 norm of a matrix seen as a vector, and λ1 and λ2 are two non-negative parameters. Our main contributions are two-folds: 1) We develop an online method to solve this MRMD problems, making it scalable to big data. 2) We prove that the solutions produced by our algorithm converge to a stationary point asymptotically. 1.1 Connection to Matrix Completion While we mainly focus on the matrix decomposition problem, our method can be extended to the matrix completion (MC) problem [4, 7] with max-norm regularization [5], which is another popular topic in machine learning and signal processing. The MC problem can be described as follows: min X 1 2 ∥PΩ(Z −X)∥2 F + λ 2 ∥X∥2 max , where Ωis the set of indices of observed entries in Z and PΩ(M) is the orthogonal projector onto the span of matrices vanishing outside of Ωso that the (i, j)-th entry of PΩ(M) is equal to Mij if (i, j) ∈Ωand zero otherwise. Interestingly, the max-norm regularized MC problem can be cast into our framework. To see this, let us introduce an auxiliary matrix M, with Mij = C > 0 if (i, j) ∈Ω and Mij = 1 C otherwise. The following reformulated MC problem, min X,E 1 2 ∥Z −X −E∥2 F + λ 2 ∥X∥2 max + ∥M ◦E∥1,1 , where “◦” denotes the entry-wise product, is equivalent to our MRMD formulation (1.1). Furthermore, when C tends to infinity, the reformulated problem converges to the original MC problem. 1.2 Related Work Here we discuss some relevant work in the literature. Most previous works on max-norm focused on showing that the max-norm was empirically superior to the nuclear norm in a wide range of applications, such as collaborative filtering [19] and clustering [11]. Moreover, in [17], Salakhutdinov and Srebro studied the influence of data distribution for the max-norm regularization and observed good performance even when the data were sampled non-uniformly. There are also studies which investigated the connection between the max-norm and the nuclear norm. A comprehensive study on this problem, in the context of collaborative filtering, can be found in [20], which established and compared the generalization bounds for the nuclear norm regularization and max-norm regularization, and showed that the generalization bound of the max-norm regularization scheme is superior. More recently, Foygel et al. [9] attempted to unify the nuclear norm and max-norm for gaining further insights on these two important regularization schemes. There are few works to develop efficient algorithms for solving max-norm regularized problems, particularly large scale ones. Rennie and Srebro [16] devised a gradient-based optimization method and empirically showed promising results on large collaborative filtering datasets. In [12], the authors presented large scale optimization methods for max-norm constrained and max-norm regularized problems with a theoretical guarantee to a stationary point. Nevertheless, all those methods were formulated in a batch manner, which can be hindered by the memory bottleneck. 2 From a high level, the goal of this paper is similar to that of [8]. Motivated by the celebrated Robust Principal Component Analysis (RPCA) problem [6, 23, 24], the authors of [8] developed an online implementation for the nuclear-norm regularized matrix decomposition. Yet, since the max-norm is a much more complicated mathematical entity (e.g., even the subgradient of the max-norm is not completely characterized to the best of our knowledge), new techniques and insights are needed in order to develop online methods for the max-norm regularization. For example, after taking the max-norm with its matrix factorization form, the data are still coupled and we propose to convert the problem to a constrained one for stochastic optimization. The main technical contribution of this paper is to convert max-norm regularization to an appropriate matrix factorization problem amenable to online implementation. Part of our proof ideas are inspired by [14], which also studied online matrix factorization. In contrast to [14], our formulation contains an additive sparse noise matrix, which enjoys the benefit of robustness to sparse contamination. Our proof techniques are also different. For example, to prove the convergence of the dictionary and to well define their problem, [14] needs to assume that the magnitude of the learned dictionary is constrained. In contrast, in our setup we prove that the optimal basis is uniformly bounded, and hence our problem is naturally well defined. 2 Problem Setup We first introduce our notations. We use bold letters to denote vectors. The i-th row and j-th column of a matrix M are denoted by m(i) and mj, respectively. The ℓ1 norm and ℓ2 norm of a vector v are denoted by ∥v∥1 and ∥v∥2, respectively. The ℓ2,∞norm of a matrix is defined as the maximum ℓ2 row norm. Finally, the trace of a square matrix M is denoted as Tr(M). We are interested in developing an online algorithm for the MRMD Problem (1.1). By taking the matrix factorization form of the max-norm [19]: ∥X∥max ≜min L,R{∥L∥2,∞· ∥R∥2,∞: X = LR⊤, L ∈Rp×d, R ∈Rn×d}, (2.1) where d is the intrinsic dimension of the underlying data, we can rewrite Problem (1.1) into the following equivalent form: min L,R,E 1 2∥Z −LRT −E∥2 F + λ1 2 ∥L∥2 2,∞∥R∥2 2,∞+ λ2∥E∥1,1. (2.2) Intuitively, the variable L corresponds to a basis and the variable R is a coefficients matrix with each row corresponding to the coefficients. At a first sight, the problem can only be optimized in a batch manner as the term ∥R∥2 2,∞couples all the samples. In other words, to compute the optimal coefficients of the i-th sample, we are required to compute the subgradient of ∥R∥2,∞, which needs to access all the data. Fortunately, we have the following proposition that alleviates the inter-dependency among samples. Proposition 2.1. Problem (2.2) is equivalent to the following constrained program: minimize L,R,E 1 2∥Z −LRT −E∥2 F + λ1 2 ∥L∥2 2,∞+ λ2∥E∥1,1, subject to ∥R∥2 2,∞= 1. (2.3) Proposition 2.1 states that our primal MRMD problem can be transformed to an equivalent constrained one. In the new formulation (2.3), the coefficients of each individual sample (i.e., a row of the matrix R) is uniformly constrained. Thus, the samples are decoupled. Consequently, we can, equipped with Proposition 2.1, rewrite the original problem in an online fashion, with each sample being separately processed: minimize L,R,E 1 2 n ∑ i=1 ∥zi −Lri −ei∥2 2 + λ1 2 ∥L∥2 2,∞+ λ2 n ∑ i=1 ∥ei∥1, subject to ∀i ∈1, 2, . . . , n, ∥ri∥2 2 ≤1, 3 where zi is the i-th observed sample, ri is the coefficients and ei is the sparse error. Combining the first and third terms in the above equation, we have minimize L,R,E n ∑ i=1 ˜ℓ(zi, L, ri, ei) + λ1 2 ∥L∥2 2,∞, subject to ∀i ∈1, 2, . . . , n, ∥ri∥2 2 ≤1, (2.4) where ˜ℓ(z, L, r, e) ≜1 2∥z −Lr −e∥2 2 + λ2∥e∥1. (2.5) This is indeed equivalent to optimizing (i.e., minimizing) the empirical loss function: fn(L) ≜1 n n ∑ i=1 ℓ(zi, L) + λ1 2n∥L∥2 2,∞, (2.6) where ℓ(z, L) = min r,e,∥r∥2 2≤1 ˜ℓ(z, L, r, e). (2.7) When n goes to infinity, the empirical loss converges to the expected loss, defined as follows f(L) = lim n→+∞fn(L) = Ez[ℓ(z, L)]. (2.8) 3 Algorithm We now present our online implementation to solve the MRMD problem. The detailed algorithm is listed in Algorithm 1. Here we first briefly explain the underlying intuition: We optimize the coefficients r, the sparse noise e and the basis L in an alternating manner, which is known to be a successful strategy [8, 10, 14]. At the t-th iteration, given the basis Lt−1, we can optimize over r and e by examining the Karush Kuhn Tucker (KKT) conditions. To update the basis Lt, we then optimize the following objective function: gt(L) ≜1 t t ∑ i=1 ˜ℓ(zi, L, ri, ei) + λ1 2t ∥L∥2 2,∞, (3.1) where {ri}t i=1 and {ei}t i=1 have been computed in previous iterations. It is easy to verify that Eq. (3.1) is a surrogate function of the empirical cost function ft(L) defined in Eq. (2.6). The basis Lt can be optimized by block coordinate decent, with Lt−1 being a warm start for efficiency. 4 Main Theoretical Results and Proof Outline In this section we present our main theoretic result regarding the validity of the proposed algorithm. We first discuss some necessary assumptions. 4.1 Assumptions 1. The observed data are i.i.d. generated from a distribution with compact support Z. 2. The surrogate functions gt(L) in Eq. (3.1) are strongly convex. Particularly, we assume that the smallest eigenvalue of the positive semi-definite matrix 1 t At defined in Algorithm 1 is not smaller than some positive constant β1. Note that we can easily enforce this assumption by adding a term β1 2 ∥L∥2 F to gt(L). 3. The minimizer for Problem (2.7) is unique. Notice that ˜ℓ(z, L, r, e) is strongly convex w.r.t. e and convex w.r.t. r. Hence, we can easily enforce this assumption by adding a term γ∥r∥2 2, where γ is a small positive constant. 4.2 Main Theorem The following theorem is the main theoretical result of this work. It states that when t tends to infinity, the basis Lt produced by Algorithm 1 converges to a stationary point. Theorem 4.1 (Convergence to a stationary point of Lt). Assume 1, 2 and 3. Given that the intrinsic dimension of the underlying data is d, the optimal basis Lt produced by Algorithm 1 asymptotically converges to a stationary point of Problem (2.8) when t tends to infinity. 4 Algorithm 1 Online Max-Norm Regularized Matrix Decomposition Input: Z ∈Rp×n (observed samples), parameters λ1 and λ2, L0 ∈Rp×d (initial basis), zero matrices A0 ∈Rd×d and B0 ∈Rp×d Output: optimal basis Lt 1: for t = 1 to n do 2: Access the t-th sample zt. 3: Compute the coefficient and noise: {rt, et} = arg min r,e,∥r∥2 2≤1 ˜ℓ(zt, Lt−1, r, e). (3.2) 4: Compute the accumulation matrices At and Bt: At ← At−1 + rtr⊤ t , Bt ← Bt−1 + (zt −et) r⊤ t . 5: Compute the basis Lt by optimizing the surrogate function (3.1): Lt = arg min L 1 t t ∑ i=1 ˜ℓ(zi, L, ri, ei) + λ1 2t ∥L∥2 2,∞ = arg min L 1 t (1 2 Tr ( L⊤LAt ) −Tr ( L⊤Bt )) + λ1 2t ∥L∥2 2,∞. (3.3) 6: end for 4.3 Proof Outline for Theorem 4.1 The essential tools for our analysis are from stochastic approximation [3] and asymptotic statistics [21]. There are three main steps in our proof: (I) We show that the positive stochastic process gt(Lt) defined in Eq. (3.1) converges almost surely. (II) Then we prove that the empirical loss function, ft(Lt) defined in Eq. (2.6) converges almost surely to the same limit of its surrogate gt(Lt). According to the central limit theorem, we can expect that ft(Lt) also converges almost surely to the expected loss f(Lt) defined in Eq. (2.8), implying that gt(Lt) and f(Lt) converge to the same limit. (III) Finally, by taking a simple Taylor expansion, it justifies that the gradient of f(L) taking at Lt vanishes as t tends to infinity, which concludes Theorem 4.1. Theorem 4.2 (Convergence of the surrogate function gt(Lt)). The surrogate function gt(Lt) we defined in Eq. (3.1) converges almost surely, where Lt is the solution produced by Algorithm 1. To establish the convergence of gt(Lt), we verify that gt(Lt) is a quasi-martingale [3] that converges almost surely. To this end, we show that the expectation of the difference of gt+1(Lt+1) and gt(Lt) can be upper bounded by a family of functions ℓ(·, L) indexed by L ∈L, where L is a compact set. Then we show that the family of functions satisfy the hypotheses in the corollary of Donsker Theorem [21] and thus can be uniformly upper bounded. Therefore, we conclude that gt(Lt) is a quasi-martingale and converges almost surely. Now let us verify the hypotheses in the corollary of Donsker Theorem. First we prove that the index set L is uniformly bounded. Proposition 4.3. Let rt, et and Lt be the optimal solutions produced by Algorithm 1. Then, 1. The optimal solutions rt and et are uniformly bounded. 2. The matrices 1 t At and 1 t Bt are uniformly bounded. 5 3. There exists a compact set L, such that for all Lt produced by Algorithm 1, Lt ∈L. That is, there exists a positive constant Lmax that is uniform over t, such that for all t > 0, ∥Lt∥≤Lmax. To prove the third claim (which is required for our proof of convergence of gt(Lt)), we should prove that for all t > 0, rt, et, 1 t At and 1 t Bt can be uniformly bounded, which can easily be verified. Then, by utilizing the first order optimal condition of Problem (3.3), we can build an equation that connects Lt with the four items we mentioned in the first and second claim. From Assumption 2, we know that the nuclear norm of 1 t At can be uniformly lower bounded. This property provides us the way to show that Lt can be uniformly upper bounded. Note that in [8, 14], both papers assumed that the dictionary (or basis) is uniformly bounded. In contrast, here in the third claim of Proposition 4.3, we prove that such condition naturally holds in our problem. Next, we show that the family of functions ℓ(z, L) is uniformly Lipschitz w.r.t. L. Proposition 4.4. Let L ∈L and denote the minimizer of ℓ(z, L, r, e) defined in (2.7) as: {r∗, e∗} = arg min r,e,∥r∥2≤1 1 2∥z −Lr −e∥2 2 + λ2∥e∥1. Then, the function ℓ(z, L) defined in Problem (2.7) is continuously differentiable and ∇Lℓ(z, L) = (Lr∗+ e∗−z)r∗T . Furthermore, ℓ(z, ·) is uniformly Lipschitz and bounded. By utilizing the corollary of Theorem 4.1 from [2], we can verify the differentiability of ℓ(z, L) and the form of its gradient. As all of the items in the gradient are uniformly bounded (Assumption 1 and Proposition 4.3), we show that ℓ(z, L) is uniformly Lipschitz and bounded. Based on Proposition 4.3 and 4.4, we verify that all the hypotheses in the corollary of Donsker Theorem [21] are satisfied. This implies the convergence of gt(Lt). We now move to step (II). Theorem 4.5 (Convergence of f(Lt)). Let f(Lt) be the expected loss function defined in Eq. (2.8) and Lt is the solution produced by the Algorithm 1. Then, 1. gt(Lt) −ft(Lt) converges almost surely to 0. 2. ft(Lt) defined in Eq. (2.6) converges almost surely. 3. f(Lt) converges almost surely to the same limit of ft(Lt). We apply Lemma 8 from [14] to prove the first claim. We denote the difference of gt(Lt) and ft(Lt) by bt. First we show that bt is uniformly Lipschitz. Then we show that the difference between Lt+1 and Lt is O( 1 t ), making bt+1 −bt be uniformly upper bounded by O( 1 t ). Finally, we verify the convergence of the summation of the serial { 1 t bt}∞ t=1. Thus, Lemma 8 from [14] applies. Proposition 4.6. Let {Lt} be the basis sequence produced by the Algorithm 1. Then, ∥Lt+1 −Lt∥F = O(1 t ). (4.1) Proposition 4.6 can be proved by combining the strong convexity of gt(L) (Assumption 2 in Section 4.1) and the Lipschitz of gt(L); see the full paper for details. Equipped with Proposition 4.6, we can verify that the difference of the sequence bt = gt(Lt) − ft(Lt) can be upper bounded by O( 1 t ). The convergence of the summation of the serial { 1 t bt}∞ t=1 can be examined by the expectation convergence property of quasi-martingale gt(Lt), stated in [3]. Applying the Lemma 8 from [14], we conclude that gt(Lt) −ft(Lt) converges to zero a.s.. After the first claim of Theorem 4.5 being proved, the second claim follows immediately, as gt(Lt) converges a.s. (Theorem 4.2). By the central limit theorem, the third claim can be verified. According to Theorem 4.5, we can see that gt(Lt) and f(Lt) converge to the same limit a.s. Let t tends to infinity, as Lt is uniformly bounded (Proposition 4.3), the term λ1 2t ∥Lt∥2 2,∞in gt(Lt) vanishes. Thus gt(Lt) becomes differentiable. On the other hand, we have the following proposition about the gradient of f(L). 6 Proposition 4.7 (Gradient of f(L)). Let f(L) be the expected loss function defined in Eq. (2.8). Then, f(L) is continuously differentiable and ∇f(L) = Ez[∇Lℓ(z, L)]. Moreover, ∇f(L) is uniformly Lipschitz on L. Thus, taking a first order Taylor expansion for f(Lt) and gt(Lt), we can show that the gradient of f(Lt) equals to that of gt(Lt) when t tends to infinity. Since Lt is the minimizer for gt(L), we know that the gradient of f(Lt) vanishes. Therefore, we have proved Theorem 4.1. 5 Experiments In this section, we report some simulation results on synthetic data to demonstrate the effectiveness and robustness of our online max-norm regularized matrix decomposition (OMRMD) algorithm. Data Generation. The simulation data are generated by following a similar procedure in [6]. The clean data matrix X is produced by X = UV T , where U ∈Rp×d and V ∈Rn×d. The entries of U and V are i.i.d. sampled from the Gaussian distribution N(0, 1). We introduce a parameter ρ to control the sparsity of the corruption matrix E, i.e., a ρ-fraction of the entries are non-zero and following an i.i.d. uniform distribution over [−1000, 1000]. Finally, the observation matrix Z is produced by Z = X + E. Evaluation Metric. Our goal is to estimate the correct subspace for the underlying data. Here, we evaluate the fitness of our estimated subspace basis L and the ground truth basis U by the Expressed Variance (EV) [22]: EV(U, L) ≜Tr(LT UU T L) Tr(UU T ) . The values of EV range in [0, 1] and a higher EV value indicates a more accurate subspace recovery. Other Settings. Through the experiments, we set the ambient dimension p = 400 and the total number of samples n = 5000 unless otherwise specified. We fix the tunable parameter λ1 = λ2 = 1/√p, and use default parameters for all baseline algorithms we compare with. Each experiment is repeated 10 times and we report the averaged EV as the result. rank / ambient dimension fraction of corruption 0.02 0.14 0.26 0.38 0.5 0.5 0.38 0.26 0.14 0.02 (a) OMRMD rank / ambient dimension fraction of corruption 0.02 0.14 0.26 0.38 0.5 0.5 0.38 0.26 0.14 0.02 (b) OR-PCA Figure 1: Performance of subspace recovery under different rank and corruption fraction. Brighter color means better performance. We first study the effectiveness of the algorithm, measured by the EV value of its output after the last sample, and compare it to the nuclear norm based online RPCA (OR-PCA) algorithm [8]. Specifically, we vary the intrinsic dimension d from 0.02p to 0.5p, with a step size 0.04p, and the corruption fraction ρ from 0.02 to 0.5, with a step size 0.04. The results are reported in Figure 1 where brighter color means higher EV (hence better performance). We observe that for easier tasks (i.e., when corruption and rank are low), both algorithms perform comparably. On the other hand, for more difficult cases, OMRMD outperforms OR-PCA. This is possibly because the max-norm is a tighter approximation to the matrix rank. We next study the convergence of OMRMD by plotting the EV curve against the number of samples. Besides OR-PCA, we also add Principal Component Pursuit (PCP) [6] and an online PCA 7 1 1000 2000 3000 4000 5000 0 0.2 0.4 0.6 0.8 1 Number of Samples EV OMRMD OR−PCA PCP Online PCA (a) ρ = 0.01 1 1000 2000 3000 4000 5000 0 0.2 0.4 0.6 0.8 1 Number of Samples EV OMRMD OR−PCA PCP Online PCA (b) ρ = 0.3 1 1000 2000 3000 4000 5000 0 0.2 0.4 0.6 0.8 1 Number of Samples EV OMRMD OR−PCA PCP Online PCA (c) ρ = 0.5 2 4 6 8 10 x 10 4 0 0.2 0.4 0.6 0.8 1 Number of Samples EV OMRMD OR−PCA PCP (d) p = 3000, d = 300, ρ = 0.3 Figure 2: EV value against number of samples. p = 400 and d = 80 in (a) to (c). algorithm [1] as baseline algorithms to compare with. The results are reported in Figure 2. As expected, PCP achieves the best performance since it is a batch method and needs to access all the data throughout the algorithm. Online PCA degrades significantly even with low corruption (Figure 2a). OMRMD is comparable to OR-PCA when the corruption is low (Figure 2a), and converges significantly faster when the corruption is high (Figure 2b and 2c). Indeed, this is true even with high dimension and as many as 100, 000 samples (Figure 2d). This observation agrees with Figure 1, and again suggests that for large corruption, max-norm may be a better fit than the nuclear norm. Additional experimental results are available in the full paper. 6 Conclusion In this paper, we developed an online algorithm for max-norm regularized matrix decomposition problem. Using the matrix factorization form of the max-norm, we convert the original problem to a constrained one which facilitates an online implementation for solving the original problem. We established theoretical guarantees that the solutions will converge to a stationary point asymptotically. Moreover, we empirically compared our proposed algorithm with OR-PCA, which is a recently proposed online algorithm for nuclear-norm based matrix decomposition. The simulation results suggest that the proposed algorithm outperforms OR-PCA, in particular for harder task (i.e., when a large fraction of entries are corrupted). Our experiments, to an extent, empirically suggest that the max-norm might be a tighter relaxation of the rank function compared to the nuclear norm. Acknowledgments The research of Jie Shen and Ping Li is partially supported by NSF-DMS-1444124, NSF-III1360971, NSF-Bigdata-1419210, ONR-N00014-13-1-0764, and AFOSR-FA9550-13-1-0137. Part of the work of Jie Shen was conducted at Shanghai Jiao Tong University. The work of Huan Xu is partially supported by the Ministry of Education of Singapore through AcRF Tier Two grant R-265000-443-112. 8 References [1] Matej Artac, Matjaz Jogan, and Ales Leonardis. Incremental pca for on-line visual learning and recognition. In Pattern Recognition, 2002. Proceedings. 16th International Conference on, volume 3, pages 781–784. IEEE, 2002. [2] J Fr´ed´eric Bonnans and Alexander Shapiro. Optimization problems with perturbations: A guided tour. SIAM review, 40(2):228–264, 1998. [3] L´eon Bottou. Online learning and stochastic approximations. On-line learning in neural networks, 17(9), 1998. [4] Jian-Feng Cai, Emmanuel J Cand`es, and Zuowei Shen. A singular value thresholding algorithm for matrix completion. SIAM Journal on Optimization, 20(4):1956–1982, 2010. [5] Tony Cai and Wen-Xin Zhou. A max-norm constrained minimization approach to 1-bit matrix completion. Journal of Machine Learning Research, 14:3619–3647, 2014. [6] Emmanuel J Cand`es, Xiaodong Li, Yi Ma, and John Wright. Robust principal component analysis? Journal of the ACM (JACM), 58(3):11, 2011. [7] Emmanuel J Cand`es and Benjamin Recht. Exact matrix completion via convex optimization. Foundations of Computational mathematics, 9(6):717–772, 2009. [8] Jiashi Feng, Huan Xu, and Shuicheng Yan. Online robust pca via stochastic optimization. In Advances in Neural Information Processing Systems, pages 404–412, 2013. [9] Rina Foygel, Nathan Srebro, and Ruslan Salakhutdinov. Matrix reconstruction with the local max norm. In NIPS, pages 944–952, 2012. [10] Prateek Jain, Praneeth Netrapalli, and Sujay Sanghavi. Low-rank matrix completion using alternating minimization. In Proceedings of the 45th annual ACM symposium on Symposium on theory of computing, pages 665–674. ACM, 2013. [11] Ali Jalali and Nathan Srebro. Clustering using max-norm constrained optimization. In ICML, 2012. [12] Jason D Lee, Ben Recht, Ruslan Salakhutdinov, Nathan Srebro, and Joel A Tropp. Practical large-scale optimization for max-norm regularization. In NIPS, pages 1297–1305, 2010. [13] Guangcan Liu, Zhouchen Lin, Shuicheng Yan, Ju Sun, Yong Yu, and Yi Ma. Robust recovery of subspace structures by low-rank representation. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 35(1):171–184, 2013. [14] Julien Mairal, Francis Bach, Jean Ponce, and Guillermo Sapiro. Online learning for matrix factorization and sparse coding. The Journal of Machine Learning Research, 11:19–60, 2010. [15] 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. [16] 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. [17] Ruslan Salakhutdinov and Nathan Srebro. Collaborative filtering in a non-uniform world: Learning with the weighted trace norm. tc (X), 10:2, 2010. [18] Shai Shalev-Shwartz, Yoram Singer, Nathan Srebro, and Andrew Cotter. Pegasos: Primal estimated subgradient solver for svm. Mathematical programming, 127(1):3–30, 2011. [19] Nathan Srebro, Jason DM Rennie, and Tommi Jaakkola. Maximum-margin matrix factorization. In NIPS, volume 17, pages 1329–1336, 2004. [20] Nathan Srebro and Adi Shraibman. Rank, trace-norm and max-norm. In Learning Theory, pages 545– 560. Springer, 2005. [21] Aad W Van der Vaart. Asymptotic statistics, volume 3. Cambridge university press, 2000. [22] Huan Xu, Constantine Caramanis, and Shie Mannor. Principal component analysis with contaminated data: The high dimensional case. In COLT, pages 490–502, 2010. [23] Huan Xu, Constantine Caramanis, and Shie Mannor. Outlier-robust pca: the high-dimensional case. Information Theory, IEEE Transactions on, 59(1):546–572, 2013. [24] Huan Xu, Constantine Caramanis, and Sujay Sanghavi. Robust pca via outlier pursuit. IEEE Transactions on Information Theory, 58(5):3047–3064, 2012. [25] Zhengdong Zhang, Arvind Ganesh, Xiao Liang, and Yi Ma. Tilt: transform invariant low-rank textures. International Journal of Computer Vision, 99(1):1–24, 2012. 9
2014
299
5,401
Optimal prior-dependent neural population codes under shared input noise Agnieszka Grabska-Barwi´nska Gatsby Computational Neuroscience Unit University College London agnieszka@gatsby.ucl.ac.uk Jonathan W. Pillow Princeton Neuroscience Institute Department of Psychology Princeton University pillow@princeton.edu Abstract The brain uses population codes to form distributed, noise-tolerant representations of sensory and motor variables. Recent work has examined the theoretical optimality of such codes in order to gain insight into the principles governing population codes found in the brain. However, the majority of the population coding literature considers either conditionally independent neurons or neurons with noise governed by a stimulus-independent covariance matrix. Here we analyze population coding under a simple alternative model in which latent “input noise” corrupts the stimulus before it is encoded by the population. This provides a convenient and tractable description for irreducible uncertainty that cannot be overcome by adding neurons, and induces stimulus-dependent correlations that mimic certain aspects of the correlations observed in real populations. We examine prior-dependent, Bayesian optimal coding in such populations using exact analyses of cases in which the posterior is approximately Gaussian. These analyses extend previous results on independent Poisson population codes and yield an analytic expression for squared loss and a tight upper bound for mutual information. We show that, for homogeneous populations that tile the input domain, optimal tuning curve width depends on the prior, the loss function, the resource constraint, and the amount of input noise. This framework provides a practical testbed for examining issues of optimality, noise, correlation, and coding fidelity in realistic neural populations. 1 Introduction A substantial body of work has examined the optimality of neural population codes [1–19]. However, the classical literature has focused mostly on codes with independent Poisson noise, and on Fisher information-based analyses of unbiased decoding. Real neurons, by contrast, exhibit dependencies beyond those induced by the stimulus (i.e., “noise correlations”), and Fisher information does not accurately quantify information when performance is close to threshold [7, 15, 18], or when biased decoding is optimal. Moreover, the classical population codes with independent Poisson noise predict unreasonably good performance with even a small number of neurons. A variety of studies have shown that the information extracted from independently recorded neurons (across trials or even animals) outperforms the animal itself [20, 21]. For example, a population of only 220 Poisson neurons with tuning width of 60 deg (full width at half height) and tuning amplitude of 10 spikes can match the human orientation discrimination threshold of ⇡1 deg. (See Supplement S1 for derivation.) Note that even fewer neurons would be required if peak spike counts were higher. The mismatch between this predicted efficiency and animals’ actual behaviour has been attributed to the presence of information-limiting correlations between neurons [22, 23]. However, deviation 1 + stimulus prior stimulus p(stimulus) 0 stimulus Poisson noise spike count tuning curves input noise population response spike count preferred stimulus p(stimulus) stimulus likelihood posterior Figure 1: Bayesian formulation of neural population coding with input noise. from independence renders most analytical treatments infeasible, necessitating the use of numerical methods (Monte Carlo simulations) for quantifying the performance of such codes [7, 15]. Here we examine a family of population codes for which the posterior is Gaussian, which makes it feasible to perform a variety of analytical treatments. In particular, when tuning curves are Gaussian and “tile” the input domain, we obtain codes for which the likelihood is proportional to a Gaussian [2, 16]. Combined with a Gaussian stimulus prior, this results in a Gaussian posterior whose variance depends only on the total spike count. This allows us to derive tractable expressions for neurometric functions such as mean squared error (MSE) and mutual information (MI), and to analyze optimality without resorting to Fisher information, which can be inaccurate for short time windows or small spike counts [7, 15, 18]. Secondly, we extend this framework to incorporate shared “input noise” in the stimulus variable of interest (See Fig. 1). This form of noise differs from many existing models, which assume noise to arise from shared connectivity, but with no direct relationship to the stimulus coding [5, 15, 18, 24] (although see [16, 25] for related approaches). This paper is organised as follows. In Sec. 2, we describe an idealized Poisson population code with tractable posteriors, and review classical results based on Fisher Information. In Sec. 3, we provide a Bayesian treatment of these codes, deriving expressions for mean squared error (MSE) and mutual information (MI). In Sec. 4, we extend these analyses to a population with input noise. Finally, in Sec. 5 we examine the patterns of pairwise dependencies introduced by input noise. 2 Independent Poisson population codes Consider an idealized population of Poisson neurons that encode a scalar stimulus s with Gaussianshaped tuning curves. Under this (classical) model, the response vector r = (r1, . . . rN)>is conditionally Poisson distributed: ri|s ⇠Poiss(fi(s)), p(r|s) = N Y i=1 1 ri!fi(s)rie−fi(s), (Poisson encoding) (1) where tuning curves fi(s) take the form fi(s) = ⌧A exp ⇣ − 1 2σ2 t (s − ?si)2⌘ , (tuning curves) (2) with equally-spaced preferred stimuli ?s = ( ?s1, . . . ?sN), tuning width σt, amplitude A, and time window for counting spikes ⌧. We assume that the tuning curves “tile”, i.e., sum to a constant over the relevant stimulus range: N X i=1 fi(s) = λ (tiling property) (3) We can determine λ by integrating the summed tuning curves (eq. 3) over the stimulus space, giving R ds PN i=1 fi(s) = NA p 2⇡σt = Sλ, with solution: λ = aσt/∆ (expected total spike count) (4) where ∆= S/N is the spacing between tuning curve centers, and a = p 2⇡A⌧is a constant that we will refer to as the “effective amplitude”, since it depends on true tuning curve amplitude and 2 the time window for integrating spikes. Note, that tiling holds almost perfectly if tuning curves are broad compared to their spacing (e.g. σt > ∆). However, our results hold on average for a much broader range of σt. (See Supplementary Figs S2 and S3 for a numerical analysis.) Let R = P ri denote the total spike count from the entire population. Due to tiling, R is a Poisson random variable with rate λ, regardless of the stimulus: p(R|s) = 1 R!λRe−λ. For simplicity, we will consider stimuli drawn from a zero-mean Gaussian prior with variance σ2 s: s ⇠N(0, σ2 s), p(s) = 1 p 2⇡σs e −s2 2σ2s . (stimulus prior) (5) Since Q i e−fi(s) = e−λ due to the tiling assumption, the likelihood (eq. 1 as a function of s) and posterior both take Gaussian forms: p(r|s) / Y i fi(s)ri / N ( s )) 1 Rr> ?s, 1 Rσ2 t * (likelihood) (6) p(s|r) = N ⇣r> ?s R + ⇢, σ2 t R + ⇢ ⌘ , (posterior) (7) where ⇢= σ2 t /σ2 s denotes the ratio of the tuning curve variance to prior variance. The maximum of the likelihood (eq. 6) is the so-called center-of-mass estimator estimator, 1 Rr> ?s, while the mean of the posteror (eq. 7) is biased toward zero by an amount that depends on ⇢. Note that the posterior variance does not depend on which neurons emitted spikes, only the total spike count R, a fact that will be important for our analyses below. 2.1 Capacity constraints for defining optimality Defining optimality for a population code requires some form of constraint on the capacity of the neural population, since clearly we can achieve arbitrarily narrow posteriors if we allow arbitrarily large total spike count R. In the following, we will consider two different biologically plausible constraints: • A space constraint, in which we constrain only the number of neurons. This means that increasing the tuning width σt will increase the expected population spike count λ (see eq. 4), since more neurons will respond as tuning curves grow wider. • An energy constraint, in which we fix λ while allowing σt and amplitude A to vary. Here, we can make tuning curves wider but must reduce the amplitude so that total expected spike count remains fixed. We will show that the optimal tuning depends strongly on which kind of constraint we apply. 2.2 Analyses based on Fisher Information The Fisher information provides a popular, tractable metric for quantifying the efficiency of a neural code, given by E[−@2 @s2 log p(r|s)], where expectation is taken with respect to encoding distribution p(r|s). For our idealized Poisson population, the total Fisher information is: IF (s) = N X i=1 f 0 i(s)2 fi(s) = N X i=1 A(s − ?si)2 σ4 t exp ⇣ −(s − ?si)2 2σ2 t ⌘ = a σt∆= λ σ2 t , (Fisher info) (8) which we can derive, as before, using the tiling property (eq. 3). (See also Supplemental Sec. S2). The first of the two expressions at right reflects IF for the space constraint, where λ varies implicitly as we vary σt. The second expresses IF under the energy constraint, where λ is constant so that a varies implicitly with σt. For both constraints, IF increases with increasing a and decreasing σt [5]. Fisher information provides a well-known bound on the variance of an unbiased estimator ˆs(r) known as the Cram´er-Rao (CR) bound, namely var(ˆs|s) ≥1/IF (s). Since FI is constant over s in our idealized setting, this leads to a bound on the mean squared error ([7, 12]): MSE , E ⇥ (ˆs(r) −s)2⇤ p(r,s) ≥E  1 IF (s) . p(s) = σt∆ a = σ2 t λ , (9) 3 10 ï 10 1 10 3 space constraint MSE effects of prior stdev 0 2 4 6 8 10 ï 10 ï 10 1 energy constraint MSE tuning width 0 2 4 6 8 10 ï 10 ï 10 0 tuning width 10 ï 10 0 10 2 effects of time window (ms) 8 4 2 1 16 CR bound CR bound 50 100 200 400 = 32 = 25 Figure 2: Mean squared error as a function of the tuning width σt, under space constraint (top row) and energy constraint (bottom row), for spacing ∆= 1 and amplitude A = 20 sp/s. and Top left: MSE for different prior widths σs (with A=2,⌧= 200ms), showing that optimal σt increases with larger prior variance. Cram´er-Rao bound (gray solid) is minimized at σt = 0, whereas bound (eq. 12, gray dashed) accurately captures shape and location of the minimum. Top right: Similar curves for different time windows ⌧for counting spikes (with σs=32), showing that optimal σt increases for lower spike counts. Bottom row: Similar traces under energy constraint (where A scales inversely with σt so that λ = p 2⇡⌧Aσt is constant). Although the CR bound grossly understates the true MSE for small counting windows (right), the optimal tuning is maximally narrow in this configuration, consistent with the CR curve. which is simply the inverse of Fisher Information (eq. 8). Fisher information also provides a (quasi) lower bound on the mutual information, since an efficient estimator (i.e., one that achieves the CR bound) has entropy upper-bounded by that of a Gaussian with variance 1/IF (see [3]). In our setting this leads to the lower bound: MI(s, r) , H(s) −H(s|r) ≥ 1 2 log ⇣ σ2 s a σt∆ ⌘ = 1 2 log ⇣ σ2 s λ σ2 t ⌘ . (10) Note that neither of these FI-based bounds apply exactly to the Bayesian setting we consider here, since Bayesian estimators are generally biased, and are inefficient in the regime of low spike counts [7]. We examine them here nonetheless (gray traces in Figs. 2 and 3) due to their prominence in the prior literature ([5, 12, 14]), and to emphasize their limitations for characterizing optimal codes. 2.3 Exact Bayesian analyses In our idealized population, the total spike count R is a Poisson random variable with mean λ, which allows us to compute the MSE and MI by taking expectations w.r.t. this distribution. Mean Squared Error (MSE) The mean squared error, which equals the average posterior variance (eq. 7), can be computed analytically for this model: MSE = E  σ2 t R + ⇢ . p(R) = 1 X R=0 ✓ σ2 t R + ⇢ ◆λR R! e−λ = σ2 t e−λ Γ(⇢) γ⇤(⇢, −λ) , (11) where ⇢= σ2 t /σ2 s and γ⇤(a, z) = z−a 1 Γ(a) R z 0 ta−1e−tdt is the holomorphic extension of the lower incomplete gamma function [26] (see SI for derivation). When the tuning curve is narrower than the prior (i.e., σ2 t σ2 s ), we can obtain a relatively tight lower bound: MSE ≥ σ2 t λ ( 1 −e−λ* + (σ2 s −σ2 t )e−λ. (12) 4 0 2 4 6 2 4 6 8 0 2 4 6 2 4 6 8 0 2 4 6 0 2 4 6 space constraint MI (bits) energy constraint MI (bits) effects of prior stdev effects of time window (ms) = 32 FI-based bound tuning width tuning width 8 4 1 2 16 = 400 = 25 Figure 3: Mutual information as a function of tuning width σt, directly analogous to plots in Fig. 2. Note the problems with the lower bound on MI derived from Fisher information (top, gray traces) and the close match of the derived bound (eq. 14, dashed gray traces). The effects are similar to Fig. 2, except that MI-optimal tuning widths are slightly smaller (upper left and right) than for MSE-optimal codes. For both loss functions, optimal width is minimal under an energy constraint. Figure 2 shows the MSE (and derived bound) as a function of the tuning width σt over the range where tiling approximately holds. Note the high accuracy of the approximate formula (12, dashed gray traces) and that the FI-based bound does not actually lower-bound the MSE in the case of narrow priors (darker traces). For the space-constrained setting (top row, obtained by substituting λ = aσt/∆in eqs. 11 and 12), we observe substantial discrepancies between the true MSE and FI-based analysis. While FI suggests that optimal tuning width is near zero (down to the limits of tiling), analyses reveal that the optimal σt grows with prior variance (left) and decreasing time window (right). These observations agree well with the existing literature (e.g. [15, 16]). However, if we restrict the average population firing rate (energy constraint, bottom plots), the optimal tuning curves once again approach zero. In this case, FI provides correct intuitions and better approximation of the true MSE. Mutual Information (MI) For a tiling population and Gaussian prior, mutual information between the stimulus and response is: MI(s, r) = 1 2E h log ⇣ 1 + R σ2 s σ2 t ⌘i P (R) , (13) which has no closed-form solution, but can be calculated efficiently with a discrete sum over R from 0 to some large integer (e.g., R = λ + n p λ to capture n standard deviations above the mean). We can derive an upper bound using the Taylor expansion to log while preserving the exact zeroth order term: MI(s, r) 1−e−λ 2 log ⇣ 1 + ( λ 1−e−λ ) σ2 s σ2 t ⌘ = 1−e−aσt/∆ 2 log ⇣ 1 + a 1−e−aσt/∆ σ2 s σt∆ ⌘ (14) Once again, we investigate the efficiency of population coding for neurons, now in terms of the maximal MI. Figure 3 shows MI as a function of the neural tuning width σt. We observe a similar effect as for the MSE: the optimal tuning widths are now different from zero,but only for the space constraint. The energy constraint, as well as implications from FI indicate optimum near σt=0. 5 3 Poisson population coding with input noise We can obtain a more general family of correlated population codes by considering “input noise”, where the stimulus s is corrupted by an additive noise n (see Fig. 1): s ⇠N(0, σ2 s) (prior) (15) n ⇠N(0, σ2 n) (input noise) (16) ri|s, n ⇠Poiss(fi(s + n)) (population response) (17) The use of Gaussians allows us to marginalise over n analytically, resulting in a Gaussian form for the likelihood and Gaussian posterior: p(r|s) / N ( s )) 1 Rr> ?s, 1 Rσ2 t + σ2 n * (likelihood) (18) p(s|r) = N ✓ r> ?s σ2 t /σ2s + R(σ2n/σ2s + 1), (σ2 t + Rσ2 n)σ2 s σ2 t + R(σ2n + σ2s) ◆ (posterior) (19) Note that even in the limit of large spike counts, the posterior variance is non-zero, converging to σ2 nσ2 s/(σ2 n + σ2 s). 3.1 Population coding characteristics: FI, MSE, & MI Fisher information for a population with input noise can be using the fact that the likelihood (eq. 18) is Gaussian: Eq. (18): IF (s) , −E d2 log p(r|s) ds2 . p(r|s) = E  R σ2 t + Rσ2n . p(R) = λe−λ σ2n Γ(1 + ⇢)γ⇤(1 + ⇢, −λ) (20) where ⇢= σ2 t /σ2 n and γ⇤(·, ·) once again denotes holomorphic extension of lower incomplete gamma function. Note that for σn = 0, this reduces to (eq. 8). It is straightforward to employ the results from Sec. 2.3 for the exact Bayes analyses of a Gaussian posterior (19): MSE = σ2 sE  σ2 t + Rσ2 n σ2 t + R(σ2n + σ2s) . p(R) = σ2 s⇢E  1 ⇢+ R . p(R) + σ2 sσ2 n σ2s+σ2n E  R ⇢+ R . p(R) = ⇥ ⇢Γ(⇢)γ⇤(⇢, −λ) + σ2 n σ2s+σ2n λΓ(1 + ⇢)γ⇤(1 + ⇢, −λ) ⇤ σ2 se−λ, (21) MI = 1 2E  log ✓ 1 + Rσ2 s σ2 t + Rσ2n ◆. p(R) , (22) where ⇢= σ2 t /(σ2 s + σ2 n). Although we could not determine closed-form analytical expressions for MI, it can be computed efficiently by summing over a range of integers [0, . . . Rmax] for which P(R) has sufficient support. Note this is still a much faster procedure than estimating these values from Monte Carlo simulations. 3.2 Optimal tuning width under input noise Fig. 4 shows the optimal tuning width under the space constraint: the value of σt minimizing MSE (left) or maximising MI (right) as a function of the prior width σs, for selected time windows of integration ⌧. Blue traces show results for a Poisson population, while green traces correspond to a population with input noise (σn = 1). For both MSE and MI loss functions, optimal tuning width decreases for narrower priors. However, under input noise (green traces), the optimal tuning width saturates at the value that depends on the available number of spikes. As the prior grows wider, the growth of the optimal tuning width depends strongly on the choice of loss function: optimal σt grows approximately logarithmically with σs for minimizing MSE (left), but it grows much slower for maximizing MI (right). Note that for realistic prior widths (i.e. for σs >σn), the effects of input noise on optimal tuning width are far more substantial under MI than under MSE. 6 optimal TC width 0.1 1 10 0 2 4 6 8 prior stdev mutual information 0.1 1 10 0 2 4 6 8 MSE prior stdev = 200 = 50 = 25 = 100 w/ input noise Poisson noise only Figure 4: Optimal tuning width σt (under space constraint only) as a function of prior width σs, for classic Poisson populations (blue) and populations with input-noise (green, σ2 n = 1). Different traces correspond to different time windows of integration, for ∆= 1 and A = 20 sp/s. As σn increases, the optimal tuning width increases under MI, and under MSE when σs < σn (traces not shown). For MSE, predictions of the Poisson and input-noise model converge for priors σs >σn. We have not shown plots for energy-constrained population codes because the optimal tuning width sits at the minimum of the range over which tiling can be said to hold, regardless of prior width, input noise level, time window, or choice of loss function. This can be seen easily in the expressions for MI (eqs. 13 and 22), in which each term in the expectation is a decreasing function of σt for all R > 0. This suggests that, contrary to some recent arguments (e.g., [15, 16]), narrow tuning (at least down to the limit of tiling) really is best if the brain has a fixed energetic budget for spiking, as opposed to a mere constraint on the number of neurons. 4 Correlations induced by input noise Input noise alters the mean, variance, and pairwise correlations of population responses in a systematic manner that we can compute directly (see Supplement for derivations). In Fig. 5 we show the effects input noise with standard deviation σn = 0.5∆, for neurons with the tuning amplitude of A = 10. The tuning curve (mean response) becomes slightly flatter (A), while the variance increases, especially at the flanks (B). Fig. 5C shows correlations between the two neurons with tuning curves and variance are shown in panels A-B: one pair with the same preferred orientation at zero (red) and a second with a 2 degree difference in preferred orientation (blue). From these plots, it is clear that the correlation structure depends on both the tuning as well as the stimulus. Thus, in order to describe such correlations one needs to consider the entire stimulus range, not simply the average correlation marginalized over stimuli. Figure 5D shows the pairwise correlations across an entire population of 21 neurons given a stimulus at s = 0. Although we assumed Gaussian tuning curves here, one obtain similar plots for arbitrary unimodal tuning curves (see Supplement), which should make it feasible to test our predictions in real data. However, the time scale of the input noise and basic neural computations is about 10 ms. At such short spike count windows, available number of spikes is low, and so are correlations induced by input noise. With other sources of second order statistics, such as common input gains (e.g. by contrast or adaptation), these correlations might be too subtle to recover [23]. 5 Discussion We derived exact expressions for mean squared error and mutual information in a Bayesian analysis of: (1) an idealized Poisson population coding model; and (2) a correlated, conditionally Poisson population coding model with shared input noise. These expressions allowed us to examine the optimal tuning curve width under both loss functions, under two kinds of resource constraints. We have confirmed that optimal σt diverges from predictions based on Fisher information, if the overall spike count allowed is allowed to grow with tuning width (i.e., because more neurons respond to the stimulus when tuning curves become broader). We referred to this as a “space constraint” to differentiate it from an “energy constraint”, in which tuning curve amplitude scales down with tuning 7 ï    5  sp / s stimulus s (sp / s)2 ï    5  stimulus s ï   ï ï   correlation stimulus s preferred stim preferred stim ï   ï ï  5  ï ï    A B C D r r mean variance Figure 5: Response statistics of neural population with input noise, for standard deviation σn = 0.5. (A) Expected spike responses of two neurons: ?s1 = 0 (red) and ?s2 = −2 (blue). The common noise effectively smooths blurs the tuning curves with a Gaussian kernel of width σn. (B) Variance of neuron 1, its tuning curve replotted in black for reference. Input noise has largest influence on variance at the steepest parts of the tuning curve. (C) Cross-correlation of the neuron 1 with two others: one sharing the same preference (red), and one with ?s = −2 (blue). Note that correlation of two identically tuned neurons is largest at the steepest part of the tuning curve. (D) Spike count correlations for entire population of 21 neurons given a fixed stimulus s = 0, illustrating that the pattern of correlations is signal dependent. width so that average total spike count is invariant to tuning width. In this latter scenario, predictions from Fisher information are no longer inaccurate, and we find that optimal tuning width should be narrow (down to the limit at which the tiling assumption applies), regardless of the duration, prior width, or input noise level. We also derived explicit predictions for the dependencies (i.e., response correlations) induced by the input noise. These depend on the shape (and scale) of tuning responses, and on the amount of noise (σn). However, for a reasonable assumption that noise distribution is much narrower than the width of the prior (and tuning curves), under which the mean firing rate changes little, we can derive predictions for the covariances directly from the measured tuning curves. An important direction for future work will be to examine the detailed structure of correlations measured in large populations. We feel that the input noise model — which describes exactly those correlations that are most harmful for decoding — has the potential to shed light on the factors affecting the coding capacity in optimal neural populations [23]. Finally, if we return to our example from the Introduction to see how the number of neurons necessary to reach the human discrimination threshold of δs=1 degree changes in the presence of input noise. As σn approaches δs, the number of neurons required goes rapidly to infinity (See Supplementary Fig. S1). Acknowledgments This work was supported by the McKnight Foundation (JP), NSF CAREER Award IIS-1150186 (JP), NIMH grant MH099611 (JP) and the Gatsby Charitable Foundation (AGB). References [1] HS Seung and H. Sompolinsky. Simple models for reading neuronal population codes. Proceedings of the National Academy of Sciences, 90(22):10749–10753, 1993. [2] R. S. Zemel, P. Dayan, and A. Pouget. Probabilistic interpretation of population codes. Neural Comput, 10(2):403–430, Feb 1998. 8 [3] Nicolas Brunel and Jean-Pierre Nadal. Mutual information, fisher information, and population coding. Neural Computation, 10(7):1731–1757, 1998. [4] Kechen Zhang and Terrence J. Sejnowski. Neuronal tuning: To sharpen or broaden? Neural Computation, 11(1):75–84, 1999. [5] A. Pouget, S. Deneve, J. Ducom, and P. E. Latham. Narrow versus wide tuning curves: What’s best for a population code? Neural Computation, 11(1):85–90, 1999. [6] Alexandre Pouget, Sophie Deneve, and Peter E Latham. The relevance of fisher information for theories of cortical computation and attention. Visual attention and cortical circuits, pages 265–284, 2001. [7] M. Bethge, D. Rotermund, and K. Pawelzik. Optimal short-term population coding: When fisher information fails. Neural computation, 14(10):2317–2351, 2002. [8] W. J. Ma, J. M. Beck, P. E. Latham, and A. Pouget. Bayesian inference with probabilistic population codes. Nature Neuroscience, 9:1432–1438, 2006. [9] Marcelo A Montemurro and Stefano Panzeri. Optimal tuning widths in population coding of periodic variables. Neural computation, 18(7):1555–1576, 2006. [10] P. Seri`es, A. A. Stocker, and E. P. Simoncelli. Is the homunculus ’aware’ of sensory adaptation? Neural Computation, 21(12):3271–3304, Dec 2009. [11] R. Haefner and M. Bethge. Evaluating neuronal codes for inference using fisher information. Neural Information Processing Systems, 2010. [12] D. Ganguli and E. P. Simoncelli. Implicit encoding of prior probabilities in optimal neural populations. In J. Lafferty, C. Williams, R. Zemel, J. Shawe-Taylor, and A. Culotta, editors, Adv. Neural Information Processing Systems, volume 23, Cambridge, MA, May 2010. MIT Press. [13] Xue-Xin Wei and Alan Stocker. Efficient coding provides a direct link between prior and likelihood in perceptual bayesian inference. In P. Bartlett, F.C.N. Pereira, C.J.C. Burges, L. Bottou, and K.Q. Weinberger, editors, Advances in Neural Information Processing Systems 25, pages 1313–1321, 2012. [14] Z Wang, A Stocker, and A Lee. Optimal neural tuning curves for arbitrary stimulus distributions: Discrimax, infomax and minimum lp loss. In Advances in Neural Information Processing Systems 25, pages 2177–2185, 2012. [15] P. Berens, A.S. Ecker, S. Gerwinn, A.S. Tolias, and M. Bethge. Reassessing optimal neural population codes with neurometric functions. Proceedings of the National Academy of Sciences, 108(11):4423, 2011. [16] Steve Yaeli and Ron Meir. Error-based analysis of optimal tuning functions explains phenomena observed in sensory neurons. Frontiers in computational neuroscience, 4, 2010. [17] Jeffrey M Beck, Peter E Latham, and Alexandre Pouget. Marginalization in neural circuits with divisive normalization. J Neurosci, 31(43):15310–15319, Oct 2011. [18] Stuart Yarrow, Edward Challis, and Peggy Seri`es. Fisher and shannon information in finite neural populations. Neural Computation, 24(7):1740–1780, 2012. [19] D Ganguli and E P Simoncelli. Efficient sensory encoding and Bayesian inference with heterogeneous neural populations. Neural Computation, 26(10):2103–2134, Oct 2014. Published online: 24 July 2014. [20] E. Zohary, M. N. Shadlen, and W. T. Newsome. Correlated neuronal discharge rate and its implications for psychophysical performance. Nature, 370(6485):140–143, Jul 1994. [21] Keiji Miura, Zachary Mainen, and Naoshige Uchida. Odor representations in olfactory cortex: distributed rate coding and decorrelated population activity. Neuron, 74(6):1087–1098, 2012. [22] Jakob H. Macke, Manfred Opper, and Matthias Bethge. Common input explains higher-order correlations and entropy in a simple model of neural population activity. Phys. Rev. Lett., 106(20):208102, May 2011. [23] Rub´en Moreno-Bote, Jeffrey Beck, Ingmar Kanitscheider, Xaq Pitkow, Peter Latham, and Alexandre Pouget. Information-limiting correlations. Nat Neurosci, 17(10):1410–1417, Oct 2014. [24] K. Josic, E. Shea-Brown, B. Doiron, and J. de la Rocha. Stimulus-dependent correlations and population codes. Neural Comput, 21(10):2774–2804, Oct 2009. [25] G. Dehaene, J. Beck, and A. Pouget. Optimal population codes with limited input information have finite tuning-curve widths. In CoSyNe, Salt Lake City, Utah, February 2013. [26] NIST Digital Library of Mathematical Functions. http://dlmf.nist.gov/, Release 1.0.9 of 2014-08-29. [27] David C Burr and Sally-Ann Wijesundra. Orientation discrimination depends on spatial frequency. Vision Research, 31(7):1449–1452, 1991. [28] Russell L De Valois, E William Yund, and Norva Hepler. The orientation and direction selectivity of cells in macaque visual cortex. Vision research, 22(5):531–544, 1982. 9
2014
3
5,402
Parallel Sampling of HDPs using Sub-Cluster Splits Jason Chang CSAIL, MIT jchang7@csail.mit.edu John W. Fisher III CSAIL, MIT fisher@csail.mit.edu Abstract We develop a sampling technique for Hierarchical Dirichlet process models. The parallel algorithm builds upon [1] by proposing large split and merge moves based on learned sub-clusters. The additional global split and merge moves drastically improve convergence in the experimental results. Furthermore, we discover that cross-validation techniques do not adequately determine convergence, and that previous sampling methods converge slower than were previously expected. 1 Introduction Hierarchical Dirichlet Process (HDP) mixture models were first introduced by Teh et al. [2]. HDPs extend the Dirichlet Process (DP) to model groups of data with shared cluster statistics. Since their inception, HDPs and related models have been used in many statistical problems, including document analysis [2], object categorization [3], and as a prior for hidden Markov models [4]. The success of HDPs has garnered much interest in inference algorithms. Variational techniques [5, 6] are often used for their parallelization and speed, but lack the limiting guarantees of Markov chain Monte Carlo (MCMC) methods. Unfortunately, MCMC algorithms tend to converge slowly. In this work, we extend the recent DP Sub-Cluster algorithm [1] to HDPs to accelerate convergence by inferring “sub-clusters” in parallel and using them to propose large split moves. Extensions to the HDP are complicated by the additional DP, which violates conjugacy assumptions used in [1]. Furthermore, split/merge moves require computing the joint model likelihood, which, prior to this work, was unknown in the common Direct Assignment HDP representation [2]. We discover that significant overlap in cluster distributions necessitates new global split/merge moves that change all clusters simultaneously. Our experiments on synthetic and real-world data validate the improved convergence of the proposed method. Additionally, our analysis of joint summary statistics suggests that other MCMC methods may converge prematurely in finite time. 2 Related Work The seminal work of [2] introduced the Chinese Restaurant Franchise (CRF) and the Direct Assignment (DA) sampling algorithms for the HDP. Since then, many alternatives have been developed. Because HDP inference often extends methods from DPs, we briefly discuss relevant work on both models that focus on convergence and scalability. Current methods are summarized in Table 1. Simple Gibbs sampling methods, such as CRF or DA, may converge slowly in complex models. Works such as [11, 12, 13, 14] address this issue in DPs with split/merge moves. Wang and Blei [7] developed the only split/merge MCMC method for HDPs by extending the Sequentially Allocated Merge-Split (SAMS) algorithm of DPs developed in [13]. Unfortunately, reported results in [7] only show a marginal improvement over Gibbs sampling. Our experiments suggest that this is likely due to properties of the specific sampler, and that a different formulation significantly improves convergence. Additionally, SAMS cannot be parallelized, and is therefore only tested on a corpus with 263K words. By designing a parallel algorithm, we test on a corpus of 100M words. 1 Table 1: Capabilities of MCMC Sampling Algorithms for HDPs CRF [2] DA [2] SAMS [7] FSD [4] Hog-Wild [8] Super-Cluster [9] Proposed Infinite Model ✓ ✓ ✓ · ✓ ✓ ✓ MCMC Guarantees ✓ ✓ ✓ ✓ · ✓ ✓ Non-Conjugate Priors ∗ ∗ · ✓ · ∗ ✓ Parallelizable · · · ✓ ✓ ✓ ✓ Local Splits/Merges · · ✓ · · · ✓ Global Splits/Merges · · · · · · ✓ ∗potentially possible with some adapatation of the DP Metropolis-Hastings framework of [10]. There has also been work on parallel sampling algorithms for HDPs. Fox et al. [4] generalizes the work of Ishwaran and Zarepour [15] by approximating the highest-level DP with a finite symmetric Dirichlet (FSD). Iterations of this approximation can be parallelized, but fixing the model order is undesirable since it no longer grows with the data. Furthermore, our experiments suggest that this algorithm exhibits poor convergence. Newman et al. [8] present an alternative parallel approximation related to Hog-Wild Gibbs sampling [16, 17]. Each processor independently runs a Gibbs sampler on its assigned data followed by a resynchronization step across all processors. This approximation has shown to perform well on cross-validation metrics, but loses the limiting guarantees of MCMC. Additionally, we will show that cross-validation metrics are not suitable to analyze convergence. An exact parallel algorithm for DPs and HDPs was recently developed by Willamson et al. [9] by grouping clusters into independent super-clusters. Unfortunately, the parallelization does not scale well [18], and convergence is often impeded [1]. Regardless of exactness, all current parallel sampling algorithms exhibit poor convergence due to their local nature, while split/merge proposals are essentially ineffective and cannot be parallelized. 2.1 DP Sub-Clusters Algorithm The recent DP Sub-Cluster algorithm [1] addresses these issues by combining non-ergodic Markov chains into an ergodic chain and proposing splits from learned sub-clusters. We briefly review relevant aspects of the DP Sub-Cluster algorithm here. MCMC algorithms typically satisfy two conditions: detailed balance and ergodicity. Detailed balance ensures that the target distribution is a stationary distribution of the chain, while ergodicity guarantees uniqueness of the stationary distribution. The method of [1] combines a Gibbs sampler that is restricted to non-empty clusters with a Metropolis-Hastings (MH) algorithm that proposes splits and merges. Since any Gibbs or MH sampler satisfies detailed balance, the true posterior distribution is guaranteed to be a stationary distribution of the chain. Furthermore, the combination of the two samplers enforces ergodicity and guarantees the convergence to the stationary distribution. The DP Sub-Cluster algorithm also augments the model with auxiliary variables that learn a twocomponent mixture model for each cluster. These “sub-clusters” are subsequently used to propose splits that are learned over time instead of built in a single iteration like previous methods. In this paper, we extend these techniques to HDPs. As we will show, considerable work is needed to address the higher-level DP and the overlapping distributions that exist in topic modeling. 3 Hierarchical Dirichlet Processes We begin with a brief review of the equivalent CRF and DA representations of the HDP [2] depicted in Figures 1a–1b. Due to the prolific use of HDPs in topic modeling, we refer to the variables with their topic modeling names. β is the corpus-level, global topic proportions, θk is the parameter for topic k, and xji is the ith word in document j. Here, the CRF and DA representations depart. In the CRF, ˜πj is drawn from a stick-breaking process [19], and each “customer” (i.e., word) is assigned to a “table” through tji ∼Categorical(˜πj). The higher-level DP then assigns “dishes” (i.e., topics) to tables via kjt ∼Categorical(β). The association of customers to dishes through the tables is equivalent to assigning a word to a topic. In the CRF, multiple tables can be assigned the same dish. The DA formulation combines these multiple instances and directly assigns a word to a topic with zji. The resulting document-specific topic proportions, πj, aggregates multiple ˜πj values. For 2 (a) HDP CRF Model (b) HDP DA Model (c) HDP Augmented DA Model Figure 1: Graphical models. (c) Hyper-parameters are omitted and auxiliary variables are dotted. Figure 2: Visualization of augmented sample space. reasons which will be discussed, inference in the DA formulation still relies on some aspects of the CRF. We adopt the notation of [2], where the number of tables in restaurant j serving dish k is denoted mjk, and the number of customers in restaurant j at table t eating dish k is njtk. Marginal counts are represented with dots, e.g., nj·· ≜P t,k njtk and mj· ≜P k mjk represent the number of customers and dishes in restaurant j, respectively. We refer the reader to [2] for additional details. 4 Restricted Parallel Sampling We draw on the DP Sub-Cluster algorithm to combine a restricted, parallel Gibbs sampler with split/merge moves (as described in Section 2.1). The former is detailed here, and the latter is developed in Section 5. Because the restricted Gibbs sampler cannot create new topics, dimensions of the infinite vectors β, π, and θ associated with empty clusters need not be instantiated. Extending the DA sampling algorithm of [2] results in the following restricted posterior distributions: p(β|m) = Dir(m·1, . . . , m·K, γ), (1) p(πj|β, z) = Dir(αβ1 + nj·1, . . . , αβK + nj·K, αβK+1), (2) p(θk|x, z) ∝fx(xIk; θk)fθ(θk; λ), (3) p(zji|x, πj, θ) ∝PK k=1 πjkfx(xji; θk)1I[zji = k], (4) p(mjk|β, z) = fm(mjk; αβk, nj·k) ≜ Γ(αβk) Γ(αβk+nj·k)s(nj·k, mjk)(αβk)mjk. (5) Since p(β|π) is not known analytically, we use the auxiliary variable, mjk, as derived by [2, 20]. Here, s(n, m) denotes unsigned Stirling numbers of the first kind. We note that β and π are now (K + 1)–length vectors partitioning the space, where the last components, βK+1 and πj(K+1), aggregate the weight of all empty topics. Additionally, Ik ≜{j, i; zji = k} denotes the set of indices in topic k, and fx and fθ denote the observation and prior distributions. We note that if fθ is conjugate to fx, Equation (3) stays in the same family of parametric distributions as fθ(θ; λ). Equations (1–5), each of which can be sampled in parallel, fully specify the restricted Gibbs sampler. The astute reader may notice similarities with the FSD approximation used in [4]. The main differences are that the β distribution in Equation (1) is exact, and that sampling z in Equation (4) is explicitly restricted to non-empty clusters. Unlike [4], however, this sampler is guaranteed to converge to the true HDP model when combined with any split move (cf. Section 2.1). 5 Augmented Sub-Cluster Space for Splits and Merges In this section we develop the augmented, sub-cluster model, which is aimed at finding a twocomponent mixture model containing a likely split of the data. As demonstrated in [1], these splits perform well in DPs because they improve at every iteration of the algorithm. Unfortunately, because these splits perform poorly in HDPs, we modify the formulation to propose more flexible moves. For each topic, k, we fit two sub-topics, kℓand kr, referred to as the “left” and “right” sub-topics. Each topic is augmented with auxiliary global sub-topic proportions, βk = {βkℓ, βkr}, document3 level sub-topic proportions, πjk = {πjkℓ, πjkr}, and sub-topic parameters, θk = {θkℓ, θkr}. Furthermore, a sub-topic assignment, zji ∈{ℓ, r} is associated with each word, xji. The augmented space is summarized in Figure 1c and visualized in Figure 2. These auxiliary variables are denoted with the same symbol as their “regular-topic” counterparts to allude to their similarities. Extending the work of [1], we adopt the following auxiliary generative and marginal posterior distributions: Generative Distributions Marginal Posterior Distributions p(βk) = Dir(γ, γ), p(βk|•) = Dir(γ + m·kℓ, γ + m·kr), (6) p(πjk|βk) = Dir(αβkℓ, αβkr), p(πjk|•) = Dir(αβkℓ+nj·kℓ,αβkr+nj·kr), (7) p(θk|π, z, x) = Y h∈{ℓ,r} fθ(θkh; λ) Y j,i∈Ik Zji(π, θ, z, x), p(θkh|•) ∝fx(xIkh; θkh)fθ(θkh; λ), (8) p(z|π, θ, z, x) = YK k=1 Y j,i∈Ik πjkzjifx(xji;θkzji) Zji(π,θ,z,x) , p(zji|•) ∝πjzjizjifx(xji; θzjizji) (9) Zji(π, θ, z, x) ≜ X h∈{ℓ,r}πjzjihfx(xji; θzjih), p(mjkh|•) = fm(mjkh; αβkh, nj·kh), (10) where • denotes all other variables. Full derivations are given in the supplement. Notice the similarity between these posterior distributions and Equations (1–5). Inference is performed by interleaving the sampling of Equations (1–5) with Equations (6–10). Furthermore, each step can be parallelized. 5.1 Sub-Topic Split/Merge Proposals We adopt a Metropolis-Hastings (MH) [21] framework that proposes a split/merge from the subtopics and either accepts or rejects it. Denoting v ≜{β, π, z, θ} and v ≜{β, π, z, θ} as the set of regular and auxiliary variables, a sampled proposal, {ˆv, ˆv} ∼q(ˆv, ˆv|v) is accepted with probability Pr[{v, v} = {ˆv, ˆv}] = min h 1, p(x,ˆv)p(ˆv|x,ˆv) p(x,v)p(v|x,v) · q(v|x,ˆv)q(v|x,ˆv,v) q(ˆv|x,v)q(ˆv|x,v,ˆv) i = min [1, H] . (11) H, is known as the Hastings ratio. Algorithm 1 outlines a general split/merge MH framework, where steps 1–2 propose a sample from q(ˆv|x, v)q(ˆv|x, v, v, ˆv). Sampling the variables other than ˆz is detailed here, after which we discuss three versions of Algorithm 1 with variants on sampling ˆz. Algorithm 1 Split-Merge Framework 1. Propose assignments, ˆz, global proportions, ˆβ, document proportions, ˆπ, and parameters, ˆθ. 2. Defer the proposal of auxiliary variables to the restricted sampling of Equations (1–10). 3. Accept/reject the proposal with the Hastings ratio. (Step 1: ˆβ): In Metropolis-Hastings, convergence typically improves as the proposal distribution is closer to the target distribution. Thus, it would be ideal to propose ˆβ from p(β|ˆz). Unfortunately, p(β|z) cannot be expressed analytically without conditioning on the dish counts, m·k, as in Equation (1). Since the distribution of dish counts depends on β itself, we approximate its value with ˜mjk(z) ≜arg maxm p(m|β = 1/K, z) = arg maxm Γ(1/K) Γ(1/K+nj·k)s(nj·k, m)( 1 K )m, (12) where the global topic proportions have essentially been substituted with 1/K. We note that the dependence on z is implied through the counts, n. We then propose global topics proportions from ˆβ ∼q(ˆβ|ˆz) = p(ˆβ| ˜m(ˆz)) = Dir ( ˜m·1(ˆz), · · · , ˜m·K(ˆz), γ) . (13) We will denote ˜mjk ≜˜mjk(z) and ˆ˜mjk ≜˜mjk(ˆz). We emphasize that the approximate ˆ˜mjk is only used for a proposal distribution, and the resulting chain will still satisfy detailed balance. (Step 1: ˆπ): Conditioned on β and z, the distribution of π is known to be Dirichlet. Thus, we propose ˆπ ∼p(ˆπ|ˆβ, ˆz) by sampling directly from the true posterior distribution of Equation (2). (Step 1: ˆθ): If fθ is conjugate to fx, we sample ˆθ directly from the posterior of Equation (3). If non-conjugate models, any proposal can be used while adjusting for it in the Hastings ratio. 4 (Step 2): We use the Deferred MH sampler developed in [1], which sets q(ˆv|x, ˆv) = p(ˆv|x, ˆv) by deferring the sampling of auxiliary variables to the restricted sampler of Section 5. Splits and merges are then only proposed for topics where auxiliary variables have already burned-in. In practice burnin is quite fast, and is determined by monitoring the sub-topic data likelihoods. (Step 3): Finally, the above proposals results in the following the Hastings ratio: H = p( ˆβ,ˆz)p(x|ˆz) p(β,z)p(x|z) · q(z|ˆv,ˆv)q(β|z) q(ˆz|v,v)q( ˆβ|ˆz). (14) The data likelihood, p(x|z) is known analytically, and q(β|z) can be calculated according to Equation 13. The prior distribution, p(β, z), is expressed in the following proposition: Proposition 5.1. Let z be a set of topic assignments with integer values in {1, . . . , K}. Let β be a (K+1)–length vector representing global topic weights, and βK+1 be the sum of weights associated with empty topics. The prior distribution, p(β, z), marginalizing over π, can be expressed as p(β, z) = h γβγ−1 K+1 YK k=1 β−1 k i × h YD j=1 Γ(α) Γ(α+nj··) YK k=1 Γ(αβk+nj·k) Γ(αβk) i . (15) Proof. See supplemental material. The remaining term in Equation (14), q(ˆz|v, v), is the probability of proposing a particular split. In the following sections, we describe three possible split constructions using the sub-clusters. Since the other steps remain the same, we only discuss the proposal distributions for ˆz and ˆβ. 5.1.1 Deterministic Split/Merge Proposals The method of [1] constructs a split deterministically by copying the sub-cluster labels for a single cluster. We refer to this proposal as a local split, which only changes assignments within one topic, as opposed to a global split (discussed shortly), which changes all topic assignments. A local deterministic split will essentially be accepted if the joint likelihood increases. Unfortunately, as we show in the supplement, samples from the typical set of an HDP do not have high likelihood. Deterministic split and merge proposals are, consequently, very rarely accepted. We now suggest two alternative pairs of split and merge proposals, each with their own benefits and drawbacks. 5.1.2 Local Split/Merge Proposals Here, we depart from the approach of [1] by sampling a local split of topic a into topics b and c. Temporary parameters, {˜πb, ˜πc, ˜θb, ˜θc}, and topic assignments, ˆz, are sampled according to (˜πb, ˜πc) = πa · (πaℓ, πar), (˜θb, ˜θc) = (θaℓ, θar), ) =⇒q(ˆz|v, v) ∝ Y j,i∈Ia X k∈{b,c} ˜πkfx(xji; ˜θk)1I[ˆzji = k]. (16) We note that a sample from q(ˆz|v, v) is already drawn from the restricted Gibbs sampler described in Equation (9). Therefore, no additional computation is needed to propose the split. If the split is rejected, the ˆz is simply used as the next sample of the auxiliary z for cluster a. A ˆβ is then drawn by splitting βa into ˆβb and ˆβc according to a local version of Equation (13): q(ˆβb, ˆβc|ˆz, βa) = Dir(ˆβb/βa, ˆβc/βa; ˆ˜m·b, ˆ˜m·c). (17) The corresponding merge move combines topics b and c into topic a by deterministically performing q(ˆzji|v) = 1I[ˆzji = a], ∀j, i ∈Ib ∪Ic, q(ˆβa|v) = δ(ˆβa −(βb + βc)). (18) This results in the following Hastings ratio for a local split (derivation in supplement): H = γΓ( ˆ˜m·b)Γ( ˆ˜m·c) Γ( ˆ˜m·b+ ˆ˜m·c) β ˆ˜ m·b+ ˆ˜ m·c a ˆβ ˆ˜ m·b b ˆβ ˆ˜ m·c c p(x|ˆz) p(x|z) 1 q(ˆz|v,v) QM K+1 QS K Y j Γ(αβa) Γ(αβa+nj·a) Y k∈{b,c} Γ(α ˆβk+ˆnj·k) Γ(α ˆβk) , (19) where QS K and QM K are the probabilities of selecting a specific split or merge with K topics. We record q(ˆz|v, v) when sampling from Equation (9), and all other terms are computed via sufficient statistics. We set QS K = 1 by proposing all splits at each iteration. QM K will be discussed shortly. 5 The Hastings ratio for a merge is essentially the reciprocal of Equation (19). However, the reverse split move, q(z|ˆv, ˆv), relies on the inferred sub-topic parameters, ˆπ and ˆθ, which are not readily available due to the Deferred MH algorithm. Instead, we approximate the Hastings ratio by substituting the two original topic parameters, θb and θc, for the proposed sub-topics. The quality of this approximation rests on the similarity between the regular-topics and the sub-topics. Generating the reverse move that splits topic a into b and c can then be approximated as q(z|ˆv, ˆv) ≈ Y j,i∈Ib∪Ic πzjifx(xji;θzji) πbfx(xi;θb)+πcfx(xi;θc) = LbbLcc LbcLcb , (20) Lkk ≜ Y j,i∈Ik πkfx(xji; θk), Lkl ≜ Y j,i∈Ik [πkfx(xji; θk) + πlfx(xji; θl)] . (21) All of the terms in Equation (20) are already calculated in the restricted Gibbs steps. When aggregated correctly in the K × K matrix, L, the Hastings ratio for any proposed merge is evaluated in constant time. However, if topics b and c are merged into a, further merging a with another cluster cannot be efficiently computed without looping through the data. We therefore only propose ⌊K/2⌋ merges by generating a random permutation of the integers [1, K], and proposing to merge disjoint neighbors. For example, if the random permutation for K = 7 is { 3 1 7 4 2 6 5}, we propose to merge topics 3 and 1, topics 7 and 4, and topics 2 and 6. This results in QM K = 2⌊K/2⌋ K(K−1). 5.1.3 Global Split/Merge Proposals In many applications where clusters have significant overlap (e.g., topic modeling), local splits may be too constrained since only points within a single topic change. We now develop a global split and merge move, which reassign the data in all topics. A global split first constructs temporary topic proportions, ˜π, and parameters, ˜θ, followed by proposing topic assignments for all words with: (˜πb, ˜πc) = πa · (πaℓ, πar), ˜πk = πk, ∀k ̸= a, (˜θb, ˜θc) = (θaℓ, θar), ˜θk = θk, ∀k ̸= a, ) =⇒q(ˆz|v, v) = Y j,i ˜πˆzjifx(xji; ˜θˆzji) P k ˜πkfx(xji; ˜θk) . (22) Similarly, the corresponding merge move is constructed according to ˜πa = πb + πc, ˜πk = πk, ∀k ̸= b, c, ˜θa ∼q(˜θa|z, x), ˜θk = θk, ∀k ̸= b, c, ) =⇒q(ˆz|v, v) = Y j,i ˜πˆzjifx(xji; ˜θˆzji) P k ˜πkfx(xji; ˜θk) . (23) The proposal for ˜θa is written in a general form; if priors are conjugate, one should propose directly from the posterior. After Equations (22)–(23), ˆβ is sampled via Equation (13). All remaining steps follow Algorithm 1. The resulting Hastings ratio for a global split (see supplement) is expressed as H = γΓ(γ+ ˜m··) Γ(γ+ ˆ˜m··) p(x|ˆz) p(x|z) q(z|ˆv,ˆv)q(˜θa|z) q(ˆz|v,v) QM K+1 QS K K Y k=1 β ˜ m·k k Γ( ˜m·k) D Y j=1 Γ(αβk) Γ(αβk+nj·k) K+1 Y k=1 Γ( ˆ˜m·k) ˆβ ˆ˜ m·k k D Y j=1 Γ(α ˆβk+ˆnj·k) Γ(α ˆβk) . (24) Similar to local merges, the Hastings ratio for a global merge depends on the proposed sub-topics parameters. We approximate these with the main-topic parameters prior to the merge. Unlike the local split/merge proposals, proposing ˆz requires significant computation by looping through all data points. As such, we only propose a single global split and merge each iteration. Thus, QS K = 1/K and QM K = 2/(K(K −1)). We emphasize that the developed global moves are very different from previous local split/merge moves in DPs and HDPs (e.g., [1, 7, 11, 13, 14]). We conjecture that this is the reason the split/merge moves in [7] only made negligible improvement. 6 Experiments We now test the proposed HDP Sub-Clusters method on topic modeling. The algorithm is summarized in the following steps: (1) initialize β and z randomly; (2) sample π, θ, π, and θ via Equations (2, 3, 7, 8); (3) sample z and z via Equations (4, 9); (4) propose ⌊K 2 ⌋local merges followed by K local splits; (5) propose a global merge followed by a global split; (6) sample m and m via Equations (5, 10); (7) sample β and β via Equations (1, 6); (8) repeat from Step 2 until convergence. We fix the hyper-parameters, but resampling techniques [2] can easily be incorporated. All results are averaged over 10 sample paths. Source code can be downloaded from http://people.csail.mit.edu/jchang7. 6 (a) Visualizing Topics 10 -4 10 -3 10 2 10 3 -3.5 -3 -2.5 -2 secs (log scale) HOW Log Like. 0 10 20 Topics Num. (d) Algorithm Comparison 10 -2 10 1 0 10 20 Num. Topics secs (log scale) Det. Local Global Combined (b) Split/Merge Moves 10 -2 10 1 0 10 20 Num. Topics Combined secs (log scale) 1 Proc. 2 Procs. 4 Procs. 8 Procs. (c) Parallelization Figure 3: Synthetic “bars” example. (a) Visualizing topic word distributions without splits/merges for K = 5. (b)–(c) Number of inferred topics for different split/merge proposals and parallelizations. (d) Comparing sampling algorithms with a single processor and initialized to a single topic. -8.4 -8.2 -8 0 1000 0 50 100 secs HOW Log Like. Num. Topics -7.8 HOW Log Likelihood Number of Topics 0 100 -8.4 -8.2 -8 -7.8 (a) AP Results with Different Initializations -8.4 -8.2 -8 0 2000 0 50 100 secs HOW Log Like. Num. Topics -7.8 HOW Log Likelihood Number of Topics 0 100 -8.4 -8.2 -8 -7.8 (b) AP Results with Switching Algorithms Figure 4: Results on AP. (a) 1, 25, 50, and 75 initial topics. (b) Switching algorithms at 1000 secs. 6.1 Synthetic Bars Dataset We synthesized 200 documents from the “bars” example of [22] with a dictionary of 25 words that can be arranged in a 5x5 grid. Each of the 10 true topics forms a horizontal or vertical bar. To visualize the sub-topics, we initialize to 5 topics and do not propose splits or merges. The resulting regular- and sub-topics are shown in Figure 3a. Notice how the sub-topics capture likely splits. Next, we consider different split/merge proposals in Figure 3b. The “Combined” algorithm uses local and global moves. The deterministic moves are often rejected resulting in slow convergence. While global moves are not needed in such a well-separated dataset, we have observed that the make a significant impact in real-world datasets. Furthermore, since every step of the sampling algorithm can be parallelized, we achieve a linear speedup in the number of processors, as shown in Figure 3c. Figure 3d compares convergence without parallelization to the Direct Assignment (DA) sampler and the Finite Symmetric Dirichlet (FSD) of order 20. Since all algorithms should sample from the same model, the goal here is to analyze convergence speed. We plot two summary statistics: the likelihood of a single held-out word (HOW) from each document, and the number of inferred topics. While the HOW likelihood for FSD converges at 1 second, the number of topics converges at 100 seconds. This suggests that cross-validation techniques, which evaluate model fit, cannot solely determine MCMC convergence. We note that FSD tends to first create all L topics and slowly remove them. 6.2 Real-World Corpora Datasets Next, we consider the Associated Press (AP) dataset [23] with 436K words in 2K documents. We manually set the FSD order to 100. Results using 16 cores (except DA, which cannot be parallelized) with 1, 25, 50, and 75 initial topics are shown in Figure 4a. All samplers should converge to the same statistics regardless of the initialization. While HOW likelihood converges for 3/4 FSD initializations, the number of topics indicates that no DA or FSD sample paths have converged. Unlike the well-separated, synthetic dataset, the Sub-Clusters method that only uses local splits and merges does not converge to a good solution here. In contrast, all initializations of the Sub-Clusters method have converged to a high HOW likelihood with only approximately 20 topics. The path taken by each sampler in the joint HOW likelihood / number of topics space is shown in the right panel of Figure 4a. This visualization helps to illustrate the different approaches taken by each algorithm. Figure 5a shows confusion matrices, C, of the inferred topics. Each element of C is defined as: Cr,c = P x fx(x; θr) log fx(x; θc), and captures the likelihood of a random word from topic r 7 (a) Confusion Matrices for AP (b) Four Topics from NYTimes Figure 5: (a) Confusion matrices on AP for SUB-CLUSTERS, DA, and FSD (left to right). Outlines are overlaid to compare size. (b) Four inferred topics from the NYTimes articles. 10 -1 10 0 10 4 10 5 0 100 200 Num. Topics -8.6 -8.2 -7.8 HOW Log Like. secs (log scale) 0 200 -8.6 -8.2 -7.8 Number of Topics HOW Log Likelihood (a) Enron Results -9.3 -9 -8.7 10 -1 10 0 10 4 10 5 0 100 200 Num. Topics HOW Log Like. secs (log scale) -9.3 -9 -8.7 0 200 Number of Topics HOW Log Likelihood (b) NYTimes Results Figure 6: Results on (a) Enron emails and (b) NYTimes articles for 1 and 50 initial topics. evaluated under topic c. DA and FSD both converge to many topics that are easily confused, whereas the Sub-Clusters method converges to a smaller set of more distinguishable topics. Rigorous proofs about convergence are quite difficult. Furthermore, even though the approximations made in calculating the Hastings ratios for local and global splits (e.g., Equation (20)) are backed by intuition, they complicate the analysis. Instead, we run each sample path for 2,000 seconds. After 1,000 seconds, we switch the Sub-Clusters sample paths to FSD and all other sample paths to SubClusters. Markov chains that have converged should not change when switching the sampler. Figure 4b shows that switching from DA, FSD, or the local version of Sub-Clusters immediately changes the number of topics, but switching Sub-Clusters to FSD has no effect. We believe that the number of topics is slightly higher in the former because the Sub-Cluster method struggles to create small topics. By construction, the splits make large moves, in contrast to DA and FSD, which often create single word topics. This suggests that alternating between FSD and Sub-Clusters may work well. Finally, we consider two large datasets from [24]: Enron Emails with 6M words in 40K documents and NYTimes Articles with 100M words in 300K documents. We note that the NYTimes dataset is 3 orders of magnitude larger than those considered in the HDP split/merge work of [7]. Again, we manually set the FSD order to 200. Results are shown in Figure 6 initialized to 1 and 50 topics. In such large datasets, it is difficult to predict convergence times; after 28 hours, it seems as though no algorithms have converged. However, the Sub-Clusters method seems to be approaching a solution, whereas FSD has yet to prune topics and DA has yet to to achieve a good cross-validation score. Four inferred topics using the Sub-Clusters method on the NYTimes dataset are visualized in Figure 5b. These words seem to describe plausible topics (e.g., music, terrorism, basketball, and wine). 7 Conclusion We have developed a new parallel sampling algorithm for the HDP that proposes split and merge moves. Unlike previous attempts, the proposed global splits and merges exhibit significantly improved convergence in a variety of datasets. We have also shown that cross-validation metrics in isolation can lead to the erroneous conclusion that an MCMC sampling algorithm has converged. By considering the number of topics and held-out likelihood jointly, we show that previous sampling algorithms converge very slowly. Acknowledgments This research was partially supported by the Office of Naval Research Multidisciplinary Research Initiative program, award N000141110688 and by VITALITE, which receives support from Army Research Office Multidisciplinary Research Initiative program, award W911NF-11-1-0391. 8 References [1] J. Chang and J. W. Fisher, III. Parallel sampling of DP mixture models using sub-clusters splits. In Advances in Neural Information and Processing Systems, Dec 2013. [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] E. B. Sudderth. Graphical Models for Visual Object Recognition and Tracking. PhD thesis, Massachusetts Institute of Technology, 2006. [4] E. B. Fox, E. B. Sudderth, M. I. Jordan, and A. S. Willsky. An HDP-HMM for systems with state persistence. In International Conference on Machine Learning, July 2008. [5] Y. W. Teh, K. Kurihara, and M. Welling. Collapsed variational inference for HDP. In Advances in Neural Information Processing Systems, volume 20, 2008. [6] M. Bryant and E. Sudderth. Truly nonparametric online variational inference for Hierarchical Dirichlet processes. In Advances in Neural Information Processing Systems, 2012. [7] C. Wang and D Blei. A split-merge MCMC algorithm for the Hierarchical Dirichlet process. arXiv:1207.1657 [stat.ML], 2012. [8] D. Newman, A. Asuncion, P. Smyth, and M. Welling. Distributed algorithms for topic models. Journal of Machine Learning Research, 10:1801–1828, December 2009. [9] S. Williamson, A. Dubey, and E. P. Xing. Parallel Markov chain Monte Carlo for nonparametric mixture models. In International Conference on Machine Learning, 2013. [10] R. Neal. Markov chain sampling methods for Dirichlet process mixture models. Journal of Computational and Graphical Statistics, 9(2):249–265, June 2000. [11] S. Jain and R. Neal. A split-merge Markov chain Monte Carlo procedure for the Dirichlet process mixture model. Journal of Computational and Graphical Statistics, 13:158–182, 2000. [12] P. J. Green and S. Richardson. Modelling heterogeneity with and without the Dirichlet process. Scandinavian Journal of Statistics, pages 355–375, 2001. [13] D. B. Dahl. An improved merge-split sampler for conjugate Dirichlet process mixture models. Technical report, University of Wisconsin - Madison Dept. of Statistics, 2003. [14] S. Jain and R. Neal. Splitting and merging components of a nonconjugate Dirichlet process mixture model. Bayesian Analysis, 2(3):445–472, 2007. [15] H. Ishwaran and M. Zarepour. Exact and approximate sum-representations for the Dirichlet process. Canadian Journal of Statistics, 30:269–283, 2002. [16] F. Niu, B. Recht, C. R´e, and S. J. Wright. Hogwild!: A lock-free approach to parallelizing stochastic gradient descent. In Advances in Neural Information Processing Systems, 2011. [17] M. J. Johnson, J. Saunderson, and A. S. Willsky. Analyzing hogwild parallel gaussian gibbs sampling. In Advances in Neural Information Processing Systems, 2013. [18] Y. Gal and Z. Ghahramani. Pitfalls in the use of parallel inference for the Dirichlet process. In Workshop on Big Learning, NIPS, 2013. [19] J. Sethuraman. A constructive definition of Dirichlet priors. Statstica Sinica, pages 639–650, 1994. [20] C. E. Antoniak. Mixtures of Dirichlet processes with applications to Bayesian nonparametric problems. Annals of Statistics, 2(6):1152–1174, 1974. [21] W. K. Hastings. Monte Carlo sampling methods using Markov chains and their applications. Biometrika, 57(1):97–109, 1970. [22] T. L. Griffiths and M. Steyvers. Finding scientific topics. Proceedings of the National Academy of Sciences, 101:5228–5235, April 2004. [23] D. M. Blei, A. Y. Ng, and M. I. Jordan. Latent Dirichlet allocation. Journal of Machine Learning Research, 3:993–1022, March 2003. [24] K. Bache and M. Lichman. UCI Machine Learning Repository, 2013. 9
2014
30
5,403
Cone-constrained Principal Component Analysis Yash Deshpande Electrical Engineering Stanford University Andrea Montanari Electrical Engineering and Statistics Stanford University Emile Richard Electrical Engineering Stanford University Abstract Estimating a vector from noisy quadratic observations is a task that arises naturally in many contexts, from dimensionality reduction, to synchronization and phase retrieval problems. It is often the case that additional information is available about the unknown vector (for instance, sparsity, sign or magnitude of its entries). Many authors propose non-convex quadratic optimization problems that aim at exploiting optimally this information. However, solving these problems is typically NP-hard. We consider a simple model for noisy quadratic observation of an unknown vector v0. The unknown vector is constrained to belong to a cone C ∋v0. While optimal estimation appears to be intractable for the general problems in this class, we provide evidence that it is tractable when C is a convex cone with an efficient projection. This is surprising, since the corresponding optimization problem is non-convex and –from a worst case perspective– often NP hard. We characterize the resulting minimax risk in terms of the statistical dimension of the cone δ(C). This quantity is already known to control the risk of estimation from gaussian observations and random linear measurements. It is rather surprising that the same quantity plays a role in the estimation risk from quadratic measurements. 1 Introduction In many statistical estimation problems, observations can be modeled as noisy quadratic functions of an unknown vector v0 = (v0,1, v0,2, . . . , v0,n)T ∈Rn. For instance, in positioning and graph localization [5, 24], one is given noisy measurements of pairwise distances (v0,i −v0,j)2 (where –for simplicity– we consider the case in which the underlying geometry is one-dimensional). In principal component analysis (PCA) [15], one is given a data matrix X ∈Rn×p, and tries to reduce its dimensionality by postulating an approximate factorization X ≈u0 v0T. Hence Xij can be interpreted as a noisy observation of the quadratic function u0,iv0,j. As a last example, there has been significant interest recently in phase retrieval problems [11, 6]. In this case, the unknown vector v0 is –roughly speaking– an image, and the observations are proportional to the square modulus of a modulated Fourier transform |Fv0|2. In several of these contexts, a significant effort has been devoted to exploiting additional structure of the unknown vector v0. For instance, in Sparse PCA, various methods have been developed to exploit the fact that v0 is known to be sparse [14, 25]. In sparse phase retrieval [13, 18], a similar assumption is made in the context of phase retrieval. All of these attempts face a recurring dichotomy. One the hand, additional information on v0 can increase dramatically the estimation accuracy. On the other, only a fraction of this additional information is exploited by existing polynomial time algorithms. For instance in sparse PCA, if it is known that only k entries of the vector v0 are non-vanishing, an optimal estimator is successful in identifying them from roughly k samples (neglecting logarithmic factors) [2]. On the other hand, known polynomial-time algorithms require about k2 samples [16, 7]. 1 This fascinating phenomenon is however poorly understood so far. Classifying estimation problems as to whether optimal estimation accuracy can be achieved or not in polynomial time is an outstanding challenge. In this paper we develop a stylized model to study estimation from quadratic observations, under additional constraints. Special choices of the constraint set yield examples for which optimal estimation is thought to be intractable. However we identify a large class of constraints for which estimation appears to be tractable, despite the corresponding maximum likelihood problem is non-convex. This shows that computational tractability is not immediately related to simple considerations of convexity or worst-case complexity. Our model assumes v0 ∈Cn with Cn ⊆Rn a closed cone. Observations are organized in a symmetric matrix X = (Xij)1≤i,j≤n defined by X = β v0v0 T + Z . (1) Here Z is a symmetric noise matrix with independent entries (Zij)i≤j with Zij ∼N(0, 1/n) for i < j and Zii ∼N(0, 2/n). We assume, without loss of generality, ∥v0∥2 = 1, and hence β is the signal to noise ratio. We will assume β to be known to avoid non-essential complications. We consider estimators that return normalized vectors bv : Rn×n →Sn−1 ≡{v ∈Rn : ∥v∥2 = 1}, and will characterize such an estimator through the risk function RCn(bv; v0) = 1 2E  min(∥bv(X) −v0∥2 2, ∥bv(X) −v0∥2 2) = 1 −E{|⟨bv(X), v0⟩|} . (2) The corresponding worst-case risk is R(bv; Cn) ≡supv0∈Cn RCn(bv; v0), and the minimax risk R(Cn) = infbv R(bv; Cn). Remark 1.1. Let Cn = Sn,k be the cone of vectors v0 that have at most k non-zero entries, all positive, and with equal magnitude. The problem of testing whether β = 0 or β ≥β0 within the model (1) coincides with the problem of detecting a non-zero mean submatrix in a Gaussian matrix. For the latter, Ma and Wu [20] proved that it cannot be accomplished in polynomial time unless an algorithm exists for the so-called planted clique problem in a regime in which the latter is conjectured to be hard. This suggests that the problem of estimating v0 with rate-optimal minimax risk is hard for the constraint set Cn = Sn,k. We next summarize our results. While –as shown by the last remark– optimal estimation is generically intractable for the model (1) under the constraint v0 ∈Cn, we show that –roughly speaking– it is instead tractable if Cn is a convex cone. Note that this does not follow from elementary convexity considerations. Indeed, the maximum likelihood problem maximize ⟨v, Xv⟩, (3) subject to v ∈Cn, ∥v∥2 = 1 , is non-convex. Even more, solving exactly this optimization problem is NP-hard even for simple choices of the convex cone Cn. For instance, if Cn = Pn ≡{v ∈Rn : v ≥0} is an orthant, then solving the above is equivalent to copositive programming, which is NP-hard by reduction from maximum independent sets [12, Chapter 7]. Our results naturally characterize the cone Cn through its statistical dimension [1]. If PCn denotes the orthogonal projection on Cn, then the fractional statistical dimension of Cn is defined as δ(Cn) ≡1 nE  PCn(g) 2 2 , (4) where expectation is with respect to g ∼N(0, In×n). Note that δ(Cn) ∈[0, 1] can be significantly smaller than 1. For instance, if Cn = Mn ≡{v ∈Rn + : ∀i , vi+1 ≥vi} is the cone of nonnegative, monotone increasing sequences, then [9, Lemma 4.2] proves that δ(Cn) ≤20(log n)2/n. Below is an informal summary of our results, with titles referring to sections where these are established. Information-theoretic limits. We prove that in order to estimate accurately v0, it is necessary to have β ≳ p δ(Cn). Namely, there exist universal constants c1, c2 > 0 such that, if β ≤c1 p δ(Cn), then R(Cn) ≥c2. 2 Maximum likelihood estimator. Let bvML(X) be the maximum-likelihood estimator, i.e. any solution of Eq. (3). We then prove that, for β ≥ p δ(Cn) R(bvML; Cn) ≤4 p δ(Cn) β . (5) Low-complexity iterative estimator. In the special case Cn = Rn, the solution of the optimization problem (3) is given by the eigenvector with the largest eigenvalue. A standard low-complexity approach to computing the leading eigenvector is provided by the power method. We consider a simple generalization that –starting from the initialization v0– alternates between projection onto Cn and multiplication by (X + ρIn) (ρ > 0 is added to improve convergence): bvt+1 = PCn(ut) ∥PCn(ut)∥2 , (6) ut = (X + ρIn)bvt . (7) We prove that, for t ≳log n iterations, this algorithm yields an estimate with R(bvt; Cn) ≲ p δ(Cn)/β, and hence order optimal, for β ≳ p δ(Cn). (Our proof technique requires the initialization to have a positive scalar product with v0.) As a side result of our analysis of the maximum likelihood estimator, we prove a new, elegant, upper bound on the value of the optimization problem (3), denoted by λ1(Z; Cn) ≡ maxv∈Cn∩Sn−1⟨v, Zv⟩. Namely Eλ1(Z; Cn) ≤2 p δ(Cn) . (8) In the special case Cn = Rn, λ1(Z; Rn) is the largest eigenvalue of Z, and the above inequality shows that this is bounded in expectation by 2. In this case, the bound is known to be asymptotically tight [10]. In the supplementary material, we prove that it is tight for certain other examples such as the nonnegative orthant and for circular cones (a.k.a. ice-cream cones). We conjecture that this inequality is asymptotically tight for general convex cones. Unless stated otherwise, in the following we will defer proofs to the Supplementary Material. 2 Information-theoretic limits We use an information-theoretic argument to show that, under the observation model (1), then the minimax risk can be bounded below for β ≲ p δ(Cn). As is standard, our bound employs the so-called packing number of Cn. Definition 2.1. For a cone Cn ⊆Rn, we define its packing number N(Cn, ε) as the size of the maximal subset X of Cn ∩Sn−1 such that for every x1, x2 ∈Cn ∩Sn−1, ∥x1 −x2∥≥ε. We then have the following. Theorem 1. There exist universal constants C1, C2 > 0 such that for any closed convex cone Cn with δ(Cn) ≥3/n: β ≤C1 p δ(Cn) ⇒ R(Cn) ≥ C2δ(Cn) log(1/δ(Cn)) . (9) Notice that the last expression for the lower bound depends on the cone width, as it is to be expected: even for β = 0, it is possible to estimate v0 with risk going to 0 if the cone Cn ‘shrinks’ as n →∞. The proof of this theorem is provided in Section 2 of the supplement. 3 Maximum likelihood estimator Under the Gaussian noise model for Z, cf. Eq. (1), the likelihood of observing X under a hypothesis v is proportional to exp(−∥X −vvT∥2 F /2). Using the constraint that ∥v∥= 1, it follows that any solution of (3) is a maximum likelihood estimator. 3 Theorem 2. Consider the model as in (1). Then, when β ≥ p δ(Cn), any solution bvML(X) to the maximum likelihood problem (3) satisfies RCn(bvML; Cn) ≤min ( 4 p δ(Cn) β , 16 β2 ) . (10) Thus, for β ≳ p δ(Cn), the risk of the maximum likelihood estimator decays as p δ(Cn)/β while for β ≳1, it shifts to a faster decay of 1/β2. We have made no attempt to optimize the constants in the statement of the theorem, though we believe that the correct leading constant in either case is 1. Note that without the cone constraint (or with Cn = Rn) the maximum likelihood estimator reduces to computing the principal eigenvector bvPC of X. Recent results in random matrix theory [10] and statistical decision theory [4] prove that in the case of principal eigenvector, a nontrivial risk (i.e. RCn(bvPC; Cn) < 1 asymptotically) is obtained only when β > 1. Our result shows that this threshold is, instead, reduced to p δ(Cn), which can be significantly smaller than 1. The proof of this theorem is provided in Section 3 of the supplement. 4 Low-complexity iterative estimator Sections 2 and 3 provide theoretical insight into the fundamental limits of estimation of v0 from quadratic observations of the form βv0v0T + Z. However, as previously mentioned, the maximum likelihood estimator of Section 3 is NP-hard to compute, in general. In this section, we propose a simple iterative algorithm that generalizes the well-known power iteration to compute the principal eigenvector of a matrix. Furthermore, we prove that, given an initialization with positive scalar product with v0, this algorithm achieves the same risk of the maximum likelihood estimator up to constants. Throughout, the cone Cn is assumed to be convex. Our starting point is the power iteration to compute the principal eigenvector bvPC of X. This is given by letting, for t ≥0: bvt+1 = Xbvt/∥Xbvt∥. Under our observation model, we have X = βv0v0T + Z with v0 ∈Cn. We can incorporate this information by projecting the iterates on to the cone Cn (see e.g. [19] for related ideas): bvt = PCn(ut) ∥PCn(ut)∥, ut+1 = Xvt + ρvt. (11) The projection is defined in the standard way: PCn(x) ≡arg min y∈Cn∥y −x∥2. (12) If Cn is convex, then the projection is unique. We have implicitly assumed that the operation of projecting to the cone Cn is available to the algorithm as a simple primitive. This is the case for many convex cones of interest, such as the orthant Pn, the monotone cone Mn, and ice-cream cones the projection is easy to compute. For instance, if Cn = Pn is the non-negative orthant PCn(x) = (x)+ is the non-negative part of x. For the monotone cone, the projection can be computed efficiently through the pool-adjacent violators algorithm. The memory term ρvt is necessary for our proof technique to go through. It is straightforward to see that adding ρIn to the data X does not change the optimizers of the problem (3). The following theorem provides deterministic conditions under which the distance between the iterative estimator and the vector v0 can be bounded. Theorem 3. Let bvt be the power iteration estimator (11). Assume ρ > ∆and that the noise matrix Z satisfies: max  |⟨x, Zy⟩| : x, y ∈Cn ∩Sn−1 ≤∆. (13) If β > 4∆, and the initial point bv0 ∈Cn ∩Sn−1 satisfies ⟨bv0, v0⟩≥2∆/β, then there exits t0 = t0(∆/β, ∆/ρ) < ∞independent of n such that, for all t ≥t0 ∥bvt −v0∥≤4∆ β . (14) 4 We can apply this theorem to the Gaussian noise model to obtain the following bound on the risk of the power iteration estimator. Corollary 4.1. Under the model (1) let εn = 8 p log n/n. Assume that ⟨bv0, v0⟩> 0 and β > 2( p δ(Cn) + εn) max 2, ⟨bv0, v0⟩−1 . (15) Then R(bvt, Cn) ≤2δ(Cn) + εn β . (16) In other words, power iteration has risk within a constant from the maximum likelihood estimator, provided an initialization is available whose scalar product with v0 is bounded away from zero. The proofs of Theorem 3 and Corollary 4.1 are provided in Section 4 of the supplement. 5 A case study: sharp asymptotics and minimax results for the orthant In this section, we will be interested in the example in which the cone Cn is the non-negative orthant Cn = Pn. Non-negativity constraints within principal component analysis arise in non-negative matrix factorization (NMF). Initially introduced in the context of chemometrics [23, 22], NMF attracted considerable interest because of its applications in computer vision and topic modeling. In particular, Lee and Seung [17] demonstrated empirically that NMF successfully identifies parts of images, or topics in documents’ corpora. Note that the in applications of NMF to computer vision or topic modeling the setting is somewhat different from the model studied here: X is rectangular instead of symmetric, and the rank is larger than one. Such generalizations of our analysis will be the object of future work. Here we will use the positive orthant to illustrate the results in previous sections. Further, we will show that stronger results can be proved in this case, thanks to the separable structure of this cone. Namely, we derive sharp asymptotics and we characterize the least-favorable vectors for the maximum likelihood estimator. We denote by λ+(X) = λ1(X; Cn = Pn) the value of the optimization problem (3). Our first result yields the asymptotic value of this quantity for ‘pure noise,’ confirming the general conjecture put forward above. Theorem 4. We have almost surely limn→∞λ+(Z) = 2 p δ(Pn) = √ 2. Next we characterize the risk phase transition: this result confirms and strengthen Theorem 2. Theorem 5. Consider estimation in the non-negative orthant Cn = Pn under the model (1). If β ≤1/ √ 2, then there exists a sequence of vectors {v0(n)}n≥0 , such that almost surely lim n→∞R(vML; v0(n)) = 1 . (17) For β > 1/ √ 2, there exists a function β 7→R+(β) with R+(β) < 1 for all β > 1/ √ 2, and R+(β) ≥1 −1/2β2, such that the following happens. For any sequence of vectors {v0(n)}n≥0, we have, almost surely lim sup n→∞R(vML; v0(n)) ≤R+(β) . (18) In other words, in the high-dimensional limit, the maximum likelihood estimator is positively correlated with the signal v0(n) if and only if β > p δ(Cn) = 1/ √ 2. Explicit (although non-elementary) expressions for R+(β) can be computed, along with the limit value of the risk R(vML; v0(n)) for sequences of vectors {v0(n)}n≥1 whose entries empirical distribution converges. These results go beyond the scope of the present paper (but see Fig. 1 below for illustration). As a byproduct of our analysis, we can characterize the least-favorable choice of the signal v0. Namely for k ∈[1, n], wee let u(n, k) denote a vector with ⌊k⌋non-zero entries, all equal to 1/ p ⌊k⌋. Then we can prove that the asymptotic minimax risk is achieved along sequences of vectors of this type. 5 Theorem 6. Consider estimation in the non-negative orthant Cn = Pn under the model (1), and let R+(β) be the same function as in Theorem 5. If β ≤1/ √ 2 then there exists kn = o(n) such that lim n→∞R(vML; u(n, kn)) = 1 . (19) If β > 1/ √ 2 then there exists ε# = ε#(β) ∈(0, 1] such that lim n→∞R(vML; u(n, nε#)) = R+(β) . (20) We refer the reader to [21] for a detailed analysis of the case of nonnegative PCA and the full proofs of Theorems 4, 5 and 6. 5.1 Approximate Message Passing The next question is whether, in the present example Cn = Pn, the risk of the maximum likelihood estimator can be achieved by a low-complexity iterative algorithm. We prove that this is indeed the case (up to an arbitrarily small error), thus confirming Theorem 3. In order to derive an asymptotically exact analysis, we consider an ‘approximate message passing’ modification of the power iteration. Let f(x) = (x)+/∥(x)+∥2 denote the normalized projector. We consider the iteration defined by v0 = (1, 1, . . . , 1)T/√n, v−1 = (0, 0, . . . , 0)T, and for t ≥0, vt+1 = Xf(vt) −bt f(vt−1) and bt ≡∥(vt)+∥0/{√n∥(vt)+∥2} AMP The algorithm AMP is a slight modification of the projected power iteration algorithm up to adding at each step the “memory term” −bt f(vt−1). As shown in [8, 3] this term plays a crucial role in allowing for an exact high-dimensional characterization. At each step the estimate produced by the sequence is bvt = (vt)+/∥(vt)+∥2. We have the following Theorem 7. Let X be generated as in (1). Then we have, almost surely, lim t→∞lim n→∞ ⟨bvML, XvML⟩−⟨bvt, Xbvt⟩ = 0 . (21) 5.2 Numerical illustration: comparison with classical PCA We performed numerical experiments on synthetic data generated according to the model (1) and with signal v0 = u(n, nε) as defined in the previous section. We provide in the Appendix formulas for the value of limn→∞⟨v0, bvML⟩, which correspond to continuous black lines in the Figure 1. We compare these predictions with empirical values obtained by running AMP. We generated samples of size n = 104, sparsity level ε ∈{0.001, 0.1, 0.8}, and signal-to-noise ratios β ∈{0.05, 0.10, . . . , 1.5}. In each case we run AMP for t = 50 iterations and plot the empirical average of ⟨bvt, v0⟩over 32 instances. Even for such moderate values of n, the asymptotic predictions are remarkably accurate. Observe that sparse vectors (small ε) correspond to the least favorable signal for small signal-tonoise ratio β, while the situation is reverted for large values of β. In dashed green we represented the theoretical prediction for ε →0. The value β = 1/ √ 2 corresponds to the phase transition. At the bottom the images correspond to values of the correlation ⟨v0, bvML⟩for a grid of values of β and ε. The top left-hand frame in Figure 1 is obtained by repeating the experiment for a grid of values of n, and fixed ε = 0.05 and several value of β. For each point we plot the average of ⟨bvt, v0⟩after t = 50 iteration, over 32 instances. The data suggest ⟨bvML, v0⟩+ A n−b ≈limn→∞⟨v0, v+⟩with b ≈0.5. 6 Polyhedral cones and convex relaxations A polyhedral cone Cn is a closed convex cone that can be represented in the form Cn = {x ∈Rn : Ax ≥0} for some matrix A ∈Rm×n. In section 5 we considered the non-negative orthant, which is an example of polyhedral cone with A = In. A number of other examples of practical interest fall within this category of cones. For instance, monotonicity or convexity of a vector v = (v1, . . . , vn) 6 10 1 10 2 10 3 10 4 10 −2 10 −1 10 0 n Deviation from asymptotic Empirical n−1/2 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 2−1/ 2 β 1 ε = .001 ε = .100 ε = .800 < v0, v+ > Non−negative PCA β ε Theory Prediction 21/2 | 0.2 0.4 0.6 0.8 1 1.2 1.4 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 β ε Empirical (n = 1000) 21/2 | 0.2 0.4 0.6 0.8 1 1.2 1.4 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Figure 1: Numerical simulations with the model 1 for the positive orthant cone Cn = Pn. Topleft: empirical deviation from asymptotic prediction. Top-right: black lines represent the theoretical predictions of Theorem 5, and dots represent empirical values of ⟨bvt, v0⟩for the AMP estimator (in red) and ⟨v1, v0⟩for standard PCA (in blue). Bottom: a comparison of theoretical asymptotic values (left frame) and empirical values (right frame) of ⟨v0, vML⟩for a range of β and ε. an be enforced –in their discrete version– through inequality constraints (respectively vi+1 −vi ≥0 and vi+1 −2vi + vi−1 ≥0), and hence give rise to polyhedral cones. Furthermore, it is possible to approximate any convex cone Cn with a sequence of increasingly accurate polyhedral cones. For a polyhedral cone, the maximum likelihood problem (3) reads: maximize ⟨v, Xv⟩ (22) subject to: Av ≥0; ∥v∥= 1. The modified power iteration (11), can be specialized to this case, via the appropriate projection. The projection remains computationally feasible provided the matrix A is not too large. Indeed, it is easy to show using convex duality that PCn(u) is given by: PCn(u) = arg min  ∥Ax + u∥2, x ≥0 . This reduces the projection onto a general polyhedral cone to a non-negative least squares problem, for which efficient routines exist. In special cases such as the orthant, the projection is closed form. In the case of polyhedral cones, it is possible to relax this problem (22) using a natural convex surrogate. To see this, we introduce the variable V = vvT and write the following equivalent version of problem 22: maximize ⟨X, V⟩ subject to: AVAT ≥0; Tr(V) = 1; V⪰0; rank(V) = 1. Here the constraint AVAT ≥0 is to be interpreted as entry-wise non-negativity, while we write V⪰0 to denote that V is positive semidefinite. We can now relax this problem by dropping the rank constraint: maximize ⟨X, V⟩ (23) subject to: AVAT ≥0; Tr(V) = 1; V⪰0. Note that this increases the number of variables from n to n2, as V ∈Rn×n, which results in a significant cost increase for standard interior point methods, over the power iteration (11). Furthermore, if the solution V is not rank one, it is not clear how one can use it to form an estimate bv. On the other hand, this convex relaxation yields a principled approach to bounding the sub-optimality 7 0 0.5 1 1.5 2 2.5 3 3.5 4 1 1.5 2 2.5 3 3.5 4 4.5 β λ1(X + Y) Power Iteration Proposed dual witness Exact dual witness Figure 2: Value of the maximum likelihood problem (3) for Cn = Pn, as approximated by power iteration. The red line is the value achieved by power iteration, and the blue points the upper bound obtained by dual witness (25). The gap at small β is due to the suboptimal choice of the dual witness, since solving exactly Problem (24) yields the dual witness with value given by the teal circles. As can be seen, they match exactly the value obtained by power iteration, showing zero duality gap! The simulation is for n = 50 and 40 Monte Carlo iterations. of the estimate provided by the power iteration. It is straightforward to derive the dual program of (23): minimize λ1(X + ATYA) (24) subject to: Y ≥0, where Y is the decision variable, the constraint is interpreted as entry-wise nonnegativity as above, and λ1( · ) denotes the largest eigenvalue. If one can construct a dual witness Y ≥0 such that λ1(X + ATYA) = ⟨bv, Xbv⟩for any estimator bv, then this estimator is the maximum likelihood estimator. In particular, using the power iteration estimator bv = bvt , such a dual witness can provide a certificate of convergence of the power iteration (11). We next describe a construction of dual witness that we found empirically successful at large enough signal-to-noise ratio. Assume that a heuristic (for instance, the modified power iteration (11)) has produced an estimate bv that is a local maximizer of the problem (3). It is is proved in the Supplementary Material, that such a local maximizer must satisfy the modified eigenvalue equation: Xbv = λbv −ATµ, with µ ≥0 and ⟨bv, ATµ⟩= 0. We then suggest the witness Y(bv) = 1 ∥Abv∥2  µbvTAT + AbvµT . (25) Note that Y(bv) is non-negative by construction and hence dual feasible. A direct calculation shows that bv is an eigenvector of the matrix X + ATYA with eigenvalue λ = ⟨bv, Xbv⟩. We then obtain the following sufficient condition for optimality. Proposition 6.1. Let bv be a local maximizer of the problem (3). If bv is the principal eigenvector of X + ATY(bv)A, then bv is a global maximizer. In Figure 2 we plot the average value of the objective function over 50 instances of the problem for Cn = Pn, n = 100. We solved the maximum likelihood problem using the power iteration heuristics (11), and used the above construction to compute an upper bound via duality. It is possible to show that this upper bound cannot be tight unless β > 1, but appears to be quite accurate. We also solve the problem (24) directly for case of nonnegative PCA, and (rather surprisingly) the dual is tight for every β > 0. 8 References [1] D. Amelunxen, M. Lotz, M. Mccoy, and J. Tropp. Living on the edge: a geometric theory of phase transition in convex optimization. submitted, 2013. [2] Arash A Amini and Martin J Wainwright. High-dimensional analysis of semidefinite relaxations for sparse principal components. In Information Theory, 2008. ISIT 2008. IEEE International Symposium on, pages 2454–2458. IEEE, 2008. [3] M. Bayati and A. Montanari. The dynamics of message passing on dense graphs, with applications to compressed sensing. IEEE Trans. on Inform. Theory, 57:764–785, 2011. [4] Aharon Birnbaum, Iain M Johnstone, Boaz Nadler, and Debashis Paul. Minimax bounds for sparse pca with noisy high-dimensional data. The Annals of Statistics, 41(3):1055–1084, 2013. [5] Pratik Biswas and Yinyu Ye. Semidefinite programming for ad hoc wireless sensor network localization. In Proceedings of the 3rd international symposium on Information processing in sensor networks, pages 46–54. ACM, 2004. [6] Emmanuel J Candes, Thomas Strohmer, and Vladislav Voroninski. Phaselift: Exact and stable signal recovery from magnitude measurements via convex programming. Communications on Pure and Applied Mathematics, 66(8):1241–1274, 2013. [7] Yash Deshpande and Andrea Montanari. Sparse pca via covariance thresholding. arXiv preprint arXiv:1311.5179, 2013. [8] D. L. Donoho, A. Maleki, and A. Montanari. Message Passing Algorithms for Compressed Sensing. Proceedings of the National Academy of Sciences, 106:18914–18919, 2009. [9] David Donoho, Iain Johnstone, and Andrea Montanari. Accurate prediction of phase transitions in compressed sensingvia a connection to minimax denoising. IEEE Transactions on Information Theory, 59(6):3396 – 3433, 2013. [10] Delphine F´eral and Sandrine P´ech´e. The largest eigenvalue of rank one deformation of large wigner matrices. Communications in mathematical physics, 272(1):185–228, 2007. [11] James R Fienup. Phase retrieval algorithms: a comparison. Applied optics, 21(15):2758–2769, 1982. [12] Bernd G¨artner and Jiri Matousek. Approximation algorithms and semidefinite programming. Springer, 2012. [13] Kishore Jaganathan, Samet Oymak, and Babak Hassibi. Recovery of sparse 1-d signals from the magnitudes of their fourier transform. In Information Theory Proceedings (ISIT), 2012 IEEE International Symposium On, pages 1473–1477. IEEE, 2012. [14] Iain M Johnstone and Arthur Yu Lu. Sparse principal components analysis. Unpublished manuscript, 2004. [15] Ian Jolliffe. Principal component analysis. Wiley Online Library, 2005. [16] Robert Krauthgamer, Boaz Nadler, and Dan Vilenchik. Do semidefinite relaxations really solve sparse pca? arXiv preprint arXiv:1306.3690, 2013. [17] Daniel D Lee and H Sebastian Seung. Learning the parts of objects by non-negative matrix factorization. Nature, 401(6755):788–791, 1999. [18] Xiaodong Li and Vladislav Voroninski. Sparse signal recovery from quadratic measurements via convex programming. SIAM Journal on Mathematical Analysis, 45(5):3019–3033, 2013. [19] Ronny Luss and Marc Teboulle. Conditional gradient algorithmsfor rank-one matrix approximations with a sparsity constraint. SIAM Review, 55(1):65–98, 2013. [20] Zongming Ma and Yihong Wu. Computational barriers in minimax submatrix detection. arXiv preprint arXiv:1309.5914, 2013. [21] Andrea Montanari and Emile Richard. Non-negative principal component analysis: Message passing algorithms and sharp asymptotics. arXiv preprint arXiv:1406.4775, 2014. [22] Pentti Paatero. Least squares formulation of robust non-negative factor analysis. Chemometrics and intelligent laboratory systems, 37(1):23–35, 1997. [23] Pentti Paatero and Unto Tapper. Positive matrix factorization: A non-negative factor model with optimal utilization of error estimates of data values. Environmetrics, 5(2):111–126, 1994. [24] Amit Singer. A remark on global positioning from local distances. Proceedings of the National Academy of Sciences, 105(28):9507–9511, 2008. [25] Hui Zou, Trevor Hastie, and Robert Tibshirani. Sparse principal component analysis. Journal of computational and graphical statistics, 15(2):265–286, 2006. 9
2014
300
5,404
Fast Training of Pose Detectors in the Fourier Domain Jo˜ao F. Henriques Pedro Martins Rui Caseiro Jorge Batista Institute of Systems and Robotics University of Coimbra {henriques,pedromartins,ruicaseiro,batista}@isr.uc.pt Abstract In many datasets, the samples are related by a known image transformation, such as rotation, or a repeatable non-rigid deformation. This applies to both datasets with the same objects under different viewpoints, and datasets augmented with virtual samples. Such datasets possess a high degree of redundancy, because geometrically-induced transformations should preserve intrinsic properties of the objects. Likewise, ensembles of classifiers used for pose estimation should also share many characteristics, since they are related by a geometric transformation. By assuming that this transformation is norm-preserving and cyclic, we propose a closed-form solution in the Fourier domain that can eliminate most redundancies. It can leverage off-the-shelf solvers with no modification (e.g. libsvm), and train several pose classifiers simultaneously at no extra cost. Our experiments show that training a sliding-window object detector and pose estimator can be sped up by orders of magnitude, for transformations as diverse as planar rotation, the walking motion of pedestrians, and out-of-plane rotations of cars. 1 Introduction To cope with the rich variety of transformations in natural images, recognition systems require a representative sample of possible variations. Some of those variations must be learned from data (e.g. non-rigid deformations), while others can be virtually generated (e.g. translation or rotation). Recently, there has been a renewed interest in augmenting datasets with virtual samples, both in the context of supervised [23, 17] and unsupervised learning [6]. This augmentation has the benefits of regularizing high-capacity classifiers [6], while learning the natural invariances of the visual world. Some kinds of virtual samples can actually make learning easier – for example, with horizontallyflipped virtual samples [7, 4, 17], half of the weights of the template in the Dalal-Triggs detector [4] become redundant by horizontal symmetry. A number of very recent works [14, 13, 8, 1] have shown that cyclically translated virtual samples also constrain learning problems, which allows impressive gains in computational efficiency. The core of this technique relies on approximately diagonalizing the data matrix with the Discrete Fourier Transform (DFT). In this work, we show that the “Fourier trick” is not unique to cyclic translation, but can be generalized to other cyclic transformations. Our model captures a wide range of useful image transformations, yet retains the ability to accelerate training with the DFT. As it is only implicit, we can accelerate training in both datasets of virtual samples and natural datasets with pose annotations. Also due to the geometrically-induced structure of the training data, our algorithm can obtain several transformed pose classifiers simultaneously. Some of the best object detection and pose estimation systems currently learn classifiers for different poses independently [10, 7, 19], and we show how joint learning of these classifiers can dramatically reduce training times. 1 (a) (b) (c) Figure 1: (a) The horizontal translation of a 6 × 6 image, by 1 pixel, can be achieved by a 36 × 36 permutation matrix P that reorders elements appropriately (depicted is the reordering of 2 pixels). (b) Rotation by a fixed angle, with linearly-interpolated pixels, requires a more general matrix Q. By studying its influence on a dataset of rotated samples, we show how to accelerate learning in the Fourier domain. Our model can also deal with other transformations, including non-rigid. (c) Example HOG template (a car from the Google Earth dataset) at 4 rotations learned by our model. Positive weights are on the first and third column, others are negative. 1.1 Contributions Our contributions are as follows: 1) We generalize a previous successful model for translation [14, 13] to other transformations, and analyze the properties of datasets with many transformed images; 2) We present closed-form solutions that fully exploit the known structure of these datasets, for Ridge Regression and Support Vector Regression, based on the DFT and off-the-shelf solvers; 3) With the same computational cost, we show how to train multiple classifiers for different poses simultaneously; 4) Since our formulas do not require explicitly estimating or knowing the transformation, we demonstrate applicability to both datasets of virtual samples and structured datasets with pose annotations. We achieve performance comparable to naive algorithms on 3 widely different tasks, while being several orders of magnitude faster. 1.2 Related work There is a vast body of works on image transformations and invariances, of which we can only mention a few. Much of the earlier computer vision literature focused on finding viewpoint-invariant patterns [22]. They were based on image or scene-space coordinates, on which geometric transformations can be applied directly, however they do not apply to modern appearance-based representations. To relate complex transformations with appearance descriptors, a classic approach is to use tangent vectors [3, 26, 16], which represent a first-order approximation. However, the desire for more expressiveness has motivated the search for more general models. Recent works have begun to approximate transformations as matrix-vector products, and try to estimate the transformation matrix explicitly. Tamaki et al. [27] do so for blur and affine transformations in the context of LDA, while Miao et al. [21] approximate affine transformations with an E-M algorithm, based on a Lie group formulation. They estimate a basis for the transformation operator or the transformed images, which is a hard analytical/inference problem in itself. The involved matrices are extremely large for moderately-sized images, necessitating dimensionality reduction techniques such as PCA, which may be suboptimal. Several works focus on rotation alone [25, 18, 28, 2], most of them speeding up computations using Fourier analysis, but they all explicitly estimate a reduced basis on which to project the data. Another approach is to learn a transformation from data, using more parsimonious factored or deep models [20]. In contrast, our method generalizes to other transformations and avoids a potentially costly transformation model or basis estimation. 2 The cyclic orthogonal model for image transformations Consider the m × 1 vector x, obtained by vectorizing an image, i.e. stacking its elements into a vector. The particular order does not matter, as long as it is consistent. The image may be a 32 dimensional array that contains multiple channels, such as RGB, or the values of a densely-sampled image descriptor. We wish to quickly train a classifier or regressor with transformed versions of sample images, to make it robust to those transformations. The model we will use is an m × m orthogonal matrix Q, which will represent an incremental transformation of an image as Qx (for example, a small translation or rotation, see Fig. 1-a and 1-b). We can traverse different poses w.r.t. that transformation, p ∈Z, by repeated application of Q with a matrix power, Qpx. In order for the number of poses to be finite, we must require the transformation to be cyclic, Qs = Q0 = I, with some period s. This allows us to store all versions of x transformed to different poses as the rows of an s × m matrix, CQ(x) =   Q0x T Q1x T ... Qs−1x T   (1) Due to Q being cyclic, any pose p ∈Z can be found in the row (p mod s) + 1. Note that the first row of CQ(x) contains the untransformed image x, since Q0 is the identity I. For the purposes of training a classifier, CQ(x) can be seen as a data matrix, with one sample per row. Although conceptually simple, we will show through experiments that this model can accurately capture a variety of natural transformations (Section 5.2). More importantly, we will show that Q never has to be created explicitly. The algorithms we develop will be entirely data-driven, using an implicit description of Q from a structured dataset, either composed of virtual samples (e.g., by image rotation), or natural samples (e.g. using pose annotations). 2.1 Image translation as a special case A particular case of Q, and indeed what inspired the generalization that we propose, is the s × s cyclic shift matrix P =  0T s−1 1 Is−1 0s−1  , (2) where 0s−1 is an (s−1)×1 vector of zeros. This matrix cyclically permutes the elements of a vector x as (x1, x2, x3, . . . , xs) →(xs, x1, x2, . . . , xs−1). If x is a one-dimensional horizontal image, with a single channel, then it is translated to the right by one pixel. An illustration is shown in Fig. 1-a. By exploiting its relationship with the Discrete Fourier Transform (DFT), the cyclic shift model has been used to accelerate a variety of learning algorithms in computer vision [14, 13, 15, 8, 1], with suitable extensions to 2D and multiple channels. 2.2 Circulant matrices and the Discrete Fourier Transform The basis for this optimization is the fact that the data matrix CP (x), or C(x) for short, formed by all cyclic shifts of a sample image x, is circulant [5]. All circulant matrices are diagonalized by the DFT, which can be expressed as the eigendecomposition C(x) = U diag (F(x)) U H, (3) where .H is the Hermitian transpose (i.e., transposition and complex-conjugation), F(x) denotes the DFT of a vector x, and U is the unitary DFT basis. The constant matrix U can be used to compute the DFT of any vector, since it satisfies Ux = 1 √sF(x). This is possible due to the linearity of the DFT, though in practice the Fast Fourier Transform (FFT) algorithm is used instead. Note that U is symmetric, U T = U, and unitary, U H = U −1. When working in Fourier-space, Eq. 3 shows that circulant matrices in a learning problem become diagonal, which drastically reduces the needed computations. For multiple channels or more images, they may become block-diagonal, but the principles remain the same [13]. 3 An important open question was whether the same diagonalization trick can be applied to image transformations other than translation. We will show that this is true, using the model from Eq. 1. 3 Fast training with transformations of a single image We will now focus on the main derivations of our paper, which allow us to quickly train a classifier with virtual samples generated from an image x by repeated application of the transformation Q. This section assumes only a single image x is given for training, which makes the presentation simpler and we hope will give valuable insight into the core of the technique. Section 4 will expand it to full generality, with training sets of an arbitrary number of images, all transformed by Q. The first step is to show that some aspect of the data is diagonalizable by the DFT, which we do in the following theorem. Theorem 1. Given an orthogonal cyclic matrix Q, i.e. satisfying QT = Q−1 and Qs = Q0, then the s × m matrix X = CQ(x) (from Eq. 1) verifies the following: • The data matrix X and the uncentered covariance matrix XHX are not circulant in general, unless Q = P (from Eq. 2). • The Gram matrix G = XXH is always circulant. Proof. See Appendix A.1. Theorem 1 implies that the learning problem in its original form is not diagonalizable by the DFT basis. However, the same diagonalization is possible for the dual problem, defined by the Gram matrix G. Because G is circulant, it has only s degrees of freedom and is fully specified by its first row g [11], G = C(g). By direct computation from Eq. 1, we can verify that the elements of the first row g are given by gp = xT Qp−1x. One interpretation is that g contains the auto-correlation of x through pose-space, i.e., the inner-product of x with itself as the transformation Q is applied repeatedly. 3.1 Dual Ridge Regression For now we will restrict our attention to Ridge Regression (RR), since it has the appealing property of having a solution in closed form, which we can easily manipulate. Section 4.1 will show how to extend these results to Support Vector Regression. The goal of RR is to find the linear function f(x) = wT x that minimizes a regularized squared error: P i (f(xi) −yi)2 + λ ∥w∥2. Since we have s samples in the data matrix under consideration (Eq. 1), there are s dual variables, stored in a vector α. The RR solution is given by α = (G + λI)−1 y [24], where G = XXH is the s × s Gram matrix, y is the vector of s labels (one per pose), and λ is the regularization parameter. The dual form of RR is usually associated with non-linear kernels [24], but since this is not our case we can compute the explicit primal solution with w = XT α, yielding w = XT (G + λI)−1 y. (4) Applying the circulant eigendecomposition (Eq. 3) to G, and substituting it in Eq. 4, w = XT U diag (ˆg) U H + λUU H−1 y = XT U (diag (ˆg + λ))−1 U Hy, (5) where we introduce the shorthand ˆg = F (g), and similarly ˆy = F (y). Since inversion of a diagonal matrix can be done element-wise, and its multiplication by the vector U Hy amounts to an element-wise product, we obtain w = XT F−1  ˆy ˆg + λ  , (6) where F−1 denotes the inverse DFT, and the division is taken element-wise. This formula allows us to replace a costly matrix inversion with fast DFT and element-wise operations. We also do not need to compute and store the full G, as the auto-correlation vector g suffices. As we will see in the next section, there is a simple modification to Eq. 6 that turns out to be very useful for pose estimation. 4 3.2 Training several components simultaneously A relatively straightforward way to estimate the object pose in an input image x is to train a classifier for each pose (which we call components), evaluate all of them and take the maximum, i.e. fpose (x) = arg max p wT p x. (7) This can also be used as the basis for a pose-invariant classifier, by replacing argmax with max [10]. Of course, training one component per pose can quickly become expensive. However, we can exploit the fact that these training problems become tightly related when the training set contains transformed images. Recall that y specifies the labels for a training set of s transformed images, one label per pose. Without any loss of generality, suppose that the label is 1 for a given pose t and 0 for all others, i.e. y contains a single peak at element t. Then by shifting the peak with P py, we will train a classifier for pose t+p. In this manner we can train classifiers for all poses simply by varying the labels P py, with p = 0, . . . , s −1. Based on Eq. 6, we can concatenate the solutions for all s components into a single m × s matrix, W =  w0 · · · ws−1  = XT (G + λI)−1  P 0y · · · P s−1y  (8) = XT (G + λI)−1 CT (y) . (9) Diagonalization yields W T = F−1  diag  ˆy∗ ˆg + λ  F (X)  , (10) where .∗denotes complex-conjugation. Since their arguments are matrices, the DFT/IDFT operations here work along each column. The product of F (X) by the diagonal matrix simply amounts to multiplying each of its rows by a scalar factor, which is inexpensive. Eq. 10 has nearly the same computational cost as Eq. 6, which trains a single classifier. 4 Transformation of multiple images The training method described in the previous section would find little applicability for modern recognition tasks if it remained limited to transformations of a single image. Naturally, we would like to use n images xi. We now have a dataset of ns samples, which can be divided into n sample groups  Qp−1xi|p = 1, . . . , s , each containing the transformed versions of one image. This case becomes somewhat complicated by the fact that the data matrix X now has three dimensions – the m features, the n sample groups, and the s poses of each sample group. In this m×n×s array, each column vector (along the first dimension) is defined as X•ip = Qp−1xi, i = 1, . . . , n; p = 1, . . . , s, (11) where we have used • to denote a one-dimensional slice of the three-dimensional array X.1 A twodimensional slice will be denoted by X••p, which yields a m × n matrix, one for each p = 1, . . . , s. Through a series of block-diagonalizations and reorderings, we can show (Appendix A.2-A.5) that the solution W, of size m × s, describing all s components (similarly to Eq. 10), is obtained with ˆW•p = ˆX••p (ˆg••p + λI)−1 ˆY ∗ •p, p = 1, . . . , s, (12) where a hat ˆ over an array denotes the DFT along the dimension that has size s (e.g. ˆX is the DFT of X along the third dimension), Yip specifies the label of the sample with pose p in group i, and g is the n × n × s array with elements 1For reference, our slice notation • works the same way as the slice notation : in Matlab or NumPy. 5 gijp = xT i Qp−1xj = XT •i1X•jp, i, j = 1, . . . , n; p = 1, . . . , s. (13) It may come as a surprise that, after all these changes, Eq. 12 still essentially looks like a dual Ridge Regression (RR) problem (compare it to Eq. 4). Eq. 12 can be interpreted as splitting the original problem into s smaller problems, one for each Fourier frequency, which are independent and can be solved in parallel. A Matlab implementation is given in Appendix B.2 4.1 Support Vector Regression Given that we can decompose such a large RR problem into s smaller RR problems, by applying the DFT and slicing operators (Eq. 12), it is natural to ask whether the same can be done with other algorithms. Leveraging a recent result [13], where this was done for image translation, the same steps can be repeated for the dual formulation of other algorithms, such as Support Vector Regression (SVR). Although RR can deal with complex data, SVR requires an extension to the complex domain, which we show in Appendix A.6. We give a Matlab implementation in Appendix B, which can use any off-the-shelf SVR solver without modification. 4.2 Efficiency Naively training one detector per pose would require solving s large ns×ns systems (either with RR or SVR). In contrast, our method learns jointly all detectors using s much smaller n×n subproblems. The computational savings can be several orders of magnitude for large s. Our experiments seem to validate this conclusion, even in relatively large recognition tasks (Section 6). 5 Orthogonal transformations in practice Until now, we avoided the question of how to compute a transformation model Q. This may seem like a computational burden, not to mention a hard estimation problem – for example, what is the cyclic orthogonal matrix Q that models planar rotations with period s? Inspecting Eq. 12-13, however, reveals that we do not need to form Q explicitly, but can work with just a data matrix X of transformed images. From there on, we exploit the knowledge that this data was obtained from some matrix Q, and that is enough to allow fast training in the Fourier domain. This allows a great deal of flexibility in implementation. 5.1 Virtual transformations One way to obtain a structured data matrix X is with virtual samples. From the original dataset of n samples, we can generate ns virtual samples using a standard image operator (e.g. planar rotation). However, we should keep in mind that the accuracy of the proposed method will be affected by how much the image operator resembles a pure cyclic orthogonal transformation. Linearity. Many common image transformations, such as rotation or scale, are implemented by nearest-neighbor or bilinear interpolation. For a fixed amount of rotation or scale, these functions are linear functions in the input pixels, i.e. each output pixel is a fixed linear combination of some of the input pixels. As such, they fulfill the linearity requirement. Orthogonality. For an operator to be orthogonal, it must preserve the L2 norm of its inputs. At the expense of introducing some non-linearity, we simply renormalize each virtual sample to have the same norm as the original sample, which seems to work well in practice (Section 6). Cyclicity. We conducted some experiments with planar rotation on satellite imagery (Section 6.1) – rotation by 360/s degrees is cyclic with period s. In the future, we plan to experiment with noncyclic operators (similar to how cyclic translation is used to approximate image translation [14]). 2The supplemental material is available at: www.isr.uc.pt/˜henriques/transformations/ 6 Figure 2: Example detections and estimated poses in 3 different settings. We can accelerate training with (a) planar rotations (Google Earth), (b) non-rigid deformations in walking pedestrians (TUD-Campus/TUDCrossing), and (c) out-of-plane rotations (KITTI). Best viewed in color. 5.2 Natural transformations Another interesting possibility is to use pose annotations to create a structured data matrix. This data-driven approach allows us to consider more complicated transformations than those associated with virtual samples. Given s views of n objects under different poses, we can build the m × n × s data matrix X and use the same methodology as before. In Section 6 we describe experiments with the walk cycle of pedestrians, and out-of-plane rotations of cars in street scenes. These transformations are cyclic, though highly non-linear, and we use the same renormalization as in Section 5.1. 5.3 Negative samples One subtle aspect is how to obtain a structured data matrix from negative samples. This is simple for virtual transformations, but not for natural transformations. For example, with planar rotation we can easily generate rotated negative samples with arbitrary poses. However, the same operation with walk cycles of pedestrians is not defined. How do we advance the walk cycle of a non-pedestrian? As a pragmatic solution, we consider that negative samples are unaffected by natural transformations, so a negative sample is constant for all s poses. Because the DFT of a constant signal is 0, except for the DC value (the first frequency), we can ignore untransformed negative samples in all subproblems for p ̸= 1 (Eq. 12). This simple observation can result in significant computational savings. 6 Experiments To demonstrate the generality of the proposed model, we conducted object detection and pose estimation experiments on 3 widely different settings, which will be described shortly. We implemented a detector based on Histogram of Oriented Gradients (HOG) templates [4] with multiple components [7]. This framework forms the basis on which several recent advances in object detection are built [19, 10, 7]. The baseline algorithm independently trains s classifiers (components), one per pose, enabling pose-invariant object detection and pose prediction (Eq. 7). Components are then calibrated, as usual for detectors with multiple components [7, 19]. The proposed method does not require any ad-hoc calibration, since the components are jointly trained and related by the orthogonal matrix Q, which preserves their L2 norm. For the performance evaluation, ground truth objects are assigned to hypothesis by the widely used Pascal criterion of bounding box overlap [7]. We then measure average precision (AP) and pose error (as epose/s, where epose is the discretized pose difference, taking wrap-around into account). We tested two variants of each method, trained with both RR and SVR. Although parallelization is trivial, we report timings for single-core implementations, which more accurately reflect the total CPU load. As noted in previous work [13], detectors trained with SVR have very similar performance to those trained with Support Vector Machines. 6.1 Planar rotation in satellite images (Google Earth) Our first test will be on a car detection task on satellite imagery [12], which has been used in several works that deal with planar rotation [25, 18]. We annotated the orientations of 697 objects over half the 30 images of the dataset. The first 7 annotated images were used for training, and the remaining 8 for validation. We created a structured data matrix X by augmenting each sample with 30 virtual 7 Google Earth TUD Campus/Crossing KITTI Time (s) AP Pose Time (s) AP Pose Time (s) AP Pose Fourier training SVR 4.5 73.0 9.4 0.1 81.5 9.3 15.0 53.5 14.9 RR 3.7 71.4 10.0 0.08 82.2 8.9 15.5 53.4 15.0 Standard SVR 130.7 73.2 9.8 40.5 80.2 9.5 454.2 56.5 13.8 RR 399.3 72.7 10.3 45.8 81.6 9.4 229.6 54.5 14.0 Table 1: Results for pose detectors trained with Support Vector Regression (SVR) and Ridge Regression (RR). We report training time, Average Precision (AP) and pose error (both in percentage). samples, using 12º rotations. A visualization of trained weights is shown in Fig. 1-c and Appendix B. Experimental results are presented in Table 1. Recall that our primary goal is to demonstrate faster training, not to improve detection performance, which is reflected in the results. Nevertheless, the two proposed fast Fourier algorithms are 29 to 107× faster than the baseline algorithms. 6.2 Walk cycle of pedestrians (TUD-Campus and TUD-Crossing) We can consider a walking pedestrian to undergo a cyclic non-rigid deformation, with each period corresponding to one step. Because this transformation is time-dependent, we can learn it from video data. We used TUD-Campus for training and TUD-Crossing for testing (see Fig. 2). We annotated a key pose in all 272 frames, so that the images of a pedestrian between two key poses represent a whole walk cycle. Sampling 10 images per walk cycle (corresponding to 10 poses), we obtained 10 sample groups for training, for a total of 100 samples. From Table 1, the proposed algorithms seem to slightly outperform the baseline, showing that these non-rigid deformations can be accurately accounted for. However, they are over 2 orders of magnitude faster. In addition to the speed benefits observed in Section 6.1, another factor at play is that for natural transformations we can ignore the negative samples in s −1 of the subproblems (Section 5.3), whereas the baseline algorithms must consider them when training each of the s components. 6.3 Out-of-plane rotations of cars in street scenes (KITTI) For our final experiment, we will attempt to demonstrate that the speed advantage of our method still holds for difficult out-of-plane rotations. We chose the very recent KITTI benchmark [9], which includes an object detection set of 7481 images of street scenes. The facing angle of cars (along the vertical axis) is provided, which we bin into 15 discrete poses. We performed an 80-20% train-test split of the images, considering cars of “moderate” difficulty [9], and obtained 73 sample groups for training with 15 poses each (for a total of 1095 samples). Table 1 shows that the proposed method achieves competitive performance, but with a dramatically lower computational cost. The results agree with the intuition that out-of-plane rotations strain the assumptions of linearity and orthogonality, since they result in large deformations of the object. Nevertheless, the ability to learn a useful model under such adverse conditions shows great promise. 7 Conclusions and future work In this work, we derived new closed-form formulas to quickly train several pose classifiers at once, and take advantage of the structure in datasets with pose annotation or virtual samples. Our implicit transformation model seems to be surprisingly expressive, and in future work we would like to experiment with other transformations, including non-cyclic. Other interesting directions include larger-scale variants and the composition of multiple transformations. Acknowledgements. The authors would like to thank Jo˜ao Carreira for valuable discussions. They also acknowledge support by the FCT project PTDC/EEA-CRO/122812/2010, grants SFRH/BD75459/2010, SFRH/BD74152/2010, and SFRH/BPD/90200/2012. 8 References [1] V. N. Boddeti, T. Kanade, and B.V.K. Kumar. Correlation filters for object alignment. In CVPR, 2013. 1, 2.1 [2] C.-Y. Chang, A. A. Maciejewski, and V. Balakrishnan. Fast eigenspace decomposition of correlated images. IEEE Transactions on Image Processing, 9(11):1937–1949, 2000. 1.2 [3] O. Chapelle and B. Scholkopf. Incorporating invariances in non-linear support vector machines. In Advances in neural information processing systems, 2002. 1.2 [4] N. Dalal and B. Triggs. Histograms of oriented gradients for human detection. In CVPR, 2005. 1, 6 [5] P. J. Davis. Circulant matrices. American Mathematical Soc., 1994. 2.2 [6] A. Dosovitskiy, J. T. Springenberg, and T. Brox. Unsupervised feature learning by augmenting single images. In International Conference on Learning Representations, 2014. 1 [7] P.F. Felzenszwalb, R.B. Girshick, D. McAllester, and D. Ramanan. Object detection with discriminatively trained part-based models. TPAMI, 2010. 1, 6 [8] H. K. Galoogahi, T. Sim, and S. Lucey. Multi-channel correlation filters. In ICCV, 2013. 1, 2.1 [9] A. Geiger, P. Lenz, and R. Urtasun. Are we ready for autonomous driving? The KITTI Vision Benchmark Suite. In CVPR, 2012. 6.3 [10] A. Geiger, C. Wojek, and R. Urtasun. Joint 3d estimation of objects and scene layout. In NIPS, 2011. 1, 3.2, 6 [11] R. M. Gray. Toeplitz and Circulant Matrices: A Review. Now Publishers, 2006. 3 [12] G. Heitz and D. Koller. Learning spatial context: Using stuff to find things. In ECCV, 2008. 6.1 [13] J. F. Henriques, J. Carreira, R. Caseiro, and J. Batista. Beyond hard negative mining: Efficient detector learning via block-circulant decomposition. In ICCV, 2013. 1, 1.1, 2.1, 2.2, 4.1, 6 [14] J. F. Henriques, R. Caseiro, P. Martins, and J. Batista. Exploiting the circulant structure of tracking-by-detection with kernels. In ECCV, 2012. 1, 1.1, 2.1, 5.1 [15] J. F. Henriques, R. Caseiro, P. Martins, and J. Batista. High-speed tracking with kernelized correlation filters. TPAMI, 2015. 2.1 [16] N. Jojic, P. Simard, B. J. Frey, and D. Heckerman. Separating appearance from deformation. In ICCV, 2001. 1.2 [17] A. Krizhevsky, I. Sutskever, and G. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. 1 [18] K. Liu, H. Skibbe, T. Schmidt, T. Blein, K. Palme, T. Brox, and O. Ronneberger. Rotationinvariant HOG descriptors using fourier analysis in polar and spherical coordinates. International Journal of Computer Vision, 106(3):342–364, February 2014. 1.2, 6.1 [19] T. Malisiewicz, A. Gupta, and A. A. Efros. Ensemble of exemplar-svms for object detection and beyond. In ICCV, 2011. 1, 6 [20] R. Memisevic and G. E. Hinton. Learning to represent spatial transformations with factored higher-order boltzmann machines. Neural Computation, 22(6):1473–1492, 2010. 1.2 [21] X. Miao and R. Rao. Learning the lie groups of visual invariance. Neural computation, 19(10):2665–2693, 2007. 1.2 [22] J. L. Mundy. Object recognition in the geometric era: A retrospective. Lecture Notes in Computer Science, pages 3–28, 2006. 1.2 [23] M. Paulin, J. Revaud, Z. Harchaoui, F. Perronnin, and C. Schmid. Transformation pursuit for image classification. In CVPR, 2014. 1 [24] R. Rifkin, G. Yeo, and T. Poggio. Regularized least-squares classification. Nato Science Series Sub Series III: Computer and Systems Sciences, 190:131–154, 2003. 3.1 [25] U. Schmidt and S. Roth. Learning rotation-aware features: From invariant priors to equivariant descriptors. In CVPR, 2012. 1.2, 6.1 [26] P. Simard, Y. LeCun, J. Denker, and B. Victorri. Transformation invariance in pattern recognition – tangent distance and tangent propagation. In LNCS. Springer, 1998. 1.2 [27] B. Tamaki, T.and Yuan, K. Harada, B. Raytchev, and K. Kaneda. Linear discriminative image processing operator analysis. In CVPR, 2012. 1.2 [28] M. Uenohara and T. Kanade. Optimal approximation of uniformly rotated images. IEEE Transactions on Image Processing, 7(1):116–119, 1998. 1.2 9
2014
301
5,405
Optimistic planning in Markov decision processes using a generative model Bal´azs Sz¨or´enyi INRIA Lille - Nord Europe, SequeL project, France / MTA-SZTE Research Group on Artificial Intelligence, Hungary balazs.szorenyi@inria.fr Gunnar Kedenburg INRIA Lille - Nord Europe, SequeL project, France gunnar.kedenburg@inria.fr Remi Munos∗ INRIA Lille - Nord Europe, SequeL project, France remi.munos@inria.fr Abstract We consider the problem of online planning in a Markov decision process with discounted rewards for any given initial state. We consider the PAC sample complexity problem of computing, with probability 1−δ, an -optimal action using the smallest possible number of calls to the generative model (which provides reward and next-state samples). We design an algorithm, called StOP (for StochasticOptimistic Planning), based on the “optimism in the face of uncertainty” principle. StOP can be used in the general setting, requires only a generative model, and enjoys a complexity bound that only depends on the local structure of the MDP. 1 Introduction 1.1 Problem formulation In a Markov decision process (MDP), an agent navigates in a state space X by making decisions from some action set U. The dynamics of the system are determined by transition probabilities P : X × U × X →[0, 1] and reward probabilities R : X × U × [0, 1] →[0, 1], as follows: when the agent chooses action u in state x, then, with probability R(x, u, r), it receives reward r, and with probability P(x, u, x) it makes a transition to a next state x. This happens independently of all previous actions, states and rewards—that is, the system possesses the Markov property. See [20, 2] for a general introduction to MDPs. We do not assume that the transition or reward probabilities are fully known. Instead, we assume access to the MDP via a generative model (e.g. simulation software), which, for a state-action (x, u), returns a reward sample r ∼R(x, u, ·) and a next-state sample x ∼P(x, u, ·). We also assume the number of possible next-states to be bounded by N ∈N. We would like to find an agent that implements a policy which maximizes the expected cumulative discounted reward E[∞ t=0 γtrt], which we will also refer to as the return. Here, rt is the reward received at time t and γ ∈(0, 1) is the discount factor. Further, we take an online planning approach, where at each time step, the agent uses the generative model to perform a simulated search (planning) in the set of policies, starting from the current state. As a result of this search, the agent takes a single action. An expensive global search for the optimal policy in the whole MDP is avoided. ∗Current affiliation: Google DeepMind 1 To quantify the performance of our algorithm, we consider a PAC (Probably Approximately Correct) setting, where, given  > 0 and δ ∈(0, 1), our algorithm returns, with probability 1−δ, an -optimal action (i.e. such that the loss of performing this action and then following an optimal policy instead of following an optimal policy from the beginning is at most ). The number of calls to the generative model required by the planning algorithm is referred to as its sample complexity. The sample and computational complexities of the planning algorithm introduced here depend on local properties of the MDP, such as the quantity of near-optimal policies starting from the initial state, rather than global features like the MDP’s size. 1.2 Related work The online planning approach and, in particular, its ability to get rid of the dependency on the global features of the MDP in the complexity bounds (mentioned above, and detailed further below) is the driving force behind the Monte Carlo Tree Search algorithms [16, 8, 11, 18]. 1 The theoretical analysis of this approach is still far from complete. Some of the earlier algorithms use strong assumptions, others are applicable only in restricted cases, or don’t adapt to the complexity of the problem. In this paper we build on ideas used in previous works, and aim at fixing these issues. A first related work is the sparse sampling algorithm of [14]. It builds a uniform look-ahead tree of a given depth (which depends on the precision ), using for each transition a finite number of samples obtained from a generative model. An estimate of the value function is then built using empirical averaging instead of expectations in the dynamic programming back-up scheme. This results in an algorithm with (problem-independent) sample complexity of order  1 (1−γ)3  log K+log[1/((1−γ)2)]) log(1/γ) (neglecting some poly-logarithmic dependence), where K is the number of actions. In terms of , this bound scales as exp(O([log(1/)]2)), which is non-polynomial in 1/. 2 Another disadvantage of the algorithm is that the expansion of the look-ahead tree is uniform; it does not adapt to the MDP. An algorithm which addresses this appears in [21]. It avoids evaluating some unnecessary branches of the look-ahead tree of the sparse sampling algorithm. However, the provided sample bound does not improve on the one in [14], and it is possible to show that the bound is tight (for both algorithms). In fact, the sample complexity turns out to be super-polynomial even in the pure Monte Carlo setting (i.e., when K = 1): 1/2+(log C)/ log(1/γ), with C ≥ 1 2(1−γ)4 . Close to our contribution are the planning algorithms [13, 3, 5, 15] (see also the survey [18]) that follow the so-called “optimism in the face of uncertainty” principle for online planning. This principle has been extensively investigated in the multi-armed bandit literature (see e.g. [17, 1, 4]). In the planning problem, this approach translates to prioritizing the most promising part of the policy space during exploration. In [13, 3, 5], the sample complexity depends on a measure of the quantity of near-optimal policies, which gives a better understanding of the real hardness of the problem than the uniform bound in [14]. The case of deterministic dynamics and rewards is considered in [13]. The proposed algorithm has sample complexity of order (1/) log κ log(1/γ) , where κ ∈[1, K] measures (as a branching factor) the quantity of nodes of the planning tree that belong to near-optimal policies. If all policies are very good, many nodes need to be explored in order to distinguish the optimal policies from the rest, and therefore, κ is close to the number of actions K, resulting in the minimax bound of (1/) log K log(1/γ) . Now if there is structure in the rewards (e.g. when sub-optimal policies can be eliminated by observing the first rewards along the sequence), then the proportion of near-optimal policies is low, so κ can be small and the bound is much better. In [3], the case of stochastic rewards have been considered. However, in that work the performance is not compared to the optimal (closed-loop) policy, but to the best open-loop policy (i.e. which does not depends on the state but only on the sequence of actions). In that situation, the sample complexity is of order (1/)max(2, log(κ) log(1/γ)). The deterministic and open-loop settings are relatively simple, since any policy can be identified with a sequence of actions. In the general MDP case however, a policy corresponds to an exponentially 1A similar planning approach has been considered in the control literature, such as the model-predictive control [6] or in the AI community, such as the A∗heuristic search [19] and the AO∗variant [12]. 2A problem-independent lower bound for the sample complexity, of order (1/)1/ log(1/γ), is provided too. 2 wide tree, where several branches need to be explored. The closest work to ours in this respect is [5]. However, it makes the (strong) assumption that a full model of the rewards and transitions is available. The sample complexity achieved is again  1/  log(κ) log(1/γ) , but where κ ∈(1, NK] is defined as the branching factor of the set of nodes that simultaneously (1) belong to near-optimal policies, and (2) whose “contribution” to the value function at the initial state is non-negligible. 1.3 The main results of the paper Our main contribution is a planning algorithm, called StOP (for Stochastic Optimistic Planning) that achieves a polynomial sample complexity in terms of  (which can be regarded as the leading parameter in this problem), and which is, in terms of this complexity, competitive to other algorithms that can exploit more specifics of their respective domains. It benefits from possible reward or transition probability structures, and does not require any special restriction or knowledge about the MDP besides having access to a generative model. The sample complexity bound is more involved than in previous works, but can be upper-bounded by: (1/)2+ log κ log(1/γ) +o(1) (1) The important quantity κ ∈[1, KN] plays the role of a branching factor of the set of important states S,∗(defined precisely later) that “contribute” in a significant way to near-optimal policies. These states have a non-negligible probability to be reached when following some near-optimal policy. This measure is similar (but with some differences illustrated below) to the κ introduced in the analysis of OP-MDP in [5]. Comparing the two, (1) contains an additional constant of 2 in the exponent. This is a consequence of the fact that the rewards are random and that we do not have access to the true probabilities, only to a generative model generating transition and reward samples. In order to provide intuition about the bound, let us consider several specific cases (the derivation of these bounds can be found in Section E): • Worst-case. When there is no structure at all, then S,∗may potentially be the set of all possible reachable nodes (up to some depth which depends on ), and its branching factor is κ = KN. The sample complexity is thus of order (neglecting logarithmic factors) (1/)2+ log(KN) log(1/γ) . This is the same complexity that uniform planning algorithm would achieve. Indeed, uniform planning would build a tree of depth h with branching factor KN where from each state-action one would generate m rewards and next-state samples. Then, dynamic programming would be used with the empirical Bellman operator built from the samples. Using Chernoff-Hoeffding bound, the estimation error is of the order (neglecting logarithms and (1−γ) dependence) of 1/√m. So for a desired error  we need to choose h of order log(1/)/ log(1/γ), and m of order 1/2 leading to a sample complexity of order m(KN)h = (1/)2+ log(KN) log(1/γ) . (See also [15]) Note that in the worst-case sense there is no uniformly better strategy than a uniform planning, which is achieved by StOP. However, StOP can also do much better in specific settings, as illustrated next. • Case with K0 > 1 actions at the initial state, K1 = 1 actions for all other states, and arbitrary transition probabilities. Now each branch corresponds to a single policy. In that case one has κ = 1 (even though N > 1) and the sample complexity of StOP is of order ˜O(log(1/δ)/2) with high probability3. This is the same rate as a Monte-Carlo evaluation strategy would achieve, by sampling O(log(1/δ)/2) random trajectories of length log(1/)/ log(1/γ). Notice that this result is surprisingly different from OP-MDP which has a complexity of order (1/) log N log(1/γ) (in the case when κ = N, i.e., when all transitions are uniform). Indeed, in the case of uniform transition probabilities, OP-MDP would sample the nodes in breadth-first search way, thus achieving this minimax-optimal complexity. This does not contradict the ˜O(log(1/δ)/2) bound for StOP (and Monte-Carlo) since this bound applies to an individual problem and holds in high probability, whereas the bound for OP-MDP is deterministic and holds uniformly over all problems of this type. 3We emphasize the dependence on δ here since we want to compare this high-probability bound to the deterministic bound of OP-MDP. 3 Here we see the potential benefit of using StOP instead of OP-MDP, even though StOP only uses a generative model of the MDP whereas OP-MDP requires a full model. • Highly structured policies. This situation holds when there is a substantial gap between near optimal policies and other sub-optimal policies. For example if along an optimal policy, all immediate rewards are 1, whereas as soon as one deviates from it, all rewards are < 1. Then only a small proportion of the nodes (the ones that contribute to near-optimal policies) will be expanded by the algorithm. In such cases, κ is very close to 1 and in the limit, we recover the previous case when K = 1 and the sample complexity is O(1/)2. • Deterministic MDPs. Here N = 1 and we have that κ ∈[1, K]. When there is structure in the rewards (like in the previous case), then κ = 1 and we obtain a rate ˜O(1/2). Now when the MDP is almost deterministic, in the sense that N > 1 but from any state-action, there is one next-state probability which is close to 1, then we have almost the same complexity as in the deterministic case (since the nodes that have a small probability to be reached will not contribute to the set of important nodes S,∗, which characterizes κ). • Multi-armed bandit we essentially recover the result of the Action Elimination algorithm [9] for the PAC setting. Thus we see that in the worst case StOP is minimax-optimal, and in addition, StOP is able to benefit from situations when there is some structure either in the rewards or in the transition probabilities. We stress that StOP achieves the above mentioned results having no knowledge about κ. 1.4 The structure of the paper Section 2 describes the algorithm, and introduces all the necessary notions. Section 3 presents the consistency and sample complexity results. Section 4 discusses run time efficiency, and in Section 5 we make some concluding remarks. Finally, the supplementary material provides the missing proofs, the analysis of the special cases, and the necessary fixes for the issues with the run-time complexity. 2 StOP: Stochastic Optimistic Planning Recall that N ∈N denotes the number of possible next states. That is, for each state x ∈X and each action u available at x, it holds that P(x, u, x) = 0 for all but at most N states x ∈X. Throughout this section, the state of interest is denoted by x0, the requested accuracy by , and the confidence parameter by δ0. That is, the problem to be solved is to output an action u which is, with probability at least (1 −δ0), at least -optimal in x0. The algorithm and the analysis make use of the notion of an (infinite) planning tree, policies and trajectories. These notions are introduced in the next subsection. 2.1 Planning trees and trajectories The infinite planning tree Π∞for a given MDP is a rooted and labeled infinite tree. Its root is denoted s0 and is labeled by the state of interest, x0 ∈X. Nodes on even levels are called action nodes (the root is an action node), and have Kd children each on the d-th level of action nodes: each action u is represented by exactly one child, labeled u. Nodes on odd levels are called transition nodes and have N children each: if the label of the parent (action) node is x, and the label of the transition node itself is u, then for each x ∈X with P(x, u, x) > 0 there is a corresponding child, labeled x. There may be children with probability zero, but no duplicates. An infinite policy is a subtree of Π∞with the same root, where each action node has exactly one child and each transition node has N children. It corresponds to an agent having fixed all its possible future actions. A (partial) policy Π is a finite subtree of Π∞, again with the same root, but where the action nodes have at most one child, each transition node has N children, and all leaves 4 are on the same level. The number of transition nodes on any path from the root to a leaf is denoted d(Π) and is called the depth of Π. A partial policy corresponds to the agent having its possible future actions planned for d(Π) steps. There is a natural partial order over these policies: a policy 4Note that leaves are, by definition, always action nodes. 4 Π is called descendant policy of a policy Π if Π is a subtree of Π. If, additionally, it holds that d(Π) = d(Π) + 1, then Π is called the parent policy of Π, and Π the child policy of Π. A (random) trajectory, or rollout, for some policy Π is a realization τ := (xt, ut, rt)T t=0 of the stochastic process that belongs to the policy. A random path is generated from the root by always following, from a non-leaf action node with label xt, its unique child in Π, then setting ut to the label of this node, from where, drawing first a label xt+1 from P(xt, ut, ·), one follows the child with label xt+1. The reward rt is drawn from the distribution determined by R(xt, ut, ·). The value of the rollout τ (also called return or payoff in the literature) is v(τ) := T t=0 rtγt, and the value of the policy Π is v(Π) := E[v(τ)] = E[T t=0 rtγt]. For an action u available at x0, denote by v(u) the maximum of the values of the policies having u as the label of the child of root s0. Denote by v∗ the maximum of these v(u) values. Using this notation, the task of the algorithm is to return, with high probability, an action u with v(u) ≥v∗−. 2.2 The algorithm StOP (Algorithm 1, see Figure 1 in the supplementary material for an illustration) maintains for each action u available at x0 a set of active policies Active(u). Initially, it holds that Active(u) = {Πu}, where Πu is the shallowest partial policy with the child of the root being labeled u. Also, for each policy Π that becomes a member of an active set, the algorithm maintains high confidence lower and upper bounds for the value v(Π) of the policy, denoted ν(Π) and b(Π), respectively. In each round t, an optimistic policy Π† t,u := argmaxΠ∈Active(u) b(Π) is determined for each action u. Based on this, the current optimistic action u† t := argmaxu b(Π† t,u) and secondary action u†† t := argmaxu=u† t b(Π† t,u) are computed. A policy Πt to explore is then chosen: if the policy that belongs to the secondary action is at least as deeply developed as the policy that belongs to the optimistic action, the optimistic one is chosen for exploration, otherwise the secondary one. Note that a smaller depth is equivalent to a larger gap between lower and upper bound, and vice versa5. The set Active(ut) is then updated by replacing the policy Πt by its child policies. Accordingly, the upper and lower bounds for these policies are computed. The algorithm terminates when ν(Π† t) +  ≥maxu=u† t b(Π† t,u)–that is, when, with high confidence, no policies starting with an action different from u† t have the potential to have significantly higher value. 2.2.1 Number and length of trajectories needed for one partial policy Fix some integer d > 0 and let Π be a partial policy of depth d. Let, furthermore, Π be an infinite policy that is a descendant of Π. Note that 0 ≤v(Π) −v(Π) ≤ γd 1−γ . (2) The value of Π is a γd 1−γ -accurate approximation of the value of Π. On the other hand, having m trajectories for Π, their average reward ˆv(Π) can be used as an estimate of the value v(Π) of Π. From the Hoeffding bound, this estimate has, with probability at least (1 −δ), accuracy 1−γd 1−γ  ln(1/δ) 2m . With m := m(d, δ) :=  ln(1/δ) 2 ( 1−γd γd )2 trajectories, γd 1−γ ≥1−γd 1−γ  ln(1/δ) 2m holds, so with probability at least (1 −δ), b(Π) := ˆv(Π) + γd 1−γ + 1−γd 1−γ  ln(1/δ) 2m ≤ˆv(Π) + 2 γd 1−γ and ν(Π) := ˆv(Π)−1−γd 1−γ  ln(1/δ) 2m ≥ˆv(Π)−γd 1−γ bound v(Π) from above and below, respectively. This choice balances the inaccuracy of estimating v(Π) based on v(Π) and the inaccuracy of estimating v(Π). Let d∗:= d∗(, γ) := (ln 6 (1−γ))/ ln(1/γ) , the smallest integer satisfying 3 γd∗ 1−γ ≤/2. Note that if d(Π) = d∗for any given policy Π, then b(Π) −ν(Π) ≤/2. Because of this, it follows (see Lemma 3 in the supplementary material) that d∗is the maximal length the algorithm ever has to develop a policy. 5This approach of using secondary actions is based on the UGapE algorithm [10]. 5 Algorithm 1 StOP(s0, δ0, , γ) 1: for all u available from x0 do  initialize 2: Πu := smallest policy with the child of s0 labeled u 3: δ1 := (δ0/d∗) · (K0)−1  d(Πu) = 1 4: (ν(Πu), b(Πu)) := BoundValue(Πu, δ1) 5: Active(u) := {Πu}  the set of active policies that follow u in s0 6: for round t=1, 2, ... do 7: for all u available at x0 do 8: Π† t,u := argmaxΠ∈Active(u) b(Π) 9: Π† t := Π† t,u† t , where u† t := argmaxu b(Π† t,u),  optimistic action and policy 10: Π†† t := Π† t,u†† t , where u†† t := argmaxu=u† t b(Π† t,u),  secondary action and policy 11: if ν(Π† t) +  ≥maxu=u† t b(Π† t,u) then  termination criterion 12: return u† t 13: if d(Π†† t ) ≥d(Π† t) then  select the policy to evaluate 14: ut := u† t and Πt := Π† t 15: else 16: ut := u†† t and Πt := Π†† t  action and policy to explore 17: Active(ut) := Active(ut) \ {Πt} 18: δ := (δ0/d∗) · d(Πt)−1 =0 (K)−N   d−1 =0(K)N  = # of policies of depth at most d 19: for all child policy Π of Πt do 20: (ν(Π), b(Π)) := BoundValue(Π, δ) 21: Active(ut) := Active(ut) ∪{Π} 2.2.2 Samples and sample trees Algorithm StOP aims to aggressively reuse every sample for each transition node and every sample for each state-action pair, in order to keep the sample complexity as low as possible. Each time the value of a partial policy is evaluated, all samples that are available for any part of it from previous rounds are reused. That is, if m trajectories are necessary for assessing the value of some policy Π, and there are m complete trajectories available and m that end at some inner node of Π, then StOP (more precisely, another algorithm, Sample, called from StOP) samples rewards (using SampleReward) and transitions (SampleTransition) to generate continuations for the m incomplete trajectories and to generate (m−m −m) new trajectories, as described in Section 2.1, where • SampleReward(s) for some action node s samples a reward from the distribution R(x, u, ·), where u is the label of the parent of s and x is the label of the grandparent of s, and • SampleTransition(s) for some transition node s samples a next state from the distribution P(x, u, ·), where u is the label of s and x is the label of the parent of s. To compensate for the sharing of the samples, the confidences of the estimates are increased, so that with probability at least (1−δ0), all of them are valid6. The samples are organized as a collection of sample trees, where a sample tree T is a (finite) subtree of Π∞with the property that each transition node has exactly one child, and that each action node s is associated with some reward rT (s). Note that the intersection of a policy Π and a sample tree T is always a path. Denote this path by τ(T , Π) and note that it necessarily starts from the root and ends either in a leaf or in an internal node of Π. In the former case, this path can be interpreted as a complete trajectory for Π, and in the latter case, as an initial segment. Accordingly, when the value of a new policy Π needs to be estimated/bounded, it is computed as ˆv(Π) := 1 m m i=1 v(τ(Ti, Π)) (see Algorithm 2: BoundValue), where T1, . . . , Tm are sample trees constructed by the algorithm. For terseness, these are considered to be global variables, and are constructed and maintained using algorithm Sample (Algorithm 3). 6In particular, the confidence is set to 1 −δd(Π) for policy Π, where δd = (δ0/d∗) d−1 =0 K−N  is δ0 divided by the number of policies of depth at most d, and by the largest possible depth—see section 2.2.1. 6 Algorithm 2 BoundValue(Π, δ) Ensure: with probability at least (1 −δ), interval [ν(Π), b(Π)] contains v(Π) 1: m :=  ln(1/δ) 2  1−γd(Π) γd(Π) 2 2: Sample(Π, s0, m)  Ensure that at least m trajectories exist for Π 3: ˆv(Π) := 1 m m i=1 v(τ(Ti, Π))  empirical estimate of v(Π) 4: ν(Π) := ˆv(Π) −1−γd(Π) 1−γ  ln(1/δ) 2m  Hoeffding bound 5: b(Π) := ˆv(Π) + γd(Π) 1−γ + 1−γd(Π) 1−γ  ln(1/δ) 2m  ...and (2) 6: return (ν(Π), b(Π)) Algorithm 3 Sample(Π, s, m) Ensure: there are m sample trees T1, . . . , Tm that contain a complete trajectory for Π (i.e. τ(Ti, Π) ends in a leaf of Π for i = 1, . . . , m) 1: for i := 1, . . . , m do 2: if sample tree Ti does not yet exist then 3: let Ti be a new sample tree of depth 0 4: let s be the last node of τ(Ti, Π)  s is an action node 5: while s is not a leaf of Π do 6: let s be the child of s in Π and add it to T as a new child of s 7: s := SampleTransition(s),  s is a transition node 8: add s to T as a new child of s 9: s := s 10: rT (s) := SampleReward(s) 3 Analysis Recall that v∗denotes the maximal value of any (possibly infinite) policy tree. The following theorem formalizes the consistency result for StOP (see the proof in Section C). Theorem 1. With probability at least (1 −δ0), StOP returns an action with value at least v∗−. Before stating the sample complexity result, some further notation needs to be introduced. Let u∗denote an optimal action available at state x0. That is, v(u∗) = v∗. Define for u = u∗ P u := Π : Π follows u from s0 and v(Π) + 3 γd(Π) 1−γ ≥v∗−3 γd(Π) 1−γ +  , and also define P u∗:= Π : Π follows u∗from s0, v(Π) + 3 γd(Π) 1−γ ≥v∗and v(Π) −6 γd(Π) 1−γ +  ≤max u=u∗v(u) . Then P := P u∗∪ u=u∗P u is the set of “important” policies that potentially need to be evaluated in order to determine an -optimal action. (See also Lemma 8 in the supplementary material.) Let now p(s) denote the product of the probabilities of the transitions on the path from s0 to s. That is, for any policy tree Π containing s, a trajectory for Π goes through s with probability p(s). When estimating the value of some policy Π of depth d, the expected number of trajectories going through some nodes s of it is p(s)m(d, δd). The sample complexity therefore has to take into consideration for each node s (at least for the ones with “high” p(s) value) the maximum (s) = max{d(Π) : Π ∈ P contains s} of the depth of the relevant policies it is included in. Therefore, the expected number of trajectories going through s in a given run of StOP is p(s) · m((s), δ(s)) = p(s)  ln(1/δ(s)) 2  1−γ(s) γ(s) 2 (3) If (3) is “large” for some s, it can be used to deduce a high confidence upper bound on the number of times s gets sampled. To this end, let S denote the set of nodes of the trees in P, let N  denote the 7 smallest positive integer N satisfying N ≥  s ∈S : p(s) · m((s), δ(s)) ≥(8/3) ln(2N/δ0)  (obviously N  ≤|S|), and define S,∗:=  s ∈S : p(s) · m((s), δ(s)) ≥(8/3) ln(2N /δ0)  . S is the set of “important” nodes (P is the set of “important” policies), and S,∗consists of the important nodes that, with high probability, are not sampled more than twice as often as expected. (This high probability is 1 − δ0 2N  according to the Bernstein bound, so these upper bounds hold jointly with probability at least (1 −δ0 2 ), as N  = |S,∗|. See also Appendix D.) For s ∈S \ S,∗, the number of times s gets sampled has a variance that is too high compared to its expected value (3), so in this case, a different approach is needed in order to derive high confidence upper bounds. To this end, for a transition node s, let p◦(s) := p◦(s, ) := {p(s) : s is a child of s with p(s) · m((s), δ(s)) < (8/3) ln(2N /δ0)}, and define B(s) := B(s, ) :=  0, if p◦(s) ≤ δ 2N m((s),δ(s)) max(6 ln( 2N  δ0 ), 2p◦(s)m((s), δ(s))) otherwise. As it will be shown in the proof of Theorem 2 (in Section D), this is a high confidence upper bound on the number of trajectories that go through some child s ∈S \ S,∗of some s ∈S,∗. Theorem 2. With probability at least (1 −2δ), StOP outputs a policy of value at least (v∗−), after generating at most  s∈S,∗  2p(s)m((s), δ(s)) + B(s) (s) d=d(s)+1 d =d(s)+1 K  samples, where d(s) = min{d(Π) : s appears in policy Π} is the depth of node s. Finally, the bound discussed in Section 1 is obtained by setting κ := lim sup→0 max(κ1, κ2), where κ1 := κ1(, δ0, γ) :=  s∈S,∗ 2(1−γ)2 ln(1/δ0) 2p(s)m((s), δ(s)) 1/d∗ and κ2 := κ2(, δ0, γ) :=  2(1−γ)2 ln(1/δ0)  s∈S,∗B(s) (s) d=d(s) d =d(s) K 1/d∗ . 4 Efficiency StOP, as presented in Algorithm 1, is not efficiently executable. First of all, whenever it evaluates an optimistic policy, it enumerates all its child policies, which typically has exponential time complexity. Besides that, the sample trees are also treated in an inefficient way. An efficient version of StOP with all these issues fixed is presented in Appendix F of the supplementary material. 5 Concluding remarks In this work, we have presented and analyzed our algorithm, StOP. To the best of our knowledge, StOP is currently the only algorithm for optimal (i.e. closed loop) online planning with a generative model that provably benefits from local structure both in reward as well as in transition probabilities. It assumes no knowledge about this structure other than access to the generative model, and does not impose any restrictions on the system dynamics. One should note though that the current version of StOP does not support domains with infinite N. The sparse sampling algorithm in [14] can easily handle such problems (at the cost of a nonpolynomial (in 1/) sample complexity), however, StOP has much better sample complexity in case of finite N. An interesting problem for future research is to design adaptive planning algorithms with sample complexity independent of N ([21] presents such an algorithm, but the complexity bound provided there is the same as the one in [14]). Acknowledgments This work was supported by the French Ministry of Higher Education and Research, and by the European Community’s Seventh Framework Programme (FP7/2007-2013) under grant agreement no 270327 (project CompLACS). Author two would like to acknowledge the support of the BMBF project ALICE (01IB10003B). 8 References [1] P. Auer, N. Cesa-Bianchi, and P. Fischer. Finite-time analysis of the multiarmed bandit problem. Machine Learning Journal, 47(2-3):235–256, 2002. [2] Dimitri P. Bertsekas. Dynamic Programming and Optimal Control. Athena Scientific, 2001. [3] S. Bubeck and R. Munos. Open loop optimistic planning. In Conference on Learning Theory, 2010. [4] S´ebastien Bubeck and Nicol`o Cesa-Bianchi. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning, 5(1):1–122, 2012. [5] Lucian Bus¸oniu and R´emi Munos. Optimistic planning for markov decision processes. In Proceedings 15th International Conference on Artificial Intelligence and Statistics (AISTATS-12), pages 182–189, 2012. [6] E. F. Camacho and C. Bordons. Model Predictive Control. Springer-Verlag, 2004. [7] Nicolo Cesa-Bianchi and Gabor Lugosi. Prediction, Learning, and Games. Cambridge University Press, New York, NY, USA, 2006. [8] R´emi Coulom. Efficient selectivity and backup operators in Monte-Carlo tree search. In Proceedings Computers and Games 2006. Springer-Verlag, 2006. [9] E. Even-Dar, S. Mannor, and Y. Mansour. Action elimination and stopping conditions for reinforcement learning. In T. Fawcett and N. Mishra, editors, Proceedings of the Twentieth International Conference on Machine Learning (ICML-2003), pages 162–169, 2003. [10] Victor Gabillon, Mohammad Ghavamzadeh, and Alessandro Lazaric. Best arm identification: A unified approach to fixed budget and fixed confidence. In Peter L. Bartlett, Fernando C. N. Pereira, Christopher J. C. Burges, Lon Bottou, and Kilian Q. Weinberger, editors, NIPS, pages 3221–3229, 2012. [11] Sylvain Gelly, Yizao Wang, R´emi Munos, and Olivier Teytaud. Modification of UCT with Patterns in Monte-Carlo Go. Rapport de recherche RR-6062, INRIA, 2006. [12] Eric A. Hansen and Shlomo Zilberstein. A heuristic search algorithm for Markov decision problems. In Proceedings Bar-Ilan Symposium on the Foundation of Artificial Intelligence, Ramat Gan, Israel, 23–25 June 1999. [13] J-F. Hren and R. Munos. Optimistic planning of deterministic systems. In Recent Advances in Reinforcement Learning, pages 151–164. Springer LNAI 5323, European Workshop on Reinforcement Learning, 2008. [14] M. Kearns, Y. Mansour, and A.Y. Ng. A sparse sampling algorithm for near-optimal planning in large Markovian decision processes. In Machine Learning, volume 49, pages 193–208, 2002. [15] Gunnar Kedenburg, Raphael Fonteneau, and Remi Munos. Aggregating optimistic planning trees for solving markov decision processes. In C.J.C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K.Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 2382–2390. Curran Associates, Inc., 2013. [16] Levente Kocsis and Csaba Szepesv´ari. Bandit based monte-carlo planning. In In: ECML-06. Number 4212 in LNCS, pages 282–293. Springer, 2006. [17] T. L. Lai and H. Robbins. Asymptotically efficient adaptive allocation rules. Advances in Applied Mathematics, 6:4–22, 1985. [18] R´emi Munos. From bandits to Monte-Carlo Tree Search: The optimistic principle applied to optimization and planning. Foundation and Trends in Machine Learning, 7(1):1–129, 2014. [19] N.J. Nilsson. Principles of Artificial Intelligence. Tioga Publishing, 1980. [20] M.L. Puterman. Markov Decision Processes — Discrete Stochastic Dynamic Programming. John Wiley & Sons, Inc., New York, NY, 1994. [21] Thomas J. Walsh, Sergiu Goschin, and Michael L. Littman. Integrating sample-based planning and model-based reinforcement learning. In Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence, pages 612–617. AAAI Press, 2010. 9
2014
302
5,406
Bayesian Nonlinear Support Vector Machines and Discriminative Factor Modeling Ricardo Henao, Xin Yuan and Lawrence Carin Department of Electrical and Computer Engineering Duke University, Durham, NC 27708 {r.henao,xin.yuan,lcarin}@duke.edu Abstract A new Bayesian formulation is developed for nonlinear support vector machines (SVMs), based on a Gaussian process and with the SVM hinge loss expressed as a scaled mixture of normals. We then integrate the Bayesian SVM into a factor model, in which feature learning and nonlinear classifier design are performed jointly; almost all previous work on such discriminative feature learning has assumed a linear classifier. Inference is performed with expectation conditional maximization (ECM) and Markov Chain Monte Carlo (MCMC). An extensive set of experiments demonstrate the utility of using a nonlinear Bayesian SVM within discriminative feature learning and factor modeling, from the standpoints of accuracy and interpretability. 1 Introduction There has been significant interest recently in developing discriminative feature-learning models, in which the labels are utilized within a max-margin classifier. For example, such models have been employed in the context of topic modeling [1], where features are the proportion of topics associated with a given document. Such topic models may be viewed as a stochastic matrix factorization of a matrix of counts. The max-margin idea has also been extended to factorization of more general matrices, in the context of collaborative prediction [2, 3]. These studies have demonstrated that the use of the max-margin idea, which is closely related to support vector machines (SVMs) [4], often yields better results than designing discriminative feature-learning models via a probit or logit link. This is particularly true for high-dimensional data (e.g., a corpus characterized by a large dictionary of words), as in that case the features extracted from the high-dimensional data may significantly outweigh the importance of the small number of labels in the likelihood. Margin-based classifiers appear to be attractive in mitigating this challenge [1]. Joint matrix factorization, feature learning and classifier design are well aligned with hierarchical models. The Bayesian formalism is well suited to such models, and much of the aforementioned research has been constituted in a Bayesian setting. An important aspect of this prior work utilizes the recent recognition that the SVM loss function may be expressed as a location-scale mixture of normals [5]. This is attractive for joint feature learning and classifier design, which is leveraged in this paper. However, the Bayesian SVM setup developed in [5] assumed a linear classifier decision function, which is limiting for sophisticated data, for which a nonlinear classifier is more effective. The first contribution of this paper concerns the extension of the work in [5] for consideration of a kernel-based, nonlinear SVM, and to place this within a Bayesian scaled-mixture-of-normals construction, via a Gaussian process (GP) prior. The second contribution is a generalized formulation of this mixture model, for both the linear and nonlinear SVM, which is important within the context of Markov Chain Monte Carlo (MCMC) inference, yielding improved mixing. This new construction generalizes the form of the SVM loss function. 1 The manner we employ a GP in this paper is distinct from previous work [6, 7, 8], in that we explicitly impose a max-margin-based SVM cost function. In the previous GP-based classifier design, all data contributed to the learned classification function, while here a relatively small set of support vectors play a dominant role. This identification of support vectors is of interest when the number of training samples is large (simplifying subsequent prediction). The key reason to invoke a Bayesian form of the SVM [5], instead of applying the widely studied optimization-based SVM [4], is that the former may be readily integrated into sophisticated hierarchical models. As an example of that, we here consider discriminative factor modeling, in which the factor scores are employed within a nonlinear SVM. We demonstrate the advantage of this in our experiments, with nonlinear discriminative factor modeling for high-dimensional gene-expression data. We present MCMC and expectation conditional maximization inference for the model. Conditional conjugacy of the hierarchical model yields simple and efficient computations. Hence, while the nonlinear SVM is significantly more flexible than its linear counterpart, computations are only modestly more complicated. Details on the computational approaches, insights on the characteristics of the model, and demonstration on real data constitute a third contribution of this paper. 2 Mixture Representation for SVMs Previous model for linear SVM Assume N observations {xn, yn}N n=1, where xn ∈Rd is a feature vector and yn ∈{−1, 1} is its label. The support vector machine (SVM) seeks to find a classification function f(x) by solving a regularized learning problem argminf(x) n γ PN n=1 max(1 −ynf(xn), 0) + R(f(x)) o , (1) where max(1 −ynf(xn), 0) is the hinge loss, R(f(x)) is a regularization term that controls the complexity of f(x), and γ is a tuning parameter controlling the tradeoff between error penalization and the complexity of the classification function. The decision boundary is defined as {x : f(x) = 0} and sign(f(x)) is the decision rule, classifying x as either −1 or 1 [4]. Recently, [5] showed that for the linear classifier f(x) = β⊤x, minimizing (1) is equivalent to estimating the mode of the pseudo-posterior of β p(β|X, y, γ) ∝QN n=1 L(yn|xn, β, γ)p(β|·) , (2) where y = [y1 . . . yN]⊤, X = [x1 . . . xN], L(yn|xn, β, γ) is the pseudo-likelihood function, and p(β|·) is the prior distribution for the vector of coefficients β. Choosing β to maximize the log of (2) corresponds to (1), where the prior is associated with R(f(x)). In [5] it was shown that L(yn|xn, β, γ) admits a location-scale mixture of normals representation by introducing latent variables λn, such that L(yn|xn, β, γ) = e−2γmax(1−ynβ⊤xn,0) = Z ∞ 0 √γ √2πλn exp  −(1 + λn −ynβ⊤xn)2 2γ−1λn  dλn . (3) Expression (2) is termed a pseudo-posterior because its likelihood term is unnormalized with respect to yn. Note that an improper flat prior is imposed on λn. The original formulation of [5] has the tuning parameter γ as part of the prior distribution of β, while here in (3) it is included instead in the likelihood. This is done because (i) it puts λn and the regularization term γ together, and (ii) it allows more freedom in the choice of the prior for β. Additionally, it has an interesting interpretation, in that the SVM loss function behaves like a globallocal shrinkage distribution [9]. Specifically, γ−1 corresponds to a “global” scaling of the variance, and λn represents the “local” scaling for component n. The {λn} define the relative variances for each of the N data, and γ−1 provides a global scaling. One of the benefits of a Bayesian formulation for SVMs is that we can flexibly specify the behavior of β while being able to adaptively regularize it by specifying a prior p(γ) as well. For instance, [5] gave three examples of prior distributions for β: Gaussian, Laplace, and spike-slab. We can extend the results of [5] to a slightly more general loss function, by imposing a proper prior for the latent variables λn. In particular, by specifying λn ∼Exp(γ0) and letting un = 1−ynβ⊤xn, L(yn|xn, β, γ) = Z ∞ 0 γ0√γ √ 2πλ e−γ 2 (un+λn)2 λn e−γ0λndλn = γ0 c e−γ(c|un|+un) , (4) 2 where c = p 1 + 2γ0γ−1 > 1. The proof relies (see Supplementary Material) on the identity, R ∞ 0 a(2πλ)−1/2 exp{−1 2(a2λ + b2λ−1)}dλ = e−|ab| [10]. From (4) we see that as γ0 →0 we recover (3) by noting that 2max(un, 0) = |un| + un. In general we may use the prior λn ∼ Ga(aλ, γ0), with aλ = 1 for the exponential distribution. In the next section we discuss other choices for aλ. This means that the proposed likelihood is no longer equivalent to the hinge loss but to a more general loss, termed below a skewed Laplace distribution. Skewed Laplace distribution We can write the likelihood function in (4) in terms of un as L(un|γ, γ0) = Z ∞ 0 N(un| −λn, γ−1λn)Exp(λn|γ0)dλn = γ0 c e−γ(c+1)un , if un ≥0 e−γ(c−1)|un| , if un < 0 , (5) which corresponds to a Laplace distribution, with negative skewness, denoted as sLa(un|γ, γ0). Unlike the density derived from the hinge loss (γ0 →0), this density is properly normalized, thus it corresponds to a valid probability density function. For the special case γ0 = 0, the integral diverges, hence the normalization constant does not exist, which stems from exp(−2γmax(un, 0)) being constant for −∞< un < 0. From (5) we see that sLa(un|γ, γ0) can be represented either as mixture of normals or mixture of exponentials. Other properties of the distribution, such as its moments, can be obtained using the results for general asymmetric Laplace distributions in [11]. Examining (5) we can gain some intuition about the behavior of the likelihood function for the classification problem: (i) When ynβ⊤xn = 1, λn = 0 and xn lies on the margin boundary. (ii) When ynβ⊤xn > 1, xn is correctly classified, outside the margin and |1 −ynβ⊤xn| is exponential with rate γ(c −1). (iii) xn is correctly classified but lies inside the margin when 0 < ynβ⊤xn < 1, and xn is misclassified when ynβ⊤xn < 0. In both cases, 1 −ynβ⊤xn is exponential with rate γ(c + 1). (iv) Finally, if ynβ⊤xn = 0, xn lies on the decision boundary. Since c + 1 > c −1 for every c > 1, the distribution for case (ii) decays slower than the distribution for case (iii). Alternatively, in terms of the loss function, observations satisfying (iii) get more penalized than those satisfying (ii). In the limiting case, γ0 →0 we have c →1, and case (ii) is not penalized at all, recovering the behavior of the hinge loss. In the SVM literature, an observation xn is called a support vector if it satisfies cases (i) or (iii). In the latter case, λn is the distance from ynβ⊤xn to the margin boundary [4]. The key thing that the Exp(λ0) prior imposes on λn, relative to the flat prior on λn ∈[0, ∞), is that it constrains that λn not be too large (discouraging ynβ⊤xn ≫1 for correct classifications, which is even more relevant for nonlinear SVMs); we discuss this further below. Extension to nonlinear SVM We now assume that the decision function f(x) is drawn from a zero-mean Gaussian process GP(0, k(x, ·, θ)), with kernel parameters θ. Evaluated at the N points at which we have data, f ∼N(0, K), where K is a N × N covariance matrix with entries kij = k(xi, xj, θ) for i, j ∈{1, . . . , N} [7]; f = [f1 . . . fN]⊤∈RN corresponds to the continuous f(x) evaluated at {xn}N n=1. Together with (5), for un = 1−ynfn, where fn = f(xn), the full prior specification for the nonlinear SVM is f ∼N(0, K) , λn ∼Exp(γ0) , γ ∼Ga(a0, b0) . (6) It is straightforward to prove the equality in (5) holds for fn in place of β⊤xn, as in (6). For nonlinear SVMs as above, being able to set γ0 > 0 is particularly beneficial. It prevents fn from being arbitrarily large (hence preventing 1 −ynfn ≪0). This implies that isolated observations far away from linear decision boundary (even when correctly classified when learning) tend to be support vectors in a nonlinear SVM, yielding more conservative learned nonlinear decision boundaries. Figure 1 shows examples of log N(1 −ynfn; −λn, γ−1λn) Exp(λn; γ0) for γ = 100 and γ0 = {0.01, 100}. The vertical lines denote the margin boundary (ynfn = 1) and the decision boundary (ynfn = 0). We see that when γ0 is small, the density has a very pronounced negative skewness (like in the hinge loss of the original SVM) whereas when γ0 is large, the density tends to be more of a symmetric shape. 3 Inference We wish to compute the posterior p(f, λ, γ|y, X), where λ = [λ1 . . . λN]⊤. We describe and have implemented three inference procedures: Markov chain Monte Carlo (MCMC), a point estimate via expectation-conditional maximization (ECM) and a GP approximation for fast inference. 3 −3 −2 −1 0 1 2 3 10 −2 10 0 10 2 −4 −3 −2 −1 x 10 5 −3 −2 −1 0 1 2 3 10 −2 10 0 10 2 −4 −3 −2 −1 x 10 5 λn λn 1 −ynfn 1 −ynfn Figure 1: Examples of log N(1 −ynfn; −λn, γ−1λn)Exp(λn; γ0) for γ = 100 and γ0 = 0.01 (left) and γ0 = 100 (right). The vertical lines denote the margin boundary (ynfn = 1) and the decision boundary (ynfn = 0). MCMC Inference is implemented by repeatedly sampling from the conditional posterior of parameters in (6). Conditional conjugacy allows us to express the following distributions in closed form: f|y, λ, γ ∼N(m, S) , m = γSYΛ−1(1 + λ) , S = γ−1K(K + γ−1Λ)−1Λ , λ−1 n |fn, yn, γ ∼IG p 1 + 2γ0γ−1 |1 −ynfn| , γ + 2γ0 ! , γ|y, f, λ ∼Ga  a0 + 1 2N, b0 + 1 2ǫ⊤Λ−1ǫ  , (7) where Λ = diag(λ), Y = diag(y), ǫ = 1 + λ −Yf, and IG(µ, γ) is the inverse Gaussian distribution with parameters µ and γ [10]. In MCMC γ0 plays a crucial role, because it controls the prior variance of the latent variables λn, thus greatly improving mixing, particularly that of γ. We also verified empirically that for small values of γ0, γ is consistently underestimated. In practice we fix γ0 = 0.1, however, a conjugate prior (gamma) exists, and sampling from its conditional posterior is straightforward if desired. The parameters of the covariance function θ in the GP require Metropolis-Hastings type algorithms, as in most cases no closed form for their conditional posterior is available. However, the problem is relatively well studied. We have found that slice sampling methods [12], in particular the surrogate data sampler of [13], work well in practice, and are employed here. For the case of SVMs, MCMC is naturally important as a way of quantifying the uncertainty of the parameters of the model. Further, it allows us to use the hierarchy in (6) as a building block in more sophisticated models, or to bring more flexibility to f through specialized prior specifications. As an example of this, Section 5 describes a specification for a nonlinear discriminative factor model. ECM The expectation-conditional maximization algorithm is a generalization of the expectationmaximization (EM) algorithm. It can be used when there are multiple parameters that need to be estimated [14]. From (6) we identify f and γ as the parameters to be estimated, and λn as the latent variables. The Q function in EM-style algorithms is the complete data log-posterior, where expectations are taken w.r.t. the posterior distribution evaluated at the current value of the parameter of interest. From (7) we see that λn appears in the conditional posterior p(f|y, K, λ, γ) as first order terms, thus we can write ⟨λ−1 n ⟩= E[λ−1 n |yn, f (i) n , γ(i)] = p 1 + 2γ0(γ(i))−1|u(i) n |−1 , (8) where f (i) n and γ(i) are the estimates of fn and γ at the i-th iteration, and u(i) n = 1 −ynf (i) n . From (7) and (8) we can obtain the EM updates: f (i+1) = K(K + (γ(i))−1⟨Λ⟩)−1Y(1 + ⟨λ⟩) and γ(i+1) = a0 −1 + 1 2N   b0 + 1 2 PN n=1⟨λ−1 n ⟩(u(i+1) n )2 + 2u(i+1) n + ⟨λn⟩ −1 . In the ECM setting, learning the parameters of the covariance function is not as straightforward as in MCMC. However, we can borrow from the GP literature [7] and use the fact that we can marginalize f while conditioning on λ and γ: Z(y, X, λ, γ, θ) = N(Y(1 + λ), K + γ−1Λ) . (9) Note that K is a function of X and θ. Estimation of θ is done by maximizing log Z(y, X, λ, γ, θ). For this we need only compute the partial derivatives of (9) w.r.t. θ, and then use a gradient-based 4 optimizer. This is commonly known as Type II maximum likelihood (ML-II) [7]. In practice we alternate between EM updates for {f, γ} and θ updates for a pre-specified number of iterations (typically the model converges after 20 iterations). Speeding up inference Perhaps one of the most well known shortcomings of GP is that its cubic complexity is prohibitive for large scale problems. However there is an extensive literature about approximations for fast GP models [15]. Here we use the Fully Independent Training Conditional (FITC) approximation [16], as it offers an attractive balance between complexity and performance [15]. The basic idea behind FITC is to assume that f is generated i.i.d. from pseudo-inputs {vm}M m=1 via fm ∈RM such that fm ∼N(0, Kmm), where Kmm is a M×M covariance matrix. Specifically, from (5) we have p(u|fm) = QN n=1 p(un|fm) = N(KnmK−1 mmfm, diag(K −Qnn) + γ−1Λ) , where u = 1 −Yf, Kmn is the cross-covariance matrix between {vm}M m=1 and {xn}N n=1, and Qnn = KnmK−1 mmKmn. If we marginalize out fm thus Z(y, X, λ, γ, θ) = N(Y(1 + λ), Qnn + diag(K −Qnn) + γ−1Λ) . (10) Note that if we drop the diag(·) term in (10) due to the i.i.d. assumption for f, we recover the full GP marginal from (9). Similar to the ML-II approach previously described, for a fixed M we can maximize log Z(y, X, λ, γ, θ) w.r.t. θ and {vm}M m=1 using a gradient-based optimizer but with the added benefit of having decreased the computational cost from O(N 3) to O(NM 2) [16]. Predictions Making predictions under the model in (6), with conditional posterior distributions in (7), can be achieved using standard results of the multivariate normal distribution. The predictive distribution of f⋆for a new observation x⋆given the dataset {X, y} can be written as f⋆|x⋆, X, y ∼N(k⋆ΣY(1 + λ), k⋆−k⊤ ⋆Σk⋆) , (11) where Σ = (K + γ−1Λ)−1, k⋆= k(x⋆, x⋆, θ) and k⋆= [k(x⋆, x1, θ) . . . k(x⋆, xN, θ)]⊤. Furthermore, we can directly use the probit link Φ(f⋆) to compute p(y⋆= 1|x⋆, X, y) = Z Φ(f⋆)p(f⋆|x⋆, X, y)df⋆= Φ k⋆ΣY(1 + λ)(1 + k⋆−k⊤ ⋆Σk⋆)−1 , which follows from [7]. Computing the class membership probability is not possible in standard SVMs, because in such optimization-based methods one does not obtain the variance of the predictive distribution; this variance is an attractive component of the Bayesian construction. The mean of the predictive distribution (11) is tightly related to the predictor in standard SVMs, in the sense that both are manifestations of the representer theorem. In particular E[f⋆|x⋆, X, y] = PN n=1 αnk(x⋆, xn, θ) , (12) where α = (K + γ−1Λ)−1Y(1 + λ). From the expectations of λn and f conditioned on γ and γ0 it is possible to show that α is a vector with elements γ(1 −c) ≤αn ≤γ(1 + c), where c = p 1 + 2γ0γ−1. We differentiate three types of elements in α as follows α =    ynγ(1 + c), if ynfn < 1 α0 n , if ynfn = 1 (λn = 0) ynγ(1 −c) , if ynfn > 1 , (13) with α0 = K−1 0,0 (y0 −γ(1 + c)K0,aya −γ(1 −c)K0,byb), where α0 n is an element of α0, and 0, a and b are subsets of {1, . . . , N} for which λn = 0, ynfn < 1 and ynfn > 1, respectively. This implies α and so the prediction rule in (12) depend on data for which λn > 0 only through γ and γ0. Note also that we do not need the values of λ but whether or not they are different than zero. When γ0 →0 then c →1 and α becomes a sparse vector bounded above by 2γ. This result for standard SVMs can be found independently from the Karush-Kuhn-Tucker conditions for its objective function [4]. For ECM and variational Bayes EM inference (the latter discussed below in Section 5), we set γ0 = 0 and therefore α is sparse, with αn = 0 when ynfn > 1, as in traditional SVMs. This property of the proposed use of GPs within the Bayesian SVM formulation is a significant advantage relative to traditional classifier design based directly on GPs, for which we do not have such sparsity in general. For MCMC inference, we find the sampler mixes better when γ0 ̸= 0. Details on the derivations of (13) and the concavity of the problem may be found in Supplementary Material. 5 4 Related Work A key contribution of this paper concerns extension of the linear Bayesian SVM developed in [5] to a nonlinear Bayesian SVM. This has been implemented by replacing the linear f(x) = β⊤x considered in [5] with an f(x) drawn from a GP. The most relevant previous work is that for which a classifier is directly implemented via a GP, without an explicit connection to the margin associated with the SVM [7]. Specifically, GP-based classifiers have been developed by [17]. In [7] the f is drawn from a GP, as in (6), but f is used directly with a probit or logit link function, to estimate class membership probability. Previous GP-based classifiers did not use f within a margin-based classifier as in (6), implemented here via p(un) = N(−λn, γ−1λn), where un = 1−ynfn. It has been shown empirically that nonlinear SVMs and GP classifiers often perform similarly [8]. However, for the latter, inference can be challenging due to the non-conjugacy of multivariate normal distribution to the link function. Common inference strategies employ iterative approximate inference schemes, such as the Laplace approximation [17] or expectation propagation (EP) [18]. The model we propose here is locally fully conjugate (except for the GP kernel parameters) and inference can be easily implemented using EM style algorithms, or via MCMC. Besides, the prediction rule of the GP classifier, which has a form almost identical to (12), is generally not sparse and therefore lacks the interpretation that may be provided by the relatively few support vectors. 5 Discriminative Factor Models Combinations of factor models and linear classifiers have been widely used in many applications, such as gene expression, proteomics and image analysis, as a way to perform classification and feature selection simultaneously [19, 20]. One of the most common modeling approaches can be written as xn = Awn + ǫn, ǫn ∼N(0, ψ−1I) , L(yn|β, wn, ·) , where A is a d×K matrix of factor loadings, wn ∈RK is a vector of factor scores, ǫn is observation noise (and/or model residual), β is a vector of K linear classifier coefficients and L(·) is for instance but not limited to the linear SVM likelihood in (5) (a logit or probit link may also be used). One of many possible prior specification for the above model is ak ∼N(0, Φk) , wn ∼N(0, I) , ψ ∼Ga(aψ, bψ) , β ∼N(0, G) , where ak is a column of A, Φk = diag(φ1k, . . . , φdk), φik ∼Exp(ν), G = diag(g1, . . . , gK) and each element of A is distributed aik ∼Laplace(ν) after marginalizing out {φik} [10]. Shrinkage in A is typically a requirement when N ≪d or when its columns, ak, need to be interpreted. For simplicity, we can set G = I, however a shrinkage prior for the elements gk of G might be useful in some applications, as a mechanism for factor score selection. Although the described model usually works well in practice, it assumes that there is a linear mapping from Rd to RK, such that K ≪d, in which the classes {−1, 1} are linearly separable. We can relax this assumption by imposing the hierarchical model in (6) in place of β. This implies that matrix K from (6) has now entries kij = k(wi, wj, θ). Inference using MCMC is straightforward except for the conditional posterior of the factor scores. This model is related to latent-variable GP models (GP-LVM) [21], in that we infer the latent {wi} that reside within a GP kernel. However, here {wi} are also factor scores in a factor model, and the GP is used within the context of a Bayesian SVM classifier; neither of latter two have been considered previously. For the nonlinear Bayesian SVM classifier we no longer have a closed form for the conditional of wn, due to the covariance function of the GP prior. Thus, we require a Metropolis-Hastings type algorithm. Here we use elliptical slice sampling [22]. Specifically, we sample wn from p(wn|A, W\n, ψ, y, λ, γ, θ) ∝p(wn|xn, A, ψ)Z(y, wn, W\n, λ, γ, θ) , (14) where p(wn|xn, A, ψ) ∼N(SNψAxn, SN), W = [w1 . . . wN], W\n is matrix W without column n, S−1 N = ψA⊤A + I, and we have marginalized out f as in (9) with W in place of X. The elliptical slice sampler proposes samples from p(wn|xn, A, ψ) while biasing them towards more likely configurations of λ. Provided that λ ultimately controls the predictive distribution of the classifier in (11), samples of wn will at the same time attempt to fit the data and to improve classification performance. From (14), note that we sample one column of W at a time, while keeping the others fixed. Details of the elliptical slice sampler are found in [22]. In applications in which sampling from (14) is time prohibitive, we can use instead a variational Bayes EM (VB-EM) approach. In the E-step, we approximate the posterior of A, {Φk}, ψ, f, λ and γ by a factorized distribution q(A) Q k q(Φk)q(ψ)q(f)q(λ)q(γ) and in the M-step we optimize W and θ, using LBFGS [23]. Details of the implementation can be found in the Supplementary Material. 6 6 Experiments In all experiments we set the covariance function to (i) either the square exponential (SE), which has the form k(xi, xj, θ) = exp −∥xi −xj∥2 θ2), where θ2 is known as the characteristic length scale; or (ii) the automatic relevance determination (ARD) SE in which each dimension of x has its own length scale [7]. All code used in the experiments was written in Matlab and executed on a 2.8GHz workstation with 4Gb RAM. Table 1: Benchmark data results. Mean % error from 10-fold cross-validation. Data set N d BSVM SVM GPC Ionosphere 351 34 5.98 5.71 7.41 Sonar 208 60 11.06 11.54 12.50 Wisconsin 683 9 2.93 3.07 2.64 Crabs 200 7 1.5 2.0 2.5 Pima 768 8 21.88 24.22 22.01 USPS 3 vs 5 1540 256 1.49 1.56 1.69 Benchmark data We first compare the performance of the proposed Bayesian hierarchy for nonlinear SVM (BSVM) against EP-based GP classification (GPC) and an optimization-based SVM, on six well known benchmark datasets. In particular, we use the same data and settings as [8], specifically 10-fold cross-validation and SE covariance function. The parameters of the SVM {γ, θ} are obtained by grid search using an internal 5-fold cross-validation. GPC uses ML-II and a modified SE function k(xi, xj, θ) = θ2 1 exp −∥xi −xj∥2 θ2 2), where θ1 acts as regularization trade-off similar to γ in our formulation [7]. For our model we set 200 as the maximum number of iterations of the ECM algorithm and run ML-II every 20 iterations. Table 1 shows mean errors for the methods under consideration. We see that all three perform similarly as one might expect thus error bars are not showed, however BSVM slightly outperforms the others in 4 out of 6 datasets. From the three methods, the SVM is clearly faster than the others. GP classification and our model essentially scale cubically with N, however, ours is relatively faster mainly due to overhead computations needed by the EP algorithm. More specifically, running times for the larger dataset (USPS 3 vs 5) were approximately 1000, 1200 and 5000 seconds for SVM, BSVM and GPC, respectively. Table 2: FITC results (mean % error) for USPS data. 3 vs. 5 (N = 767) 4 vs. non-4 (N = 7291) FITC-GPC FITC-BSVM FITC-GPC FITC-BSVM Error 3.69 ± 0.26 3.49 ± 0.29 2.59 ± 0.17 2.44 ± 0.17 Time 102 46 604 116 In order to test the approximation introduced in Section 3 (to accelerate GP inference) we use the traditional splitting of USPS, 7291 for model fitting and the remaining 2007 for testing, on two different tasks: 3 vs. 5 and 4 vs. non-4. Table 2 shows mean error rates and standard deviations for FITC versions of BSVM and GPC, for M = 100 pseudo-inputs and 10 repetitions. We see that FITC-BSVM slightly outperforms FITC-GPC in both tasks while being relatively faster. As baselines, full BSVM and GPC on the 3 vs. 5 task perform roughly similar at 2.46% error. We also verified (results not shown) that increasing M consistently decreases error rates for both FITC-BSVM and FITC-GPC. USPS data We applied the model proposed in Section 5 to the well known 3 vs. 5 subset of the USPS handwritten digits dataset, consisting of 1540 gray scale 16 × 16 images, rescaled within [−1, 1]. We use the resampled version, this is, 767 for model fitting and the remaining 773 for testing. As baselines, we also perform inference as a two step procedure, first fitting the factor model (FM), followed by a linear (L) or a nonlinear (N) SVM classifier. We also consider learning jointly the factor model but with a linear SVM (LDFM), and a two step procedure consisting of LDFM followed by a nonlinear SVM. Our proposed nonlinear discriminative factor model is denoted NDFM. VB-EM versions of LDFM and NDFM are denoted as VLDFM and VNDFM, respectively. MCMC details for the linear SVM part can be found in [5]. For inference, we set K = 10, a SE covariance function and run the sampler for 1200 iterations, from which we discard the first 600 and keep every 10-th for posterior summaries. We observed in general good mixing regardless of random initialization, and results remained very similar for different Markov chains. Table 3 shows classification results for the eight classifiers considered; we see that the nonlinear classifiers perform substantially better than the linear counterparts. In addition, the proposed nonlinear joint model (NDFM) is the best of all five. The nonlinear classifier is powerful enough to perform well in both two step procedures. We found that VNDFM is not performing as good as NDFM because the data likelihood is dominating over the labels likelihood in the updates for the factor scores, which is not surprising considering the marked size differences between the two. On the positive side, runtime for VNDFM is approximately two orders of magnitude smaller than that of NDFM. We also tried a joint nonlinear model with a probit link as in GP classification and we 7 Table 3: Mean % error with standard deviations and runtime (seconds) for USPS and gene expression data. FM+L FM+N LDFM VLDFM LDFM+N VLDFM+N NDFM VNDFM USPS (Test set) Error 6.21 ± 0.32 3.36 ± 0.26 5.95 ± 0.31 5.56 ± 0.18 3.62 ± 0.26 3.62 ± 0.19 2.72 ± 0.13 3.23 ± 0.16 Time 44 840 120 60 920 160 20000 210 Gene expression (10-fold cross-validation) Error 22.70 ± 0.92 19.52 ± 1.02 22.70 ± 0.92 22.31 ± 0.78 20.31 ± 0.88 19.52 ± 0.88 18.33 ± 0.84 18.33 ± 0.84 Time 105 136 126 25 158 57 1100 103 found its classification performance (a mean error rate of 3.10%) being slightly worse than that for NDFM. In addition, we found that using ARD SE covariance functions to automatically select for features of A and larger values of K did not substantial changed the results. Gene expression data The dataset originally introduced in [24] consists of gene expression measurements from primary breast tumor samples for a study focused towards finding expression patterns potentially related to mutations of the p53 gene. The original data were normalized using RMA and filtered to exclude genes showing trivial variation. The final dataset consists of 251 samples and 2995 normalized gene expression values. The labeling variable indicates whether or not a sample exhibits the mutation. We use the same baseline and inference settings from our previous experiment, but validation is done by 10-fold cross-validation. In preliminary results we found that factor score selection improves results, hence for the linear classifier (L) we used an exponential prior for the variances of β, gk ∼Exp(ρ), and for the nonlinear case (N) we set an ARD SE covariance function for K. Table 3 summarizes the results, the nonlinear variants outperform their linear counterparts and our joint model perform slightly better than the others. Additionally, the joint nonlinear model with GP and probit link yielded an error rate of 19.52%. As a way of quantifying whether the features (factor loadings) produced by FM, LDFM and NDFM are meaningful from a biological point of view, we performed Gene Ontology (GO) searches for the gene lists encoded by each column of A. In order to quantify the strength of the association between GO annotations and our gene lists we obtained Bonferroni corrected p-values [25]. We thresholded the elements of matrix A such that |aik| > 0.1. Using the 10 lists from each model we found that FM, LDFM and NDFM produced respectively 5, 5 and 8 factors significantly associated to GO terms relevant to breast cancer. The GO terms are: fatty acid metabolism, induction of programmed cell death (apoptosis), anti-apoptosis, regulation of cell cycle, positive regulation of cell cycle, cell cycle and Wnt signaling pathway. The strongest associations in all models are unsurprisingly apoptosis and positive regulation of cell cycle, however, only NDFM produced a significant association to anti-apoptosis which we believe is responsible for the edge in performance of NDFM in Table 3. 7 Conclusion We have introduced a fully Bayesian version of nonlinear SVMs, extending the previous restriction to linear SVMs [5]. Almost all of the existing joint feature-learning and classifier-design models assumed linear classifiers [2, 3, 26]. We have demonstrated in our experiments that there is a substantial performance improvement manifested by the nonlinear classifier. In addition, we have extended the Bayesian equivalent of the hinge loss to a more general loss function, for both linear and nonlinear classifiers. We have demonstrated that this approach enhances modeling flexibility, and yields improved MCMC mixing. The Bayesian setup allows one to directly compute class membership probabilities. We showed how to use the nonlinear SVM as a module in a larger model, and presented compelling results to highlight its potential. Point estimate inference using ECM is conceptually simpler and easier to implement than MCMC or GP classification, although MCMC is attractive for integrating the factor model and classifier (for example). We showed how FITC and VB-EM based approximations can be used in conjunction with the SVM nonlinear classifier and discriminative factor modeling, respectively, as a way to scale inference in a principled way. Acknowledgments The research reported here was funded in part by ARO, DARPA, DOE, NGA and ONR. 8 References [1] J. Zhu, A. Ahmed, and E. P. Xing. MedLDA: maximum margin supervised topic models for regression and classification. ICML, pages 1257–1264, 2009. [2] M. Xu, J. Zhu, and B. Zhang. Fast max-margin matrix factorization with data augmentation. ICML, pages 978–986, 2013. [3] M. Xu, J. Zhu, and B. Zhang. Nonparametric max-margin matrix factorization for collaborative prediction. NIPS 25, pages 64–72, 2012. [4] C. Cortes and V. Vapnik. Support-vector networks. Machine Learning, 20(3):273–297, 1995. [5] N. G. Polson and S. L. Scott. Data augmentation for support vector machines. Bayesian Analysis, 6(1):1– 23, 2011. [6] M. Opper and O. Winther. Gaussian processes for classification: Mean-field algorithms. Neural Computation, 12(11):2655–2684, 2000. [7] C. E. Rasmussen and C. K. I. Williams. Gaussian Processes for Machine Learning. The MIT Press, 2006. [8] M. Kuss and C. E. Rasmussen. Assessing approximate inference for binary Gaussian process classification. JMLR, 6:1679–1704, 2005. [9] N. G. Polson and J. G. Scott. Shrink globally, act locally: sparse Bayesian regularization and prediction. Bayesian Statistics, 9:501–538, 2010. [10] D. F. Andrews and C. L. Mallows. Scale mixtures of normal distributions. JRSSB, 36(1):99–102, 1974. [11] T. J. Kozubowski and K. Podgorski. A class of asymmetric distributions. Actuarial Research Clearing House, 1:113–134, 1999. [12] R. M. Neal. Slice sampling. AOS, 31(3):705–741, 2003. [13] I. Murray and R. P. Adams. Slice sampling covariance hyperparameters of latent Gaussian models. NIPS 23, pages 1723–1731, 2010. [14] X.-L. Meng and D. B. Rubin. Maximum likelihood estimation via the ECM algorithm: A general framework. Biometrika, 80(2):267–278, 1993. [15] J Qui˜nonero-Candela and C. E. Rasmussen. A unifying view of sparse approximate Gaussian process regression. JMLR, 6:1939–1959, 2005. [16] E. Snelson and Z. Ghahramani. Sparse Gaussian processes using pseudo-inputs. NIPS 18, pages 1257– 1264, 2006. [17] C. K. I. Williams and D. Barber. Bayesian classification with Gaussian processes. PAMI, 20(12):1342– 1351, 1998. [18] Thomas P. Minka. A family of algorithms for approximate Bayesian inference. PhD thesis, MIT, 2001. [19] C. M. Carvalho, J. Chang, J. E. Lucas, J. R. Nevins, Q. Wang, and M. West. High-dimensional sparse factor modeling: Applications in gene expression genomics. JASA, 103(484):1438–1456, 2008. [20] M. Zhou, H. Chen, J. Paisley, L. Ren, G. Sapiro, and L. Carin. Non-parametric Bayesian dictionary learning for sparse image representations. NIPS 22, pages 2295–2303, 2009. [21] N.D. Lawrence. Gaussian process latent variable models for visualisation of high dimensional data. NIPS 16, 2003. [22] I. Murray, R. P. Adams, and D. J. C. MacKay. Elliptical slice sampling. AISTATS, pages 541–548, 2010. [23] D. C. Liu and J. Nocedal. On the limited memory method for large scale optimization. Mathematical Programming B, pages 503–528, 1989. [24] L. D. Miller, J. Smeds, J. George, V. B. Vega, L. Vergara, A. Ploner, Y. Pawitan, P. Hall, S. Klaar, E. T. Liu, et al. An expression signature for p53 status in human breast cancer predicts mutation status, transcriptional effects, and patient survival. PNAS, 102(38):13550–13555, 2005. [25] J. T. Chang and J. R. Nevins. GATHER: a systems approach to interpreting genomic signatures. Bioinformatics, 22(23):2926–2933, 2006. [26] J. Mairal, F. Bach, J. Ponce, G. Sapiro, and A. Zisserman. Supervised dictionary learning. NIPS 21, pages 1033–1040, 2009. 9
2014
303
5,407
Feedback Detection for Live Predictors Stefan Wager, Nick Chamandy, Omkar Muralidharan, and Amir Najmi swager@stanford.edu, {chamandy, omuralidharan, amir}@google.com Stanford University and Google, Inc. Abstract A predictor that is deployed in a live production system may perturb the features it uses to make predictions. Such a feedback loop can occur, for example, when a model that predicts a certain type of behavior ends up causing the behavior it predicts, thus creating a self-fulfilling prophecy. In this paper we analyze predictor feedback detection as a causal inference problem, and introduce a local randomization scheme that can be used to detect non-linear feedback in real-world problems. We conduct a pilot study for our proposed methodology using a predictive system currently deployed as a part of a search engine. 1 Introduction When statistical predictors are deployed in a live production environment, feedback loops can become a concern. Predictive models are usually tuned using training data that has not been influenced by the predictor itself; thus, most real-world predictors cannot account for the effect they themselves have on their environment. Consider the following caricatured example: A search engine wants to train a simple classifier that predicts whether a search result is “newsy” or not, meaning that the search result is relevant for people who want to read the news. This classifier is trained on historical data, and learns that high click-through rate (CTR) has a positive association with “newsiness.” Problems may arise if the search engine deploys the classifier, and starts featuring search results that are predicted to be newsy for some queries: promoting the search result may lead to a higher CTR, which in turn leads to higher newsiness predictions, which makes the result be featured even more. If we knew beforehand all the channels through which predictor feedback can occur, then detecting feedback would not be too difficult. For example, in the context of the above example, if we knew that feedback could only occur through some changes to the search result page that were directly triggered by our model, then we could estimate feedback by running small experiments where we turn off these triggering rules. However, in large industrial systems where networks of classifiers all feed into each other, we can no longer hope to understand a priori all the ways in which feedback may occur. We need a method that lets us detect feedback from sources we might not have even known to exist. This paper proposes a simple method for detecting feedback loops from unknown sources in live systems. Our method relies on artificially inserting a small amount of noise into the predictions made by a model, and then measuring the effect of this noise on future predictions made by the model. If future model predictions change when we add artificial noise, then our system has feedback. 1 To understand how random noise can enable us to detect feedback, suppose that we have a model with predictions ˆy in which tomorrow’s prediction ˆy(t+1) has a linear feedback dependence on today’s prediction ˆy(t): if we increase ˆy(t) by δ, then ˆy(t+1) increases by β δ for some β 2 R. Intuitively, we should be able to fit this slope β by perturbing ˆy(t) with a small amount of noise ⌫⇠N ! 0, σ2 ⌫ " and then regressing the new ˆy(t+1) against the noise; the reason least squares should work here is that the noise ⌫is independent of all other variables by construction. The main contribution of this paper is to turn this simple estimation idea into a general procedure that can be used to detect feedback in realistic problems where the feedback has non-linearities and jumps. Counterfactuals and Causal Inference Feedback detection is a problem in causal inference. A model suffers from feedback if the predictions it makes today affect the predictions it will make tomorrow. We are thus interested in discovering a causal relationship between today’s and tomorrow’s predictions; simply detecting a correlation is not enough. The distinction between causal and associational inference is acute in the case of feedback: today’s and tomorrow’s predictions are almost always strongly correlated, but this correlation by no means implies any causal relationship. In order to discover causal relationships between consecutive predictions, we need to use some form of randomized experimentation. In our case, we add a small amount of random noise to our predictions. Because the noise is fully artificial, we can reasonably ask counterfactual questions of the type: “How would tomorrow’s predictions have changed if we added more/less noise to the predictions today?” The noise acts as an independent instrument that lets us detect feedback. We frame our analysis in terms of a potential outcomes model that asks how the world would have changed had we altered a treatment; in our case, the treatment is the random noise we add to our predictions. This formalism, often called the Rubin causal model [1], is regularly used for understanding causal inference [2, 3, 4]. Causal models are useful for studying the behavior of live predictive systems on the internet, as shown by, e.g., the recent work of Bottou et al. [5] and Chan et al. [6]. Outline and Contributions In order to define a rigorous feedback detection procedure, we need to have a precise notion of what we mean by feedback. Our first contribution is thus to provide such a model by defining statistical feedback in terms of a potential outcomes model (Section 2). Given this feedback model, we propose a local noising scheme that can be used to fit feedback functions with non-linearities and jumps (Section 4). Before presenting general version of our approach, however, we begin by discussing the linear case in Section 3 to elucidate the mathematics of feedback detection: as we will show, the problem of linear feedback detection using local perturbations reduces to linear regression. Finally, in Section 5 we conduct a pilot study based on a predictive model currently deployed as a part of a search engine. 2 Feedback Detection for Statistical Predictors Suppose that we have a model that makes predictions ˆy(t) i in time periods t = 1, 2, ... for examples i = 1, ..., n. The predictive model itself is taken as given; our goal is to understand feedback effects between consecutive pairs of predictions ˆy(t) i and ˆy(t+1) i . We define statistical feedback in terms of counterfactual reasoning: we want to know what would have happened to ˆy(t+1) i had ˆy(t) i been different. We use potential outcomes notation [e.g., 7] to distinguish between counterfactuals: let ˆy(t+1) i [y(t) i ] be the predictions our model would have made at time t + 1 if we had published y(t) i as our time-t prediction. In practice we only get to observe ˆy(t+1) i [y(t) i ] for a single y(t) i ; all other values of ˆy(t+1) i [y(t) i ] are counterfactual. We also consider ˆy(t+1) i [?], the prediction our model would have made at time t + 1 if the model never made any of its predictions public and so did not have the chance to affect its environment. With this notation, we define feedback as feedback(t) i = ˆy(t+1) i [ˆy(t) i ] −ˆy(t+1) i [?], (1) 2 i.e., the difference between the predictions our model actually made and the predictions it would have made had it not had the chance to affect its environment by broadcasting predictions in the past. Thus, statistical feedback is a difference in potential outcomes. An additive feedback model In order to get a handle on feedback as defined above, we assume that feedback enters the model additively: ˆy(t+1) i [y(t) i ] = ˆy(t+1) i [?] + f(y(t) i ), where f is a feedback function, and y(t) i is the prediction published at time t. In other words, we assume that the predictions made by our model at time t + 1 are the sum of the prediction the model would have made if there were no feedback, plus a feedback term that only depends on the previous prediction made by the model. Our goal is to estimate the feedback function f. Artificial noising for feedback detection The relationship between ˆy(t) i and ˆy(t+1) i can be influenced by many things, such as trends, mean reversion, random fluctuations, as well as feedback. In order to isolate the effect of feedback, we need to add some noise to the system to create a situation that resembles a randomized experiment. Ideally, we might hope to sometimes turn our predictive system off in order to get estimates of ˆy(t) i [?]. However, predictive models are often deeply integrated into large software systems, and it may not be clear what the correct system behavior would be if we turned the predictor off. To side-step this concern, we randomize our system by adding artificial noise to predictions: at time t, instead of deploying the prediction ˆy(t) i , we deploy ˇy(t) i = ˆy(t) i + ⌫(t) i , where ⌫(t) i iid ⇠N is artificial noise drawn from some distribution N. Because the noise ⌫(t) i is independent from everything else, it puts us in a randomized experimental setup that allows us to detect feedback as a causal effect. If the time t + 1 prediction ˆy(t+1) i is affected by ⌫(t) i , then our system must have feedback because the only way ⌫(t) i can influence ˆy(t+1) i is through the interaction between our model predictions and the surrounding environment at time t. Local average treatment effect In practice, we want the noise ⌫(t) i to be small enough that it does not disturb the regular operation of the predictive model too much. Thus, our experimental setup allows us to measure feedback as a local average treatment effect [4], where the artificial noise ⌫(t) i acts as a continuous treatment. Provided our additive model holds, we can then piece together these local treatment effects into a single global feedback function f. 3 Linear Feedback We begin with an analysis of linear feedback problems; the linear setup allows us to convey the main insights with less technical overhead. We discuss the non-linear case in Section 4. Suppose that we have some natural process x(1), x(2), ... and a predictive model of the form ˆy = w · x. (Suppose for notational convenience that x includes the constant, and the intercept term is folded into w.) For our purposes, w is fixed and known; for example, w may have been set by training on historical data. At some point, we ship a system that starts broadcasting the predictions ˆy = w · x, and there is a concern that the act of broadcasting the ˆy may perturb the underlying x(t) process. Our goal is to detect any such feedback. Following earlier notation we write ˆy(t+1) i [ˆy(t) i ] = w · x(t+1) i [ˆy(t) i ] for the time t + 1 variables perturbed by feedback, and ˆy(t+1) i [?] = w · x(t+1) i [?] for the counterparts we would have observed without any feedback. In this setup, any effect of ˆy(t) i on x(t+1) i [ˆy(t) i ] is feedback. A simple way to constrain this relationship is using a linear model x(t+1) i [ˆy(t) i ] = x(t+1) i [?] + ˆy(t) i γ. In other words, we assume that x(t+1) i [ˆy(t) i ] is perturbed by an amount that scales linearly with ˆy(t) i . Given this simple model, we find that: ˆy(t+1) i [ˆy(t) i ] = ˆy(t+1) i [?] + w · γ ˆy(t) i , (2) 3 and so f(y) = β y with β = w · γ; f is the feedback function we want to fit. We cannot work with (2) directly, because ˆy(t+1) i [?] is not observed. In order to get around this problem, we add artificial noise to our predictions: at time t, we publish predictions ˇy(t) i = ˆy(t) i +⌫(t) i instead of the raw predictions ˆy(t) i . As argued in Section 2, this method lets us detect feedback because ˆy(t+1) i can only depend on ⌫(t) i through a feedback mechanism, and so any relationship between ˆy(t+1) i and ⌫(t) i must be a symptom of feedback. A Simple Regression Approach With the linear feedback model (2), the effect of ⌫(t) i on ˆy(t+1) i is ˆy(t+1) i [ˆy(t) i +⌫(t) i ] = ˆy(t+1) i [ˆy(t) i ] + β ⌫(t) i . This relationship suggests that we should be able to recover β by regressing ˆy(t+1) i against the added noise ⌫(t) i . The following result confirms this intuition. Theorem 1. Suppose that (2) holds, and that we add noise ⌫(t) i to our time t predictions. If we estimate β using linear least squares ˆβ = d Cov h ˆy(t+1) i [ˆy(t) i +⌫(t) i ], ⌫(t) i i d Var h ⌫(t) i i , then pn ⇣ ˆβ −β ⌘ ) N 0 @0, Var h ˆy(t+1) i [ˆy(t) i ] i σ2⌫ 1 A , (3) where σ2 ⌫= Var h ⌫(t) i i and n is the number of examples to which we applied our predictor. Theorem 1 gives us a baseline understanding for the difficulty of the feedback detection problem: the precision of our feedback estimates scales as the ratio of the artificial noise σ2 ⌫to natural noise Var[ˆy(t+1) i [ˆy(t) i ]]. Note that the proof of Theorem 1 assumes that we only used predictions from a single time period t + 1 to fit feedback, and that the raw predictions ˆy(t+1) i [ˆy(t) i ] are all independent. If we relax these assumptions we get a regression problem with correlated errors, and need to be more careful with technical conditions. Efficiency and Conditioning The simple regression model (3) treats the term ˆy(t+1) i [ˆy(t) i ] as noise. This is quite wasteful: if we know ˆy(t) i we usually have a fairly good idea of what ˆy(t+1) i [ˆy(t) i ] should be, and not using this information needlessly inflates the noise. Suppose that we knew the function1 µ(y) := E h ˆy(t+1) i [ˆy(t) i ] ,,, ˆy(t) i = y i . (4) Then, we could write our feedback model as ˆy(t+1) i [ˆy(t) i +⌫(t) i ] = µ ⇣ ˆy(t) i ⌘ + ⇣ ˆy(t+1) i [ˆy(t) i ] −µ ⇣ ˆy(t) i ⌘⌘ + β ⌫(t) i , (5) where µ(ˆy(t) i ) is a known offset. Extracting this offset improves the precision of our estimate for ˆβ. Theorem 2. Under the conditions of Theorem 1 suppose that the function µ from (4) is known and that the ˆy(t+1) i are all independent of each other conditional on ˆy(t) i . Then, given the information available at time t, the estimate ˆβ⇤= d Cov h ˆy(t+1) i [ˆy(t) i +⌫(t) i ] −µ ⇣ ˆy(t) i ⌘ , ⌫(t) i i d Var h ⌫(t) i i has asymptotic distribution (6) pn ⇣ ˆβ⇤−β ⌘ ) N 0 @0, E h Var h ˆy(t+1) i [ˆy(t) i ] ,,, ˆy(t) i ii σ2⌫ 1 A . (7) 1In practice we do not know µ, but we can estimate it; see Section 4. 4 Moreover, if the variance of ⌘(t) i = ˆy(t+1) i [ˆy(t) i ] −µ(ˆy(t) i ) does not depend on ˆy(t) i , then ˆβ⇤is the best linear unbiased estimator of β. Theorem 2 extends the general result from above that the precision with which we can estimate feedback scales as the ratio of artificial noise to natural noise. The reason why ˆβ⇤is more efficient than ˆβ is that we managed to condition away some of the natural noise, and reduced the variance of our estimate for β by Var h µ ⇣ ˆy(t) i ⌘i = Var h ˆy(t+1) i [ˆy(t) i ] i −E h Var h ˆy(t+1) i [ˆy(t) i ] ,,, ˆy(t) i ii . (8) In other words, the variance reduction we get from ˆβ⇤directly matches the amount of variability we can explain away by conditioning. The estimator (6) is not practical as stated, because it requires knowledge of the unknown function µ and is restricted to the case of linear feedback. In the next section, we generalize this estimator into one that does not require prior knowledge of µ and can handle non-linear feedback. 4 Fitting Non-Linear Feedback Suppose now that we have the same setup as in the previous section, except that now feedback has a non-linear dependence on the prediction: ˆy(t+1) i [ˆy(t) i ] = ˆy(t+1) i [?] + f(ˆy(t) i ) for some arbitrary function f. For example, in the case of a linear predictive model ˆy = w · x, this kind of feedback could arise if we have feature feedback x(t+1) i [ˆy(t) i ] = x(t+1) i [?] + f(x)(ˆy(t) i ); the feedback function then becomes f(·) = w · f(x)(·). When we add noise ⌫(t) i to the above predictions, we only affect the feedback term f(·): ˆy(t+1) i [ˆy(t) i +⌫(t) i ] −ˆy(t+1) i [ˆy(t) i ] = f ⇣ ˆy(t) i + ⌫(t) i ⌘ −f ⇣ ˆy(t) i ⌘ . (9) Thus, by adding artificial noise ⌫(t) i , we are able to cancel out the nuisance terms, and isolate the feedback function f that we want to estimate. We cannot use (9) in practice, though, as we can only observe one of ˆy(t+1) i [ˆy(t) i +⌫(t) i ] or ˆy(t+1) i [ˆy(t) i ] in reality; the other one is counterfactual. We can get around this problem by conditioning on ˆy(t) i as in Section 3. Let µ (y) = E h ˆy(t+1) i [ˆy(t) i +⌫(t) i ] ,,, ˆy(t) i = y i (10) = t (y) + 'N ⇤f (y) , where t (y) = E h ˆy(t+1) i [?] ,,, ˆy(t) i = y i is a term that captures trend effects that are not due to feedback. The ⇤denotes convolution: 'N ⇤f (y) = E h f ⇣ ˆy(t) i + ⌫(t) i ⌘,,, ˆy(t) i = y i with ⌫(t) i ⇠N. (11) Using the conditional mean function µ we can write our expression of interest as ˆy(t+1) i [ˆy(t) i +⌫(t) i ] −µ ⇣ ˆy(t) i ⌘ = f ⇣ ˆy(t) i + ⌫(t) i ⌘ −'N ⇤f ⇣ ˆy(t) i ⌘ + ⌘(t) i , (12) where ⌘(t) i := ˆy(t+1) i [?] −t ⇣ ˆy(t) i ⌘ . If we have a good idea of what µ is, the left-hand side can be measured, as it only depends on ˆy(t+1) i [ˆy(t) i +⌫(t) i ] and ˆy(t) i . Meanwhile, conditional on ˆy(t) i , the first two terms on the right-hand side only depend on ⌫(t) i , while ⌘(t) i is independent of ⌫(t) i and meanzero. The upshot is that we can treat (12) as a regression problem where ⌘(t) i is noise. In practice, we estimate µ from an auxiliary problem where we regress ˆy(t+1) i [ˆy(t) i +⌫(t) i ] against ˆy(t) i . 5 A Pragmatic Approach There are many possible approaches to solving the non-parametric system of equations (12) for f [e.g., 8, Chapter 5]. Here, we take a pragmatic approach, and constrain ourselves to solutions of the form ˆµ(y) = ˆβµ · bµ(y) and ˆf(y) = ˆβf · bf(y), where bµ : R ! Rpµ and bf : R ! Rpf are predetermined basis expansions. This approach transforms our problem into an ordinary least-squares problem, and works well in terms of producing reasonable feedback estimates in real-world problems (see Section 5). If this relation in fact holds for some values βµ and βf, the result below shows that we can recover βf by least-squares. Theorem 3. Suppose that βµ and βf are defined as above, and that we have an unbiased estimator ˆβµ of βµ with variance Vµ = Var[ˆβµ]. Then, if we fit βf by least squares using (12) as described in Appendix A, the resulting estimate ˆβf is unbiased and has variance Var h ˆβf i = ⇣ X| f Xf ⌘−1 X| f ! VY + XµVµX| µ " Xf ⇣ X| f Xf ⌘−1 , (13) where the design matrices Xµ and Xf are defined as Xµ = 0 B B B @ ... b| µ ⇣ ˆy(t) i ⌘ ... 1 C C C A and Xf = 0 B B B @ ... b| f ⇣ ˆy(t) i + ⌫(t) i ⌘ −('N ⇤bf)| ⇣ ˆy(t) i ⌘ ... 1 C C C A (14) and VY is a diagonal matrix with (VY )ii = Var h ˆy(t+1) i [ˆy(t) i ] ,,, ˆy(t) i i . In the case where our spline model is misspecified, we can obtain a similar result using methods due to Huber [9] and White [10]. In practice, we can treat ˆβµ as known since fitting µ(·) is usually easier than fitting f(·): estimating µ(·) is just a smoothing problem whereas estimating f(·) requires fitting differences. If we also treat the errors ⌘(t) i in (12) as roughly homoscedatic, (13) reduces to Var h ˆβf i ⇡ E h Var h ˆy(t+1) i [ˆy(t) i ] ,,, ˆy(t) i ii n E [ksik2 2] , where si = bf ⇣ ˆy(t) i + ⌫(t) i ⌘ −'N ⇤bf ⇣ ˆy(t) i ⌘ . (15) This simplified form again shows that the precision of our estimate of f(·) scales roughly as the ratio of the variance of the artificial noise ⌫(t) i to the variance of the natural noise. Our Method in Practice For convenience, we summarize the steps needed to implement our method here: (1) At time t, compute model predictions ˆy(t) i and draw noise terms ⌫(t) i iid ⇠N for some noise distribution N. Deploy predictions ˇy(t) i = ˆy(t) i + ⌫(t) i in the live system. (2) Fit a nonparametric least-squares regression of ˆy(t+1) i [ˆy(t) i +⌫(t) i ] ⇠µ ⇣ ˆy(t) i ⌘ to learn the function µ (y) := E h ˆy(t+1) i [ˆy(t) i +⌫(t) i ] ,,, ˆy(t) i = y i . We use the R formula notation, where a ⇠g(b) means that we want to learn a function g(b) that predicts a. (3) Set up the non-parametric least-squares regression problem ˆy(t+1) i [ˆy(t) i +⌫(t) i ] −µ ⇣ ˆy(t) i ⌘ ⇠f ⇣ ˆy(t) i + ⌫(t) i ⌘ −'N ⇤f ⇣ ˆy(t) i ⌘ , (16) where the goal is to learn f. Here, 'N is the density of ⌫(t) i , and ⇤denotes convolution. In Appendix A we show how to carry out these steps using standard R libraries. The resulting function f(y) is our estimate of feedback: If we make a prediction ˇy(t) i at time t, then our time t + 1 prediction will be boosted by f(ˇy(t) i ). The above equation only depends on ˆy(t) i , ⌫(t) i , 6 and ˆy(t+1) i [ˆy(t) i +⌫(t) i ], which are all quantities that can be observed in the context of an experiment with noised predictions. Note that as we only fit f using the differences in (16), the intercept of f is not identifiable. We fix the intercept (rather arbitrarily) by setting the average fitted feedback over all training examples to 0; we do not include an intercept term in the basis bf. Choice of Noising Distribution Adding noise to deployed predictions often has a cost that may depend on the shape of the noise distribution N. A good choice of N should reflect this cost. For example, if the practical cost of adding noise only depends on the largest amount of noise we ever add, then it may be a good idea to draw ⌫(t) i uniformly at random from {±"} for some " > 0. In our experiments, we draw noise from a Gaussian distribution ⌫(t) i ⇠N(0, σ2 ⌫). 5 A Pilot Study The original motivation for this research was to develop a methodology for detecting feedback in real-world systems. Here, we present results from a pilot study, where we added signal to historical data that we believe should emulate actual feedback. The reason for monitoring feedback on this system is that our system was about to be more closely integrated with other predictive systems, and there was a concern that the integration could induce bad feedback loops. Having a reliable method for detecting feedback would provide us with an early warning system during the integration. The predictive model in question is a logistic regression classifier. We added feedback to historical data collected from log files according to half a dozen rules of the form “if a(t) i is high and ˇy(t) i > 0, then increase a(t+1) i by a random amount”; here ˇy(t) i is the time-t prediction deployed by our system (in log-odds space) and a(t) i is some feature with a positive coefficient. These feedback generation rules do not obey the additive assumption. Thus our model is misspecified in the sense that there is no function f such that a current prediction ˇy(t) i increased the log-odds of the next prediction by f(ˇy(t) i ), and so this example can be taken as a stretch case for our method. Our dataset had on the order of 100,000 data points, half of which were used for fitting the model itself and half of which were used for feedback simulation. We generated data for 5 simulated time periods, adding noise with σ⌫= 0.1 at each step, and fit feedback using a spline basis discussed in Appendix B. The “true feedback” curve was obtained by fitting a spline regression to the additive feedback model by looking at the unobservable ˆy(t+1) i [?]; we used a df = 5 natural spline with knots evenly spread out on [−9, 3] in log-odds space plus a jump at 0. For our classifier of interest, we have fairly strong reasons to believe that the feedback function may have a jump at zero, but probably shouldn’t have any other big jumps. Assuming that we know a priori where to look for jumps does not seem to be too big a problem for the practical applications we have considered. Results for feedback detection are shown in Figure 1. Although the fit is not perfect, we appear to have successfully detected the shape of feedback. The error bars for estimated feedback were obtained using a non-parametric bootstrap [11] for which we resampled pairs of (current, next) predictions. This simulation suggests that our method can be used to accurately detect feedback on scales that may affect real-world systems. Knowing that we can detect feedback is reassuring from an engineering point of view. On a practical level, the feedback curve shown in Figure 1 may not be too big a concern yet: the average feedback is well within the noise level of the classifier. But in largescale systems the ways in which a model interacts with its environment is always changing, and it is entirely plausible that some innocuous-looking change in the future would increase the amount of feedback. Our methodology provides us with a way to continuously monitor how feedback is affected by changes to the system, and can alert us to changes that cause problems. In Appendix B, we show some simulations with a wider range of effect sizes. 7 0.2 0.4 0.6 0.8 0.0 0.1 0.2 0.3 0.4 Prediction Feedback True Feedback Estimated Feedback Figure 1: Simulation aiming to replicate realistic feedback in a real-world classifier. The red solid line is our feedback estimate; the black dashed line is the best additive approximation to the true feedback. The x-axis shows predictions in probability space; the y axis shows feedback in logodds space. The error bars indicate pointwise confidence intervals obtained using a non-parametric bootstrap with B = 10 replicates, and stretch 1 SE in each direction. Further experiments are provided in Appendix B. 6 Conclusion In this paper, we proposed a randomization scheme that can be used to detect feedback in real-world predictive systems. Our method involves adding noise to the predictions made by the system; this noise puts us in a randomized experimental setup that lets us measure feedback as a causal effect. In general, the scale of the artificial noise required to detect feedback is smaller than the scale of the natural predictor noise; thus, we can deploy our feedback detection method without disturbing our system of interest too much. The method does not require us to make hypotheses about the mechanism through which feedback may propagate, and so it can be used to continuously monitor predictive systems and alert us if any changes to the system lead to an increase in feedback. Related Work The interaction between models and the systems they attempt to describe has been extensively studied across many fields. Models can have different kinds of feedback effects on their environments. At one extreme of the spectrum, models can become self-fulfilling prophecies: for example, models that predict economic growth may in fact cause economic growth by instilling market confidence [12, 13]. At the other end, models may distort the phenomena they seek to describe and therefore become invalid. A classical example of this is a concern that any metric used to regulate financial risk may become invalid as soon as it is widely used, because actors in the financial market may attempt to game the metric to avoid regulation [14]. However, much of the work on model feedback in fields like finance, education, or macro-economic theory has focused on negative results: there is an emphasis on understanding when feedback can happen and promoting awareness about how feedback can interact with policy decisions, but there does not appear to be much focus on actually fitting feedback. One notable exception is a paper by Akaike [15], who showed how to fit cross-component feedback in a system with many components; however, he did not add artificial noise to the system, and so was unable to detect feedback of a single component on itself. Acknowledgments The authors are grateful to Alex Blocker, Randall Lewis, and Brad Efron for helpful suggestions and interesting conversations. S. W. is supported by a B. C. and E. J. Eaves Stanford Graduate Fellowship. 8 References [1] Paul W Holland. Statistics and causal inference. Journal of the American Statistical Association, 81(396):945–960, 1986. [2] Joshua D Angrist, Guido W Imbens, and Donald B Rubin. Identification of causal effects using instrumental variables. Journal of the American Statistical Association, 91(434):444–455, 1996. [3] Bradley Efron and David Feldman. Compliance as an explanatory variable in clinical trials. Journal of the American Statistical Association, 86(413):9–17, 1991. [4] Guido W Imbens and Joshua D Angrist. Identification and estimation of local average treatment effects. Econometrica, 62(2):467–475, 1994. [5] L´eon Bottou, Jonas Peters, Joaquin Qui˜nonero-Candela, Denis X Charles, D Max Chickering, Elon Portugaly, Dipankar Ray, Patrice Simard, and Ed Snelson. Counterfactual reasoning and learning systems: The example of computational advertising. Journal of Machine Learning Research, 14:3207–3260, 2013. [6] David Chan, Rong Ge, Ori Gershony, Tim Hesterberg, and Diane Lambert. Evaluating online ad campaigns in a pipeline: Causal models at scale. In Proceedings of the 16th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 7–16. ACM, 2010. [7] Donald B Rubin. Causal inference using potential outcomes. Journal of the American Statistical Association, 100(469):322–331, 2005. [8] Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The Elements of Statistical Learning. Springer New York, second edition, 2009. [9] Peter J Huber. The behavior of maximum likelihood estimates under nonstandard conditions. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, pages 221–233, 1967. [10] Halbert White. A heteroskedasticity-consistent covariance matrix estimator and a direct test for heteroskedasticity. Econometrica: Journal of the Econometric Society, 48(4):817–838, 1980. [11] Bradley Efron and Robert Tibshirani. An Introduction to the Bootstrap. CRC press, 1993. [12] Robert K Merton. The self-fulfilling prophecy. The Antioch Review, 8(2):193–210, 1948. [13] Fabrizio Ferraro, Jeffrey Pfeffer, and Robert I Sutton. Economics language and assumptions: How theories can become self-fulfilling. Academy of Management Review, 30(1):8–24, 2005. [14] J´on Danıelsson. The emperor has no clothes: Limits to risk modelling. Journal of Banking & Finance, 26(7):1273–1296, 2002. [15] Hirotugu Akaike. On the use of a linear model for the identification of feedback systems. Annals of the Institute of Statistical Mathematics, 20(1):425–439, 1968. [16] Theodoros Evgeniou, Massimiliano Pontil, and Tomaso Poggio. Regularization networks and support vector machines. Advances in Computational Mathematics, 13(1):1–50, 2000. [17] Federico Girosi, Michael Jones, and Tomaso Poggio. Regularization theory and neural networks architectures. Neural Computation, 7(2):219–269, 1995. [18] Peter J Green and Bernard W Silverman. Nonparametric Regression and Generalized Linear Models: A Roughness Penalty Approach. Chapman & Hall London, 1994. [19] Trevor Hastie and Robert Tibshirani. Generalized Additive Models. CRC Press, 1990. [20] Grace Wahba. Spline Models for Observational Data. Siam, 1990. [21] Stefanie Biedermann, Holger Dette, and David C Woods. Optimal design for additive partially nonlinear models. Biometrika, 98(2):449–458, 2011. [22] Werner G M¨uller. Optimal design for local fitting. Journal of statistical planning and inference, 55(3):389–397, 1996. [23] William J Studden and D J VanArman. Admissible designs for polynomial spline regression. The Annals of Mathematical Statistics, 40(5):1557–1569, 1969. [24] Erich Leo Lehmann and George Casella. Theory of Point Estimation. Springer, second edition, 1998. 9
2014
304
5,408
Do Convnets Learn Correspondence? Jonathan Long Ning Zhang Trevor Darrell University of California – Berkeley {jonlong, nzhang, trevor}@cs.berkeley.edu Abstract Convolutional neural nets (convnets) trained from massive labeled datasets [1] have substantially improved the state-of-the-art in image classification [2] and object detection [3]. However, visual understanding requires establishing correspondence on a finer level than object category. Given their large pooling regions and training from whole-image labels, it is not clear that convnets derive their success from an accurate correspondence model which could be used for precise localization. In this paper, we study the effectiveness of convnet activation features for tasks requiring correspondence. We present evidence that convnet features localize at a much finer scale than their receptive field sizes, that they can be used to perform intraclass aligment as well as conventional hand-engineered features, and that they outperform conventional features in keypoint prediction on objects from PASCAL VOC 2011 [4]. 1 Introduction Recent advances in convolutional neural nets [2] dramatically improved the state-of-the-art in image classification. Despite the magnitude of these results, many doubted [5] that the resulting features had the spatial specificity necessary for localization; after all, whole image classification can rely on context cues and overly large pooling regions to get the job done. For coarse localization, such doubts were alleviated by record breaking results extending the same features to detection on PASCAL [3]. Now, the same questions loom on a finer scale. Are the modern convnets that excel at classification and detection also able to find precise correspondences between object parts? Or do large receptive fields mean that correspondence is effectively pooled away, making this a task better suited for hand-engineered features? In this paper, we provide evidence that convnet features perform at least as well as conventional ones, even in the regime of point-to-point correspondence, and we show considerable performance improvement in certain settings, including category-level keypoint prediction. 1.1 Related work Image alignment Image alignment is a key step in many computer vision tasks, including face verification, motion analysis, stereo matching, and object recognition. Alignment results in correspondence across different images by removing intraclass variability and canonicalizing pose. Alignment methods exist on a supervision spectrum from requiring manually labeled fiducial points or landmarks, to requiring class labels, to fully unsupervised joint alignment and clustering models. Congealing [6] is an unsupervised joint alignment method based on an entropy objective. Deep congealing [7] builds on this idea by replacing hand-engineered features with unsupervised feature learning from multiple resolutions. Inspired by optical flow, SIFT flow [8] matches densely sampled SIFT features for correspondence and has been applied to motion prediction and motion transfer. In Section 3, we apply SIFT flow using deep features for aligning different instances of the same class. 1 Keypoint localization Semantic parts carry important information for object recognition, object detection, and pose estimation. In particular, fine-grained categorization, the subject of many recent works, depends strongly on part localization [9, 10]. Large pose and appearance variation across examples make part localization for generic object categories a challenging task. Most of the existing works on part localization or keypoint prediction focus on either facial landmark localization [11] or human pose estimation. Human pose estimation has been approached using tree structured methods to model the spatial relationships between parts [12, 13, 14], and also using poselets [15] as an intermediate step to localize human keypoints [16, 17]. Tree structured models and poselets may struggle when applied to generic objects with large articulated deformations and wide shape variance. Deep learning Convolutional neural networks have gained much recent attention due to their success in image classification [2]. Convnets trained with backpropagation were initially succesful in digit recognition [18] and OCR [19]. The feature representations learned from large data sets have been found to generalize well to other image classification tasks [20] and even to object detection [3, 21]. Recently, Toshev et al. [22] trained a cascade of regression-based convnets for human pose estimation and Jain et al. [23] combine a weak spatial model with deep learning methods. The latter work trains multiple small, independent convnets on 64 × 64 patches for binary bodypart detection. In contrast, we employ a powerful pretained ImageNet model that shares mid-elvel feature representations among all parts in Section 5. Several recent works have attempted to analyze and explain this overwhelming success. Zeiler and Fergus [24] provide several heuristic visualizations suggesting coarse localization ability. Szegedy et al. [25] show counterintuitive properties of the convnet representation, and suggest that individual feature channels may not be more semantically meaningful than other bases in feature space. A concurrent work [26] compares convnet features with SIFT in a standard descriptor matching task. This work illuminates and extends that comparison by providing visual analysis and by moving beyond single instance matching to intraclass correspondence and keypoint prediction. 1.2 Preliminaries We perform experiments using a network architecture almost identical1 to that popularized by Krizhevsky et al. [2] and trained for classification using the 1.2 million images of the ILSVRC 2012 challenge dataset [1]. All experiments are implemented using caffe [27], and our network is the publicly available caffe reference model. We use the activations of each layer as features, referred to as convn, pooln, or fcn for the nth convolutional, pooling, or fully connected layer, respectively. We will use the term receptive field, abbreviated rf, to refer to the set of input pixels that are path-connected to a particular unit in the convnet. 2 Feature visualization Table 1: Convnet receptive field sizes and strides, for an input of size 227 × 227. layer rf size stride conv1 11 × 11 4 × 4 conv2 51 × 51 8 × 8 conv3 99 × 99 16 × 16 conv4 131 × 131 16 × 16 conv5 163 × 163 16 × 16 pool5 195 × 195 32 × 32 In this section and Figures 1 and 2, we provide a novel visual investigation of the effective pooling regions of convnet features. In Figure 1, we perform a nonparametric reconstruction of images from features in the spirit of HOGgles [28]. Rather than paired dictionary learning, however, we simply replace patches with averages of their top-k nearest neighbors in a convnet feature space. To do so, we first compute all features at a particular layer, resulting in an 2d grid of feature vectors. We associate each feature vector with a patch in the original image at the center of the corresponding receptive field and with size equal to the receptive field stride. (Note that the strides of the receptive fields are much smaller than the receptive fields 1Ours reverses the order of the response normalization and pooling layers. 2 conv3 conv4 conv5 uniform rf 1 neighbor 5 neighbors 1 neighbor 5 neighbors Figure 1: Even though they have large receptive fields, convnet features carry local information at a finer scale. Upper left: given an input image, we replaced 16 × 16 patches with averages over 1 or 5 nearest neighbor patches, computed using convnet features centered at those patches. The yellow square illustrates one input patch, and the black squares show the corresponding rfs for the three layers shown. Right: Notice that the features retrieve reasonable matches for the centers of their receptive fields, even though those rfs extend over large regions of the source image. In the “uniform rf” column, we show the best that could be expected if convnet features discarded all spatial information within their rfs, by choosing input patches uniformly at random from conv3sized neighborhoods. (Best viewed electronically.) themselves, which overlap. Refer to Table 1 above for specific numbers.) We replace each such patch with an average over k nearest neighbor patches using a database of features densely computed on the images of PASCAL VOC 2011. Our database contains at least one million patches for every layer. Features are matched by cosine similarity. Even though the feature rfs cover large regions of the source images, the specific resemblance of the resulting images shows that information is not spread uniformly throughout those regions. Notable features (e.g., the tires of the bicycle and the facial features of the cat) are replaced in their corresponding locations. Also note that replacement appears to become more semantic and less visually specific as the layer deepens: the eyes and nose of the cat get replaced with differently colored or shaped eyes and noses, and the fur gets replaced with various animal furs, with the diversity increasing with layer number. Figure 2 gives a feature-centric rather than image-centric view of feature locality. For each column, we first pick a random seed feature vector (computed from a PASCAL image), and find k nearest neighbor features, again by cosine similarity. Instead of averaging only the centers, we average the entire receptive fields of the neighbors. The resulting images show that similar features tend to respond to similar colors specifically in the centers of their receptive fields. 3 conv3 conv4 conv5 5 nbrs 50 nbrs 500 nbrs Figure 2: Similar convnet features tend to have similar receptive field centers. Starting from a randomly selected seed patch occupying one rf in conv3, 4, or 5, we find the nearest k neighbor features computed on a database of natural images, and average together the corresponding receptive fields. The contrast of each image has been expanded after averaging. (Note that since each layer is computed with a stride of 16, there is an upper bound on the quality of alignment that can be witnessed here.) 3 Intraclass alignment We conjecture that category learning implicitly aligns instances by pooling over a discriminative mid-level representation. If this is true, then such features should be useful for post-hoc alignment in a similar fashion to conventional features. To test this, we use convnet features for the task of aligning different instances of the same class. We approach this difficult task in the style of SIFT flow [8]: we retrieve near neighbors using a coarse similarity measure, and then compute dense correspondences on which we impose an MRF smoothness prior which finally allows all images to be warped into alignment. Nearest neighbors are computed using fc7 features. Since we are specifically testing the quality of alignment, we use the same nearest neighbors for convnet or conventional features, and we compute both types of features at the same locations, the grid of convnet rf centers in the response to a single image. Alignment is determined by solving an MRF formulated on this grid of feature locations. Let p be a point on this grid, let fs(p) be the feature vector of the source image at that point, and let ft(p) be the feature vector of the target image at that point. For each feature grid location p of the source image, there is a vector w(p) giving the displacement of the corresponding feature in the target image. We use the energy function E(w) = X p ∥fs(p) −ft(p + w(p))∥2 + β X (p,q)∈E ∥w(p) −w(q)∥2 2, where E are the edges of a 4-neighborhood graph and β is the regularization parameter. Optimization is performed using belief propagation, with the techniques suggested in [29]. Message passing is performed efficiently using the squared Euclidean distance transform [30]. (Unlike the L1 regularization originally used by SIFT flow [8], this formulation maintains rotational invariance of w.) Based on its performance in the next section, we use conv4 as our convnet feature, and SIFT with descriptor radius 20 as our conventional feature. From validation experiments, we set β = 3 · 10−3 for both conv4 and SIFT features (which have a similar scale). Given the alignment field w, we warp target to source using bivariate spline interpolation (implemented in SciPy [31]). Figure 3 gives examples of alignment quality for a few different seed images, using both SIFT and convnet features. We show five warped nearest neighbors as well as keypoints transferred from those neighbors. We quantitatively assess the alignment by measuring the accuracy of predicted keypoints. To obtain good predictions, we warp 25 nearest neighbors for each target image, and order them from smallest to greatest deformation energy (we found this method to outperform ordering using the data term). We take the predicted keypoints to be the median points (coordinate-wise) of the top five aligned keypoints according to this ordering. We assess correctness using mean PCK [32]. We consider a ground truth keypoint to be correctly predicted if the prediction lies within a Euclidean distance of α times the maximum of the bounding 4 target image five nearest neighbors conv4 flow SIFT flow conv4 flow SIFT flow Figure 3: Convnet features can bring different instances of the same class into good alignment at least as well (on average) as traditional features. For each target image (left column), we show warped versions of five nearest neighbor images aligned with conv4 flow (first row), and warped versions aligned with SIFT flow [8] (second row). Keypoints from the warped images are shown copied to the target image. The cat shows a case where convnet features perform better, while the bicycle shows a case where SIFT features perform better. (Note that each instance is warped to a square bounding box before alignment. Best viewed in color.) Table 2: Keypoint transfer accuracy using convnet flow, SIFT flow, and simple copying from nearest neighbors. Accuracy (PCK) is shown per category using α = 0.1 (see text) and means are also shown for the stricter values α = 0.05 and 0.025. On average, convnet flow performs as well as SIFT flow, and performs a bit better for stricter tolerances. aero bike bird boat bttl bus car cat chair cow table dog horse mbike prsn plant sheep sofa train tv mean conv4 flow 28.2 34.1 20.4 17.1 50.6 36.7 20.9 19.6 15.7 25.4 12.7 18.7 25.9 23.1 21.4 40.2 21.1 14.5 18.3 33.3 24.9 SIFT flow 27.6 30.8 19.9 17.5 49.4 36.4 20.7 16.0 16.1 25.0 16.1 16.3 27.7 28.3 20.2 36.4 20.5 17.2 19.9 32.9 24.7 NN transfer 18.3 24.8 14.5 15.4 48.1 27.6 16.0 11.1 12.0 16.8 15.7 12.7 20.2 18.5 18.7 33.4 14.0 15.5 14.6 30.0 19.9 mean α = 0.1 α = 0.05 α = 0.025 conv4 flow 24.9 11.8 4.08 SIFT flow 24.7 10.9 3.55 NN transfer 19.9 7.8 2.35 box width and height, picking some α ∈[0, 1]. We compute the overall accuracy for each type of keypoint, and report the average over keypoint types. We do not penalize predicted keypoints that are not visible in the target image. Results are given in Table 2. We show per category results using α = 0.1, and mean results for α = 0.1, 0.05, and 0.025. Indeed, convnet learned features are at least as capable as SIFT at alignment, and better than might have been expected given the size of their receptive fields. 4 Keypoint classification In this section, we specifically address the ability of convnet features to understand semantic information at the scale of parts. As an initial test, we consider the task of keypoint classification: given an image and the coordinates of a keypoint on that image, can we train a classifier to label the keypoint? 5 Table 3: Keypoint classification accuracies, in percent, on the twenty categories of PASCAL 2011 val, trained with SIFT or convnet features. The best SIFT and convnet scores are bolded in each category. aero bike bird boat bttl bus car cat chair cow table dog horse mbike prsn plant sheep sofa train tv mean SIFT 10 36 42 36 32 67 64 40 37 33 37 60 34 39 38 29 63 37 42 64 75 45 (radius) 20 37 50 39 35 74 67 47 40 36 43 68 38 42 48 33 70 44 52 68 77 50 40 35 54 37 41 76 68 47 37 39 40 69 36 42 49 32 69 39 52 74 78 51 80 33 43 37 42 75 66 42 30 43 36 70 31 36 51 27 70 35 49 69 77 48 160 27 36 34 38 72 59 35 25 39 30 67 27 32 46 25 70 29 48 66 76 44 conv 1 16 14 15 19 20 29 15 22 16 17 29 17 14 16 15 33 18 12 27 29 20 (layer) 2 37 43 40 35 69 63 38 44 35 40 61 38 40 44 34 65 39 41 63 72 47 3 42 50 46 41 76 69 46 52 39 45 64 47 48 52 40 74 46 50 71 77 54 4 44 53 49 42 78 70 45 55 41 48 68 51 51 53 41 76 49 52 73 76 56 5 44 51 49 41 77 68 44 53 39 45 63 50 49 52 39 73 47 47 71 75 54 (a) cat left eye (b) cat nose Figure 4: Convnet features show fine localization ability, even beyond their stride and in cases where SIFT features do not perform as well. Each plot is a 2D histogram of the locations of the maximum responses of a classifer in a 21 by 21 pixel rectangle taken around a ground truth keypoint. (a) (b) Figure 5: Cross validation scores for cat keypoint classification as a function of the SVM parameter C. In (a), we plot mean accuracy against C for five different convnet features; in (b) we plot the same for SIFT features of different sizes. We use C = 10−6 for all experiments in Table 3. For this task we use keypoint data [15] on the twenty classes of PASCAL VOC 2011 [4]. We extract features at each keypoint using SIFT [33] and using the column of each convnet layer whose rf center lies closest to the keypoint. (Note that the SIFT features will be more precisely placed as a result of this approximation.) We trained one-vs-all linear SVMs on the train set using SIFT at five different radii and each of the five convolutional layer activations as features (in general, we found pooling and normalization layers to have lower performance). We set the SVM parameter C = 10−6 for all experiments based on five-fold cross validation on the training set (see Figure 5). Table 3 gives the resulting accuracies on the val set. We find features from convnet layers consistently perform at least as well as and often better than SIFT at this task, with the highest performance coming from layers conv4 and conv5. Note that we are specifically testing convnet features trained only for classification; the same net could be expected to achieve even higher performance if trained for this task. Finally, we study the precise location understanding of our classifiers by computing their responses with a single-pixel stride around ground truth keypoint locations. For two example keypoints (cat left eye and nose), we histogram the locations of the maximum responses within a 21 pixel by 21 pixel rectangle around the keypoint, shown in Figure 4. We do not include maximum responses that lie on the boundary of this rectangle. While the SIFT classifiers do not seem to be sensitive to the precise locations of the keypoints, in many cases the convnet ones seem to be capable of localization finer than their strides, not just their receptive field sizes. This observation motivates our final experiments to consider detection-based localization performance. 6 5 Keypoint prediction We have seen that despite their large receptive field sizes, convnets work as well as the handengineered feature SIFT for alignment and slightly better than SIFT for keypoint classification. Keypoint prediction provides a natural follow-up test. As in Section 3, we use keypoint annotations from PASCAL VOC 2011, and we assume a ground truth bounding box. Inspired in part by [3, 34, 23], we train sliding window part detectors to predict keypoint locations independently. R-CNN [3] and OverFeat [34] have both demonstrated the effectiveness of deep convolutional networks on the generic object detection task. However, neither of them have investigated the application of CNNs for keypoint prediction.2 R-CNN starts from bottom-up region proposal [35], which tends to overlook the signal from small parts. OverFeat, on the other hand, combines convnets trained for classification and for regression and runs in multi-scale sliding window fashion. We rescale each bounding box to 500 × 500 and compute conv5 (with a stride of 16 pixels). Each cell of conv5 contains one 256-dimensional descriptor. We concatenate conv5 descriptors from a local region of 3 × 3 cells, giving an overall receptive field size of 195 × 195 and feature dimension of 2304. For each keypoint, we train a linear SVM with hard negative mining. We consider the ten closest features to each ground truth keypoint as positive examples, and all the features whose rfs do not contain the keypoint as negative examples. We also train using dense SIFT descriptors for comparison. We compute SIFT on a grid of stride eight and bin size of eight using VLFeat [36]. For SIFT, we consider features within twice the bin size from the ground truth keypoint to be positives, while samples that are at least four times the bin size away are negatives. We augment our SVM detectors with a spherical Gaussian prior over candidate locations constructed by nearest neighbor matching. The mean of each Gaussian is taken to be the location of the keypoint in the nearest neighbor in the training set found using cosine similarity on pool5 features, and we use a fixed standard deviation of 22 pixels. Let s(Xi) be the output score of our local detector for keypoint Xi, and let p(Xi) be the prior score. We combine these to yield a final score f(Xi) = s(Xi)1−ηp(Xi)η, where η ∈[0, 1] is a tradeoff parameter. In our experiments, we set η = 0.1 by cross validation. At test time, we predict the keypoint location as the highest scoring candidate over all feature locations. We evaluate the predicted keypoints using the measure PCK introduced in Section 3, taking α = 0.1. A predicted keypoint is defined as correct if the distance between it and the ground truth keypoint is less than α · max(h, w) where h and w are the height and width of the bounding box. The results using conv5 and SIFT with and without the prior are shown in Table 4. From the table, we can see that local part detectors trained on the conv5 feature outperform SIFT by a large margin and that the prior information is helpful in both cases. To our knowledge, these are the first keypoint prediction results reported on this dataset. We show example results from five different categories in Figure 6. Each set consists of rescaled bounding box images with ground truth keypoint annotations and predicted keypoints using SIFT and conv5 features, where each color corresponds to one keypoint. As the figure shows, conv5 outperforms SIFT, often managing satisfactory outputs despite the challenge of this task. A small offset can be noticed for some keypoints like eyes and noses, likely due to the limited stride of our scanning windows. A final regression or finer stride could mitigate this issue. 6 Conclusion Through visualization, alignment, and keypoint prediction, we have studied the ability of the intermediate features implicitly learned in a state-of-the-art convnet classifier to understand specific, local correspondence. Despite their large receptive fields and weak label training, we have found in all cases that convnet features are at least as useful (and sometimes considerably more useful) than conventional ones for extracting local visual information. Acknowledgements This work was supported in part by DARPA’s MSEE and SMISC programs, by NSF awards IIS-1427425, IIS-1212798, and IIS-1116411, and by support from Toyota. 2But see works cited in Section 1.1 regarding keypoint localization. 7 Table 4: Keypoint prediction results on PASCAL VOC 2011. The numbers give average accuracy of keypoint prediction using the criterion described in Section 3, PCK with α = 0.1. aero bike bird boat bttl bus car cat chair cow table dog horse mbike prsn plant sheep sofa train tv mean SIFT 17.9 16.5 15.3 15.6 25.7 21.7 22.0 12.6 11.3 7.6 6.5 12.5 18.3 15.1 15.9 21.3 14.7 15.1 9.2 19.9 15.7 SIFT+prior 33.5 36.9 22.7 23.1 44.0 42.6 39.3 22.1 18.5 23.5 11.2 20.6 32.2 33.9 26.7 30.6 25.7 26.5 21.9 32.4 28.4 conv5 38.5 37.6 29.6 25.3 54.5 52.1 28.6 31.5 8.9 30.5 24.1 23.7 35.8 29.9 39.3 38.2 30.5 24.5 41.5 42.0 33.3 conv5+prior 50.9 48.8 35.1 32.5 66.1 62.0 45.7 34.2 21.4 41.1 27.2 29.3 46.8 45.6 47.1 42.5 38.8 37.6 50.7 45.6 42.5 Groundtruth SIFT+prior conv5+prior Groundtruth SIFT+prior conv5+prior Figure 6: Examples of keypoint prediction on five classes of the PASCAL dataset: aeroplane, cat, cow, potted plant, and horse. Each keypoint is associated with one color. The first column is the ground truth annotation, the second column is the prediction result of SIFT+prior and the third column is conv5+prior. (Best viewed in color). References [1] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR, 2009. [2] A. Krizhevsky, I. Sutskever, and G. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. [3] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014. [4] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2011 (VOC2011) Results. http://www.pascalnetwork.org/challenges/VOC/voc2011/workshop/index.html. [5] Debate on Yann LeCun’s Google+ page. https://plus.google.com/+YannLeCunPhD/posts/JBBFfv2XgWM. Accessed: 2014-5-31. [6] G. B. Huang, V. Jain, and E. Learned-Miller. Unsupervised joint alignment of complex images. In ICCV, 2007. 8 [7] G. B. Huang, M. A. Mattar, H. Lee, and E. Learned-Miller. Learning to align from scratch. In NIPS, 2012. [8] C. Liu, J. Yuen, and A. Torralba. Sift flow: Dense correspondence across scenes and its applications. PAMI, 33(5):978–994, 2011. [9] J. Liu and P. N. Belhumeur. Bird part localization using exemplar-based models with enforced pose and subcategory consistenty. In ICCV, 2013. [10] T. Berg and P. N. Belhumeur. POOF: Part-based one-vs.-one features for fine-grained categorization, face verification, and attribute estimation. In CVPR, 2013. [11] P. N. Belhumeur, D. W. Jacobs, D. J. Kriegman, and N. Kumar. Localizing parts of faces using a consensus of exemplars. In CVPR, 2011. [12] Y. Yang and D. Ramanan. Articulated pose estimation using flexible mixtures of parts. In CVPR, 2011. [13] M. Sun and S. Savarese. Articulated part-based model for joint object detection and pose estimation. In ICCV, 2011. [14] X. Zhu and D. Ramanan. Face detection, pose estimation, and landmark localization in the wild. In CVPR, 2012. [15] L. Bourdev and J. Malik. Poselets: Body part detectors trained using 3d human pose annotations. In ICCV, 2009. [16] G. Gkioxari, B. Hariharan, R. Girshick, and J. Malik. Using k-poselets for detecting people and localizing their keypoints. In CVPR, 2014. [17] G. Gkioxari, P. Arbelaez, L. Bourdev, and J. Malik. Articulated pose estimation using discriminative armlet classifiers. In CVPR, 2013. [18] Y. LeCun, B. Boser, J.S. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel. Backpropagation applied to hand-written zip code recognition. In Neural Computation, 1989. [19] Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pages 2278–2324, 1998. [20] 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. [21] P. Sermanet, K. Kavukcuoglu, S. Chintala, and Y. LeCun. Pedestrian detection with unsupervised multistage feature learning. In CVPR, 2013. [22] A. Toshev and C. Szegedy. DeepPose: Human pose estimation via deep neural networks. In CVPR, 2014. [23] A. Jain, J. Tompson, M. Andriluka, G. W. Taylor, and C. Bregler. Learning human pose estimation features with convolutional networks. In ICLR, 2014. [24] M. D Zeiler and R. Fergus. Visualizing and understanding convolutional neural networks. In ECCV, 2014. [25] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus. Intriguing properties of neural networks. In ICLR, 2014. [26] P. Fischer, A. Dosovitskiy, and T. Brox. Descriptor Matching with Convolutional Neural Networks: a Comparison to SIFT. ArXiv e-prints, May 2014. [27] Y. Jia, E. Shelhamer, J. Donahue, S. Karayev, J. Long, R. Girshick, S. Guadarrama, and T. Darrell. Caffe: Convolutional architecture for fast feature embedding. arXiv preprint arXiv:1408.5093, 2014. [28] C. Vondrick, A. Khosla, T. Malisiewicz, and A. Torralba. HOGgles: Visualizing Object Detection Features. In ICCV, 2013. [29] P. Felzenszwalb and D. P. Huttenlocher. Efficient belief propagation for early vision. International journal of computer vision, 70(1):41–54, 2006. [30] P. Felzenszwalb and D. Huttenlocher. Distance transforms of sampled functions. Technical report, Cornell University, 2004. [31] E. Jones, T. Oliphant, P. Peterson, et al. SciPy: Open source scientific tools for Python, 2001. [32] Y. Yang and D. Ramanan. Articulated human detection with flexible mixtures of parts. In PAMI, 2013. [33] D.G. Lowe. Object recognition from local scale-invariant features. In ICCV, 1999. [34] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus, and Y. LeCun. Overfeat: Integrated recognition, localization and detection using convolutional networks. In ICLR, 2014. [35] J. Uijlings, K. van de Sande, T. Gevers, and A. Smeulders. Selective search for object recognition. IJCV, 2013. [36] A. Vedaldi and B. Fulkerson. VLFeat: An open and portable library of computer vision algorithms. http://www.vlfeat.org/, 2008. 9
2014
305
5,409
Convolutional Neural Network Architectures for Matching Natural Language Sentences Baotian Hu§∗ Zhengdong Lu† Hang Li† Qingcai Chen§ §Department of Computer Science & Technology, Harbin Institute of Technology Shenzhen Graduate School, Xili, China baotianchina@gmail.com qingcai.chen@hitsz.edu.cn † Noah’s Ark Lab Huawei Technologies Co. Ltd. Sha Tin, Hong Kong lu.zhengdong@huawei.com hangli.hl@huawei.com Abstract Semantic matching is of central importance to many natural language tasks [2, 28]. A successful matching algorithm needs to adequately model the internal structures of language objects and the interaction between them. As a step toward this goal, we propose convolutional neural network models for matching two sentences, by adapting the convolutional strategy in vision and speech. The proposed models not only nicely represent the hierarchical structures of sentences with their layerby-layer composition and pooling, but also capture the rich matching patterns at different levels. Our models are rather generic, requiring no prior knowledge on language, and can hence be applied to matching tasks of different nature and in different languages. The empirical study on a variety of matching tasks demonstrates the efficacy of the proposed model on a variety of matching tasks and its superiority to competitor models. 1 Introduction Matching two potentially heterogenous language objects is central to many natural language applications [28, 2]. It generalizes the conventional notion of similarity (e.g., in paraphrase identification [19]) or relevance (e.g., in information retrieval[27]), since it aims to model the correspondence between “linguistic objects” of different nature at different levels of abstractions. Examples include top-k re-ranking in machine translation (e.g., comparing the meanings of a French sentence and an English sentence [5]) and dialogue (e.g., evaluating the appropriateness of a response to a given utterance[26]). Natural language sentences have complicated structures, both sequential and hierarchical, that are essential for understanding them. A successful sentence-matching algorithm therefore needs to capture not only the internal structures of sentences but also the rich patterns in their interactions. Towards this end, we propose deep neural network models, which adapt the convolutional strategy (proven successful on image [11] and speech [1]) to natural language. To further explore the relation between representing sentences and matching them, we devise a novel model that can naturally host both the hierarchical composition for sentences and the simple-to-comprehensive fusion of matching patterns with the same convolutional architecture. Our model is generic, requiring no prior knowledge of natural language (e.g., parse tree) and putting essentially no constraints on the matching tasks. This is part of our continuing effort1 in understanding natural language objects and the matching between them [13, 26]. ∗The work is done when the first author worked as intern at Noah’s Ark Lab, Huawei Techologies 1Our project page: http://www.noahlab.com.hk/technology/Learning2Match.html 1 Our main contributions can be summarized as follows. First, we devise novel deep convolutional network architectures that can naturally combine 1) the hierarchical sentence modeling through layer-by-layer composition and pooling, and 2) the capturing of the rich matching patterns at different levels of abstraction; Second, we perform extensive empirical study on tasks with different scales and characteristics, and demonstrate the superior power of the proposed architectures over competitor methods. Roadmap We start by introducing a convolution network in Section 2 as the basic architecture for sentence modeling, and how it is related to existing sentence models. Based on that, in Section 3, we propose two architectures for sentence matching, with a detailed discussion of their relation. In Section 4, we briefly discuss the learning of the proposed architectures. Then in Section 5, we report our empirical study, followed by a brief discussion of related work in Section 6. 2 Convolutional Sentence Model We start with proposing a new convolutional architecture for modeling sentences. As illustrated in Figure 1, it takes as input the embedding of words (often trained beforehand with unsupervised methods) in the sentence aligned sequentially, and summarize the meaning of a sentence through layers of convolution and pooling, until reaching a fixed length vectorial representation in the final layer. As in most convolutional models [11, 1], we use convolution units with a local “receptive field” and shared weights, but we design a large feature map to adequately model the rich structures in the composition of words. Figure 1: The over all architecture of the convolutional sentence model. A box with dashed lines indicates all-zero padding turned off by the gating function (see top of Page 3). Convolution As shown in Figure 1, the convolution in Layer-1 operates on sliding windows of words (width k1), and the convolutions in deeper layers are defined in a similar way. Generally,with sentence input x, the convolution unit for feature map of type-f (among Fℓof them) on Layer-ℓis z(ℓ,f) i def = z(ℓ,f) i (x) = σ(w(ℓ,f)ˆz(ℓ−1) i + b(ℓ,f)), f = 1, 2, · · · , Fℓ (1) and its matrix form is z(ℓ) i def = z(ℓ) i (x) = σ(W(ℓ)ˆz(ℓ−1) i + b(ℓ)), where • z(ℓ,f) i (x) gives the output of feature map of type-f for location i in Layer-ℓ; • w(ℓ,f) is the parameters for f on Layer-ℓ, with matrix form W(ℓ) def = [w(ℓ,1), · · · , w(ℓ,Fℓ)]; • σ(·) is the activation function (e.g., Sigmoid or Relu [7]) • ˆz(ℓ−1) i denotes the segment of Layer-ℓ−1 for the convolution at location i , while ˆz(0) i = xi:i+k1−1 def = [x⊤ i , x⊤ i+1, · · · , x⊤ i+k1−1]⊤ concatenates the vectors for k1 (width of sliding window) words from sentence input x. Max-Pooling We take a max-pooling in every two-unit window for every f, after each convolution z(ℓ,f) i = max(z(ℓ−1,f) 2i−1 , z(ℓ−1,f) 2i ), ℓ= 2, 4, · · · . The effects of pooling are two-fold: 1) it shrinks the size of the representation by half, thus quickly absorbs the differences in length for sentence representation, and 2) it filters out undesirable composition of words (see Section 2.1 for some analysis). 2 Length Variability The variable length of sentences in a fairly broad range can be readily handled with the convolution and pooling strategy. More specifically, we put all-zero padding vectors after the last word of the sentence until the maximum length. To eliminate the boundary effect caused by the great variability of sentence lengths, we add to the convolutional unit a gate which sets the output vectors to all-zeros if the input is all zeros. For any given sentence input x, the output of type-f filter for location i in the ℓth layer is given by z(ℓ,f) i def = z(ℓ,f) i (x) = g(ˆz(ℓ−1) i ) · σ(w(ℓ,f)ˆz(ℓ−1) i + b(ℓ,f)), (2) where g(v) = 0 if all the elements in vector v equals 0, otherwise g(v) = 1. This gate, working with max-pooling and positive activation function (e.g., Sigmoid), keeps away the artifacts from padding in all layers. Actually it creates a natural hierarchy of all-zero padding (as illustrated in Figure 1), consisting of nodes in the neural net that would not contribute in the forward process (as in prediction) and backward propagation (as in learning). 2.1 Some Analysis on the Convolutional Architecture Figure 2: The cat example, where in the convolution layer, gray color indicates less confidence in composition. The convolutional unit, when combined with max-pooling, can act as the compositional operator with local selection mechanism as in the recursive autoencoder [21]. Figure 2 gives an example on what could happen on the first two layers with input sentence “The cat sat on the mat”. Just for illustration purpose, we present a dramatic choice of parameters (by turning off some elements in W(1)) to make the convolution units focus on different segments within a 3-word window. For example, some feature maps (group 2) give compositions for “the cat” and “cat sat”, each being a vector. Different feature maps offer a variety of compositions, with confidence encoded in the values (color coded in output of convolution layer in Figure 2). The pooling then chooses, for each composition type, between two adjacent sliding windows, e.g., between “on the” and “the mat” for feature maps group 2 from the rightmost two sliding windows. Relation to Recursive Models Our convolutional model differs from Recurrent Neural Network (RNN, [15]) and Recursive Auto-Encoder (RAE, [21]) in several important ways. First, unlike RAE, it does not take a single path of word/phrase composition determined either by a separate gating function [21], an external parser [19], or just natural sequential order [20]. Instead, it takes multiple choices of composition via a large feature map (encoded in w(ℓ,f) for different f), and leaves the choices to the pooling afterwards to pick the more appropriate segments(in every adjacent two) for each composition. With any window width kℓ≥3, the type of composition would be much richer than that of RAE. Second, our convolutional model can take supervised training and tune the parameters for a specific task, a property vital to our supervised learning-to-match framework. However, unlike recursive models [20, 21], the convolutional architecture has a fixed depth, which bounds the level of composition it could do. For tasks like matching, this limitation can be largely compensated with a network afterwards that can take a “global” synthesis on the learned sentence representation. Relation to “Shallow” Convolutional Models The proposed convolutional sentence model takes simple architectures such as [18, 10] (essentially the same convolutional architecture as SENNA [6]), which consists of a convolution layer and a max-pooling over the entire sentence for each feature map. This type of models, with local convolutions and a global pooling, essentially do a “soft” local template matching and is able to detect local features useful for a certain task. Since the sentencelevel sequential order is inevitably lost in the global pooling, the model is incapable of modeling more complicated structures. It is not hard to see that our convolutional model degenerates to the SENNA-type architecture if we limit the number of layers to be two and set the pooling window infinitely large. 3 3 Convolutional Matching Models Based on the discussion in Section 2, we propose two related convolutional architectures, namely ARC-I and ARC-II), for matching two sentences. 3.1 Architecture-I (ARC-I) Architecture-I (ARC-I), as illustrated in Figure 3, takes a conventional approach: It first finds the representation of each sentence, and then compares the representation for the two sentences with a multi-layer perceptron (MLP) [3]. It is essentially the Siamese architecture introduced in [2, 11], which has been applied to different tasks as a nonlinear similarity function [23]. Although ARC-I enjoys the flexibility brought by the convolutional sentence model, it suffers from a drawback inherited from the Siamese architecture: it defers the interaction between two sentences Figure 3: Architecture-I for matching two sentences. (in the final MLP) to until their individual representation matures (in the convolution model), therefore runs at the risk of losing details (e.g., a city name) important for the matching task in representing the sentences. In other words, in the forward phase (prediction), the representation of each sentence is formed without knowledge of each other. This cannot be adequately circumvented in backward phase (learning), when the convolutional model learns to extract structures informative for matching on a population level. 3.2 Architecture-II (ARC-II) In view of the drawback of Architecture-I, we propose Architecture-II (ARC-II) that is built directly on the interaction space between two sentences. It has the desirable property of letting two sentences meet before their own high-level representations mature, while still retaining the space for the individual development of abstraction of each sentence. Basically, in Layer-1, we take sliding windows on both sentences, and model all the possible combinations of them through “one-dimensional” (1D) convolutions. For segment i on SX and segment j on SY , we have the feature map z(1,f) i,j def = z(1,f) i,j (x, y) = g(ˆz(0) i,j ) · σ(w(ℓ,f)ˆz(0) i,j + b(ℓ,f)), (3) where ˆz(0) i,j ∈R2k1De simply concatenates the vectors for sentence segments for SX and SY : ˆz(0) i,j = [x⊤ i:i+k1−1, y⊤ j:j+k1−1]⊤. Clearly the 1D convolution preserves the location information about both segments. After that in Layer-2, it performs a 2D max-pooling in non-overlapping 2 × 2 windows (illustrated in Figure 5) z(2,f) i,j = max({z(2,f) 2i−1,2j−1, z(2,f) 2i−1,2j, z(2,f) 2i,2j−1, z(2,f) 2i,2j }). (4) In Layer-3, we perform a 2D convolution on k3 × k3 windows of output from Layer-2: z(3,f) i,j = g(ˆz(2) i,j ) · σ(W(3,f)ˆz(2) i,j + b(3,f)). (5) This could go on for more layers of 2D convolution and 2D max-pooling, analogous to that of convolutional architecture for image input [11]. The 2D-Convolution After the first convolution, we obtain a low level representation of the interaction between the two sentences, and from then we obtain a high level representation z(ℓ) i,j which encodes the information from both sentences. The general two-dimensional convolution is formulated as z(ℓ) i,j = g(ˆz(ℓ−1) i,j ) · σ(W(ℓ)ˆz(ℓ−1) i,j + b(ℓ,f)), ℓ= 3, 5, · · · (6) where ˆz(ℓ−1) i,j concatenates the corresponding vectors from its 2D receptive field in Layer-ℓ−1. This pooling has different mechanism as in the 1D case, for it selects not only among compositions on different segments but also among different local matchings. This pooling strategy resembles the dynamic pooling in [19] in a similarity learning context, but with two distinctions: 1) it happens on a fixed architecture and 2) it has much richer structure than just similarity. 4 Figure 4: Architecture-II (ARC-II) of convolutional matching model 3.3 Some Analysis on ARC-II Figure 5: Order preserving in 2D-pooling. Order Preservation Both the convolution and pooling operation in Architecture-II have this order preserving property. Generally, z(ℓ) i,j contains information about the words in SX before those in z(ℓ) i+1,j, although they may be generated with slightly different segments in SY , due to the 2D pooling (illustrated in Figure 5). The orders is however retained in a “conditional” sense. Our experiments show that when ARC-II is trained on the (SX, SY , ˜SY ) triples where ˜SY randomly shuffles the words in SY , it consistently gains some ability of finding the correct SY in the usual contrastive negative sampling setting, which however does not happen with ARC-I. Model Generality It is not hard to show that ARC-II actually subsumes ARC-I as a special case. Indeed, in ARC-II if we choose (by turning off some parameters in W(ℓ,·)) to keep the representations of the two sentences separated until the final MLP, ARC-II can actually act fully like ARC-I, as illustrated in Figure 6. More specifically, if we let the feature maps in the first convolution layer to be either devoted to SX or devoted to SY (instead of taking both as in general case), the output of each segment-pair is naturally divided into two corresponding groups. As a result, the output for each filter f, denoted z(1,f) 1:n,1:n (n is the number of sliding windows), will be of rank-one, possessing essentially the same information as the result of the first convolution layer in ARC-I. Clearly the 2D pooling that follows will reduce to 1D pooling, with this separateness preserved. If we further limit the parameters in the second convolution units (more specifically w(2,f)) to those for SX and SY , we can ensure the individual development of different levels of abstraction on each side, and fully recover the functionality of ARC-I. Figure 6: ARC-I as a special case of ARC-II. Better viewed in color. 5 As suggested by the order-preserving property and the generality of ARC-II, this architecture offers not only the capability but also the inductive bias for the individual development of internal abstraction on each sentence, despite the fact that it is built on the interaction between two sentences. As a result, ARC-II can naturally blend two seemingly diverging processes: 1) the successive composition within each sentence, and 2) the extraction and fusion of matching patterns between them, hence is powerful for matching linguistic objects with rich structures. This intuition is verified by the superior performance of ARC-II in experiments (Section 5) on different matching tasks. 4 Training We employ a discriminative training strategy with a large margin objective. Suppose that we are given the following triples (x, y+, y−) from the oracle, with x matched with y+ better than with y−. We have the following ranking-based loss as objective: e(x, y+, y−; Θ) = max(0, 1 + s(x, y−) −s(x, y+)), where s(x, y) is predicted matching score for (x, y), and Θ includes the parameters for convolution layers and those for the MLP. The optimization is relatively straightforward for both architectures with the standard back-propagation. The gating function (see Section 2) can be easily adopted into the gradient by discounting the contribution from convolution units that have been turned off by the gating function. In other words, We use stochastic gradient descent for the optimization of models. All the proposed models perform better with mini-batch (100 ∼200 in sizes) which can be easily parallelized on single machine with multi-cores. For regularization, we find that for both architectures, early stopping [16] is enough for models with medium size and large training sets (with over 500K instances). For small datasets (less than 10k training instances) however, we have to combine early stopping and dropout [8] to deal with the serious overfitting problem. We use 50-dimensional word embedding trained with the Word2Vec [14]: the embedding for English words (Section 5.2 & 5.4) is learnt on Wikipedia (∼1B words), while that for Chinese words (Section 5.3) is learnt on Weibo data (∼300M words). Our other experiments (results omitted here) suggest that fine-tuning the word embedding can further improve the performances of all models, at the cost of longer training. We vary the maximum length of words for different tasks to cope with its longest sentence. We use 3-word window throughout all experiments2, but test various numbers of feature maps (typically from 200 to 500), for optimal performance. ARC-II models for all tasks have eight layers (three for convolution, three for pooling, and two for MLP), while ARC-I performs better with less layers (two for convolution, two for pooling, and two for MLP) and more hidden nodes. We use ReLu [7] as the activation function for all of models (convolution and MLP), which yields comparable or better results to sigmoid-like functions, but converges faster. 5 Experiments We report the performance of the proposed models on three matching tasks of different nature, and compare it with that of other competitor models. Among them, the first two tasks (namely, Sentence Completion and Tweet-Response Matching) are about matching of language objects of heterogenous natures, while the third one (paraphrase identification) is a natural example of matching homogeneous objects. Moreover, the three tasks involve two languages, different types of matching, and distinctive writing styles, proving the broad applicability of the proposed models. 5.1 Competitor Methods • WORDEMBED: We first represent each short-text as the sum of the embedding of the words it contains. The matching score of two short-texts are calculated with an MLP with the embedding of the two documents as input; • DEEPMATCH: We take the matching model in [13] and train it on our datasets with 3 hidden layers and 1,000 hidden nodes in the first hidden layer; • URAE+MLP: We use the Unfolding Recursive Autoencoder [19]3 to get a 100dimensional vector representation of each sentence, and put an MLP on the top as in WORDEMBED; • SENNA+MLP/SIM: We use the SENNA-type sentence model for sentence representation; 2Our other experiments suggest that the performance can be further increased with wider windows. 3Code from: http://nlp.stanford.edu/˜socherr/classifyParaphrases.zip 6 • SENMLP: We take the whole sentence as input (with word embedding aligned sequentially), and use an MLP to obtain the score of coherence. All the competitor models are trained on the same training set as the proposed models, and we report the best test performance over different choices of models (e.g., the number and size of hidden layers in MLP). 5.2 Experiment I: Sentence Completion This is an artificial task designed to elucidate how different matching models can capture the correspondence between two clauses within a sentence. Basically, we take a sentence from Reuters [12]with two “balanced” clauses (with 8∼28 words) divided by one comma, and use the first clause as SX and the second as SY . The task is then to recover the original second clause for any given first clause. The matching here is considered heterogeneous since the relation between the two is nonsymmetrical on both lexical and semantic levels. We deliberately make the task harder by using negative second clauses similar to the original ones4, both in training and testing. One representative example is given as follows: Model P@1(%) Random Guess 20.00 DEEPMATCH 32.5 WORDEMBED 37.63 SENMLP 36.14 SENNA+MLP 41.56 URAE+MLP 25.76 ARC-I 47.51 ARC-II 49.62 Table 1: Sentence Completion. SX: Although the state has only four votes in the Electoral College, S+ Y : its loss would be a symbolic blow to republican presidential candi date Bob Dole. S− Y : but it failed to garner enough votes to override an expected veto by president Clinton. All models are trained on 3 million triples (from 600K positive pairs), and tested on 50K positive pairs, each accompanied by four negatives, with results shown in Table 1. The two proposed models get nearly half of the cases right5, with large margin over other sentence models and models without explicit sequence modeling. ARC-II outperforms ARC-I significantly, showing the power of joint modeling of matching and sentence meaning. As another convolutional model, SENNA+MLP performs fairly well on this task, although still running behind the proposed convolutional architectures since it is too shallow to adequately model the sentence. It is a bit surprising that URAE comes last on this task, which might be caused by the facts that 1) the representation model (including word-embedding) is not trained on Reuters, and 2) the split-sentence setting hurts the parsing, which is vital to the quality of learned sentence representation. 5.3 Experiment II: Matching A Response to A Tweet Model P@1(%) Random Guess 20.00 DEEPMATCH 49.85 WORDEMBED 54,31 SENMLP 52.22 SENNA+MLP 56.48 ARC-I 59.18 ARC-II 61.95 Table 2: Tweet Matching. We trained our model with 4.5 million original (tweet, response) pairs collected from Weibo, a major Chinese microblog service [26]. Compared to Experiment I, the writing style is obviously more free and informal. For each positive pair, we find ten random responses as negative examples, rendering 45 million triples for training. One example (translated to English) is given below, with SX standing for the tweet, S+ Y the original response, and S− Y the randomly selected response: SX: Damn, I have to work overtime this weekend! S+ Y : Try to have some rest buddy. S− Y : It is hard to find a job, better start polishing your resume. We hold out 300K original (tweet, response) pairs and test the matching model on their ability to pick the original response from four random negatives, with results reported in Table 2. This task is slightly easier than Experiment I , with more training instances and purely random negatives. It requires less about the grammatical rigor but more on detailed modeling of loose and local matching patterns (e.g., work-overtime⇔rest). Again ARC-II beats other models with large margins, while two convolutional sentence models ARC-I and SENNA+MLP come next. 4We select from a random set the clauses that have 0.7∼0.8 cosine similarity with the original. The dataset and more information can be found from http://www.noahlab.com.hk/technology/Learning2Match.html 5Actually ARC-II can achieve 74+% accuracy with random negatives. 7 5.4 Experiment III: Paraphrase Identification Paraphrase identification aims to determine whether two sentences have the same meaning, a problem considered a touchstone of natural language understanding. This experiment Model Acc. (%) F1(%) Baseline 66.5 79.90 Rus et al. (2008) 70.6 80.5 WORDEMBED 68.7 80.49 SENNA+MLP 68.4 79.7 SENMLP 68.4 79.5 ARC-I 69.6 80.27 ARC-II 69.9 80.91 Table 3: The results on Paraphrase. is included to test our methods on matching homogenous objects. Here we use the benchmark MSRP dataset [17], which contains 4,076 instances for training and 1,725 for test. We use all the training instances and report the test performance from early stopping. As stated earlier, our model is not specially tailored for modeling synonymy, and generally requires ≥100K instances to work favorably. Nevertheless, our generic matching models still manage to perform reasonably well, achieving an accuracy and F1 score close to the best performer in 2008 based on hand-crafted features [17], but still significantly lower than the state-of-the-art (76.8%/83.6%), achieved with unfolding-RAE and other features designed for this task [19]. 5.5 Discussions ARC-II outperforms others significantly when the training instances are relatively abundant (as in Experiment I & II). Its superiority over ARC-I, however, is less salient when the sentences have deep grammatical structures and the matching relies less on the local matching patterns, as in ExperimentI. This therefore raises the interesting question about how to balance the representation of matching and the representations of objects, and whether we can guide the learning process through something like curriculum learning [4]. As another important observation, convolutional models (ARC-I & II, SENNA+MLP) perform favorably over bag-of-words models, indicating the importance of utilizing sequential structures in understanding and matching sentences. Quite interestingly, as shown by our other experiments, ARC-I and ARC-II trained purely with random negatives automatically gain some ability in telling whether the words in a given sentence are in right sequential order (with around 60% accuracy for both). It is therefore a bit surprising that an auxiliary task on identifying the correctness of word order in the response does not enhance the ability of the model on the original matching tasks. We noticed that simple sum of embedding learned via Word2Vec [14] yields reasonably good results on all three tasks. We hypothesize that the Word2Vec embedding is trained in such a way that the vector summation can act as a simple composition, and hence retains a fair amount of meaning in the short text segment. This is in contrast with other bag-of-words models like DEEPMATCH [13]. 6 Related Work Matching structured objects rarely goes beyond estimating the similarity of objects in the same domain [23, 24, 19], with few exceptions like [2, 18]. When dealing with language objects, most methods still focus on seeking vectorial representations in a common latent space, and calculating the matching score with inner product[18, 25]. Few work has been done on building a deep architecture on the interaction space for texts-pairs, but it is largely based on a bag-of-words representation of text [13]. Our models are related to the long thread of work on sentence representation. Aside from the models with recursive nature [15, 21, 19] (as discussed in Section 2.1), it is fairly common practice to use the sum of word-embedding to represent a short-text, mostly for classification [22]. There is very little work on convolutional modeling of language. In addition to [6, 18], there is a very recent model on sentence representation with dynamic convolutional neural network [9]. This work relies heavily on a carefully designed pooling strategy to handle the variable length of sentence with a relatively small feature map, tailored for classification problems with modest sizes. 7 Conclusion We propose deep convolutional architectures for matching natural language sentences, which can nicely combine the hierarchical modeling of individual sentences and the patterns of their matching. Empirical study shows our models can outperform competitors on a variety of matching tasks. Acknowledgments: B. Hu and Q. Chen are supported in part by National Natural Science Foundation of China 61173075. Z. Lu and H. Li are supported in part by China National 973 project 2014CB340301. 8 References [1] O. Abdel-Hamid, A. Mohamed, H. Jiang, and G. Penn. Applying convolutional neural networks concepts to hybrid nn-hmm model for speech recognition. In Proceedings of ICASSP, 2012. [2] B. Antoine, X. Glorot, J. Weston, and Y. Bengio. A semantic matching energy function for learning with multi-relational data. Machine Learning, 94(2):233–259, 2014. [3] Y. Bengio. Learning deep architectures for ai. Found. Trends Mach. Learn., 2(1):1–127, 2009. [4] Y. Bengio, J. Louradourand, R. Collobert, and J. Weston. Curriculum learning. In Proceedings of ICML, 2009. [5] P. F. Brown, S. A. D. Pietra, V. J. D. Pietra, and R. L. Mercer. The mathematics of statistical machine translation: Parameter estimation. Computational linguistics, 19(2):263–311, 1993. [6] R. Collobert, J. Weston, L. Bottou, M. Karlen, K. Kavukcuoglu, and P. Kuksa. Natural language processing (almost) from scratch. Journal of Machine Learning Research, 12:2493–2537, 2011. [7] G. E. Dahl, T. N. Sainath, and G. E. Hinton. Improving deep neural networks for lvcsr using rectified linear units and dropout. In Proceedings of ICASSP, 2013. [8] G. E. Hinton, N. Srivastava, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. CoRR, abs/1207.0580, 2012. [9] N. Kalchbrenner, E. Grefenstette, and P. Blunsom. A convolutional neural network for modelling sentences. In Proceedings of ACL, Baltimore and USA, 2014. [10] Y. Kim. Convolutional neural networks for sentence classification. In Proceedings of EMNLP, 2014. [11] Y. LeCun and Y. Bengio. Convolutional networks for images, speech and time series. The Handbook of Brain Theory and Neural Networks, 3361, 1995. [12] Y. Lewis, David D.and Yang, T. G. Rose, and F. Li. Rcv1: A new benchmark collection for text categorization research. Journal of Machine Learning Research, 5:361–397, 2004. [13] Z. Lu and H. Li. A deep architecture for matching short texts. In Advances in NIPS, 2013. [14] T. Mikolov, K. Chen, G. Corrado, and J. Dean. Efficient estimation of word representations in vector space. CoRR, abs/1301.3781, 2013. [15] T. Mikolov and M. Karafi´at. Recurrent neural network based language model. In Proceedings of INTERSPEECH, 2010. [16] C. Rich, L. Steve, and G. Lee. Overfitting in neural nets: Backpropagation, conjugate gradient, and early stopping. In Advances in NIPS, 2000. [17] V. Rus, P. M. McCarthy, M. C. Lintean, D. S. McNamara, and A. C. Graesser. Paraphrase identification with lexico-syntactic graph subsumption. In Proceedings of FLAIRS Conference, 2008. [18] Y. Shen, X. He, J. Gao, L. Deng, and G. Mesnil. Learning semantic representations using convolutional neural networks for web search. In Proceedings of WWW, 2014. [19] R. Socher, E. H. Huang, and A. Y. Ng. Dynamic pooling and unfolding recursive autoencoders for paraphrase detection. In Advances in NIPS, 2011. [20] R. Socher, C. C. Lin, A. Y. Ng, and C. D. Manning. Parsing Natural Scenes and Natural Language with Recursive Neural Networks. In Proceedings of ICML, 2011. [21] R. Socher, J. Pennington, E. H. Huang, A. Y. Ng, and C. D. Manning. Semi-supervised recursive autoencoders for predicting sentiment distributions. In Proceedings of EMNLP, 2011. [22] Y. Song and D. Roth. On dataless hierarchical text classification. In Proceedings of AAAI, 2014. [23] Y. Sun, X. Wang, and X. Tang. Hybrid deep learning for face verification. In Proceedings of ICCV, 2013. [24] S. V. N. Vishwanathan, N. N. Schraudolph, R. Kondor, and K. M. Borgwardt. Graph kernels. Journal of Machine Learning Research(JMLR), 11:1201–1242, 2010. [25] B. Wang, X. Wang, C. Sun, B. Liu, and L. Sun. Modeling semantic relevance for question-answer pairs in web social communities. In Proceedings of ACL, 2010. [26] H. Wang, Z. Lu, H. Li, and E. Chen. A dataset for research on short-text conversations. In Proceedings of EMNLP, Seattle, Washington, USA, 2013. [27] W. Wu, Z. Lu, and H. Li. Learning bilinear model for matching queries and documents. The Journal of Machine Learning Research, 14(1):2519–2548, 2013. [28] X. Xue, J. Jiwoon, and C. W. Bruce. Retrieval models for question and answer archives. In Proceedings of SIGIR ’08, New York, NY, USA, 2008. 9
2014
306
5,410
Conditional Random Field Autoencoders for Unsupervised Structured Prediction Waleed Ammar Chris Dyer Noah A. Smith School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213, USA {wammar,cdyer,nasmith}@cs.cmu.edu Abstract We introduce a framework for unsupervised learning of structured predictors with overlapping, global features. Each input’s latent representation is predicted conditional on the observed data using a feature-rich conditional random field (CRF). Then a reconstruction of the input is (re)generated, conditional on the latent structure, using a generative model which factorizes similarly to the CRF. The autoencoder formulation enables efficient exact inference without resorting to unrealistic independence assumptions or restricting the kinds of features that can be used. We illustrate connections to traditional autoencoders, posterior regularization, and multi-view learning. We then show competitive results with instantiations of the framework for two canonical tasks in natural language processing: part-of-speech induction and bitext word alignment, and show that training the proposed model can be substantially more efficient than a comparable feature-rich baseline. 1 Introduction Conditional random fields [24] are used to model structure in numerous problem domains, including natural language processing (NLP), computational biology, and computer vision. They enable efficient inference while incorporating rich features that capture useful domain-specific insights. Despite their ubiquity in supervised settings, CRFs—and, crucially, the insights about effective feature sets obtained by developing them—play less of a role in unsupervised structure learning, a problem which traditionally requires jointly modeling observations and the latent structures of interest. For unsupervised structured prediction problems, less powerful models with stronger independence assumptions are standard.1 This state of affairs is suboptimal in at least three ways: (i) adhering to inconvenient independence assumptions when designing features is limiting—we contend that effective feature engineering is a crucial mechanism for incorporating inductive bias in unsupervised learning problems; (ii) features and their weights have different semantics in joint and conditional models (see §3.1); and (iii) modeling the generation of high-dimensional observable data with feature-rich models is computationally challenging, requiring expensive marginal inference in the inner loop of iterative parameter estimation algorithms (see §3.1). Our approach leverages the power and flexibility of CRFs in unsupervised learning without sacrificing their attractive computational properties or changing the semantics of well-understood feature sets. Our approach replaces the standard joint model of observed data and latent structure with a twolayer conditional random field autoencoder that first generates latent structure with a CRF (conditional on the observed data) and then (re)generates the observations conditional on just the predicted structure. For the reconstruction model, we use distributions which offer closed-form maximum 1For example, a first-order hidden Markov model requires that yi ⊥xi+1 | yi+1 for a latent sequence y = ⟨y1, y2, . . .⟩generating x = ⟨x1, x2, . . .⟩, while a first-order CRF allows yi to directly depend on xi+1. 1 Extension: partial reconstruction. In our running POS example, the reconstruction model pθ(ˆxi | yi) defines a distribution over words given tags. Because word distributions are heavytailed, estimating such a distribution reliably is quite challenging. Our solution is to define a function π : X →ˆ X such that | ˆ X| ≪|X|, and let ˆxi = π(xi) be a deterministic transformation of the original structured observation. We can add indirect supervision by defining π such that it represents observed information relevant to the latent structure of interest. For example, we found reconstructing Brown clusters [5] of tokens instead of their surface forms to improve POS induction. Other possible reconstructions include word embeddings, morphological and spelling features of words. More general graphs. We presented the CRF autoencoder in terms of sequential Markovian assumptions for ease of exposition; however, this framework can be used to model arbitrary hidden structures. For example, instantiations of this model can be used for unsupervised learning of parse trees [21], semantic role labels [42], and coreference resolution [35] (in NLP), motif structures [1] in computational biology, and object recognition [46] in computer vision. The requirements for applying the CRF autoencoder model are: • An encoding discriminative model defining pλ(y | x, φ). The encoder may be any model family where supervised learning from ⟨x, y⟩pairs is efficient. • A reconstruction model that defines pθ(ˆx | y, φ) such that inference over y given ⟨x, ˆx⟩is efficient. • The independencies among y | x, ˆx are not strictly weaker than those among y | x. 2.1 Learning & Inference Model parameters are selected to maximize the regularized conditional log likelihood of reconstructed observations ˆx given the structured observation x: ℓℓ(λ, θ) = R1(λ) + R2(θ) + P (x,ˆx)∈T log P y pλ(y | x) × pθ(ˆx | y) (2) We apply block coordinate descent, alternating between maximizing with respect to the CRF parameters (λ-step) and the reconstruction parameters (θ-step). Each λ-step applies one or two iterations of a gradient-based convex optimizer.5 The θ-step applies one or two iterations of EM [10], with a closed-form solution in the M-step in each EM iteration. The independence assumptions among y make the marginal inference required in both steps straightforward; we omit details for space. In the experiments below, we apply a squared L2 regularizer for the CRF parameters λ, and a symmetric Dirichlet prior for categorical parameters θ. The asymptotic runtime complexity of each block coordinate descent iteration, assuming the firstorder Markov dependencies in Fig. 2 (right), is: O |θ| + |λ| + |T | × |x|max × |Y|max × (|Y|max × |Fyi−1,yi| + |Fx,yi|)  (3) where Fyi−1,yi are the active “label bigram” features used in ⟨yi−1, yi⟩factors, Fx,yi are the active emission-like features used in ⟨x, yi⟩factors. |x|max is the maximum length of an observation sequence. |Y|max is the maximum cardinality6 of the set of possible assignments of yi. After learning the λ and θ parameters of the CRF autoencoder, test-time predictions are made using maximum a posteriori estimation, conditioning on both observations and reconstructions, i.e., ˆyMAP = arg maxy pλ,θ(y | x, ˆx). 3 Connections To Previous Work This work relates to several strands of work in unsupervised learning. Two broad types of models have been explored that support unsupervised learning with flexible feature representations. Both are 5We experimented with AdaGrad [12] and L-BFGS. When using AdaGrad, we accummulate the gradient vectors across block coordinate ascent iterations. 6In POS induction, |Y| is a constant, the number of syntactic classes which we configure to 12 in our experiments. In word alignment, |Y| is the size of the source sentence plus one, therefore |Y|max is the maximum length of a source sentence in the bitext corpus. 4 fully generative models that define joint distributions over x and y. We discuss these “undirected” and “directed” alternatives next, then turn to less closely related methods. 3.1 Existing Alternatives for Unsupervised Learning with Features Undirected models. A Markov random field (MRF) encodes the joint distribution through local potential functions parameterized using features. Such models “normalize globally,” requiring during training the calculation of a partition function summing over all possible inputs and outputs. In our notation: Z(θ) = X x∈X ∗ X y∈Y|x| exp λ⊤¯g(x, y) (4) where ¯g collects all the local factorization by cliques of the graph, for clarity. The key difficulty is in the summation over all possible observations. Approximations have been proposed, including contrastive estimation, which sums over subsets of X ∗[38, 43] (applied variously to POS learning by Haghighi and Klein [18] and word alignment by Dyer et al. [14]) and noise contrastive estimation [30]. Directed models. The directed alternative avoids the global partition function by factorizing the joint distribution in terms of locally normalized conditional probabilities, which are parameterized in terms of features. For unsupervised sequence labeling, the model was called a “feature HMM” by Berg-Kirkpatrick et al. [3]. The local emission probabilities p(xi | yi) in a first-order HMM for POS tagging are reparameterized as follows (again, using notation close to ours): pλ(xi | yi) = exp λ⊤g(xi, yi) P x∈X exp λ⊤g(x, yi) (5) The features relating hidden to observed variables must be local within the factors implied by the directed graph. We show below that this locality restriction excludes features that are useful (§A.1). Put in these terms, the proposed autoencoding model is a hybrid directed-undirected model. Asymptotic Runtime Complexity of Inference. The models just described cannot condition on arbitrary amounts of x without increasing inference costs. Despite the strong independence assumptions of those models, the computational complexity of inference required for learning with CRF autoencoders is better (§2.1). Consider learning the parameters of an undirected model by maximizing likelihood of the observed data. Computing the gradient for a training instance x requires time O |λ| + |T | × |x| × |Y| × (|Y| × |Fyi−1,yi|+|X| × |Fxi,yi|)  , where Fxi−yi are the emission-like features used in an arbitrary assignment of xi and yi. When the multiplicative factor |X| is large, inference is slow compared to CRF autoencoders. Inference in directed models is faster than in undirected models, but still slower than CRF autoencoder models. In directed models [3], each iteration requires time O |λ| + |T | × |x| × |Y| × (|Y| × |Fyi−1,yi| + |Fxi,yi|)+|θ′| × max(|Fyi−1,yi|, |FX,yi|)  , where Fxi,yi are the active emission features used in an arbitrary assignment of xi and yi, FX,yi is the union of all emission features used with an arbitrary assignment of yi, and θ′ are the local emission and transition probabilities. When |X| is large, the last term |θ′|×max(|Fyi−1,yi|, |FX,yi|) can be prohibitively large. 3.2 Other Related Work The proposed CRF autoencoder is more distantly related to several important ideas in less-thansupervised learning. 5 Autoencoders and other “predict self” methods. Our framework borrows its general structure, Fig. 2 (left), as well as its name, from neural network autoencoders. The goal of neural autoencoders has been to learn feature representations that improve generalization in otherwise supervised learning problems [44, 8, 39]. In contrast, the goal of CRF autoencoders is to learn specific interpretable regularities of interest.7 It is not clear how neural autoencoders could be used to learn the latent structures that CRF autoencoders learn, without providing supervised training examples. Stoyanov et al. [40] presented a related approach for discriminative graphical model learning, including features and latent variables, based on backpropagation, which could be used to instantiate the CRF autoencoder. Daum´e III [9] introduced a reduction of an unsupervised problem instance to a series of singlevariable supervised classifications. The first series of these construct a latent structure y given the entire x, then the second series reconstruct the input. The approach can make use of any supervised learner; if feature-based probabilistic models were used, a |X| summation (akin to Eq. 5) would be required. On unsupervised POS induction, this approach performed on par with the undirected model of Smith and Eisner [38]. Minka [29] proposed cascading a generative model and a discriminative model, where class labels (to be predicted at test time) are marginalized out in the generative part first, and then (re)generated in the discriminative part. In CRF autoencoders, observations (available at test time) are conditioned on in the discriminative part first, and then (re)generated in the generative part. Posterior regularization. Introduced by Ganchev et al. [16], posterior regularization is an effective method for specifying constraint on the posterior distributions of the latent variables of interest; a similar idea was proposed independently by Bellare et al. [2]. For example, in POS induction, every sentence might be expected to contain at least one verb. This is imposed as a soft constraint, i.e., a feature whose expected value under the model’s posterior is constrained. Such expectation constraints are specified directly by the domain-aware model designer.8 The approach was applied to unsupervised POS induction, word alignment, and parsing. Although posterior regularization was applied to directed feature-less generative models, the idea is orthogonal to the model family and can be used to add more inductive bias for training CRF autoencoder models. 4 Evaluation We evaluate the effectiveness of CRF autoencoders for learning from unlabeled examples in POS induction and word alignment. We defer the detailed experimental setup to Appendix A. Part-of-Speech Induction Results. Fig. 3 compares predictions of the CRF autoencoder model in seven languages to those of a featurized first-order HMM model [3] and a standard (feature-less) first-order HMM, using V-measure [37] (higher is better). First, note the large gap between both feature-rich models on the one hand, and the feature-less HMM model on the other hand. Second, note that CRF autoencoders outperform featurized HMMs in all languages, except Italian, with an average relative improvement of 12%. These results provide empirical evidence that feature engineering is an important source of inductive bias for unsupervised structured prediction problems. In particular, we found that using Brown cluster reconstructions and specifying features which span multiple words significantly improve the performance. Refer to Appendix A for more analysis. Bitext Word Alignment Results. First, we consider an intrinsic evaluation on a Czech-English dataset of manual alignments, measuring the alignment error rate (AER; [32]). We also perform an 7This is possible in CRF autoencoders due to the interdependencies among variables in the hidden structure and the manually specified feature templates which capture the relationship between observations and their hidden structures. 8In a semi-supervised setting, when some labeled examples of the hidden structure are available, Druck and McCallum [11] used labeled examples to estimate desirable expected values. We leave semi-supervised applications of CRF autoencoders to future work; see also Suzuki and Isozaki [41]. 6 Arabic Basque Danish Greek Hungarian Italian Turkish Average V−measure 0.0 0.1 0.2 0.3 0.4 0.5 0.6 Standard HMM Featurized HMM CRF autoencoder Figure 3: V-measure [37] of induced parts of speech in seven languages. The CRF autoencoder with features spanning multiple words and with Brown cluster reconstructions achieves the best results in all languages but Italian, closely followed by the feature-rich HMM of Berg-Kirkpatrick et al. [3]. The standard multinomial HMM consistently ranks last. direction fast align model 4 auto forward 27.7 31.5 27.5 reverse 25.9 24.1 21.1 symmetric 25.2 22.2 19.5 pair fast align model 4 auto cs-en 15.2±0.3 15.3±0.1 15.5±0.1 ur-en 20.0±0.6 20.1±0.6 20.8±0.5 zh-en 56.9±1.6 56.7±1.6 56.1±1.7 Table 1: Left: AER results (%) for Czech-English word alignment. Lower values are better. . Right: Bleu translation quality scores (%) for Czech-English, Urdu-English and Chinese-English. Higher values are better. . extrinsic evaluation of translation quality in three language pairs, using case-insensitive Bleu [33] of a machine translation system (cdec9 [13]) built using the word alignment predictions of each model. AER for variants of each model (forward, reverse, and symmetrized) are shown in Table 1 (left). Our model significantly outperforms both baselines. Bleu scores on the three language pairs are shown in Table 1; alignments obtained with our CRF autoencoder model improve translation quality of the Czech-English and Urdu-English translation systems, but not of Chinese-English. This is unsurprising, given that Chinese orthography does not use letters, so that source-language spelling and morphology features our model incorporates introduce only noise here. Better feature engineering, or more data, is called for. We have argued that the feature-rich CRF autoencoder will scale better than its feature-rich alternatives. Fig. 5 (in Appendix A.2) shows the average per-sentence inference runtime for the CRF autoencoder compared to exact inference in an MRF [14] with a similar feature set, as a function of the number of sentences in the corpus. For CRF autoencoders, the average inference runtime grows slightly due to the increased number of parameters, while it grows substantially with vocabulary size in MRF models [14].10 5 Conclusion We have presented a general and scalable framework to learn from unlabeled examples for structured prediction. The technique allows features with global scope in observed variables with favorable asymptotic inference runtime. We achieve this by embedding a CRF as the encoding model in the 9http://www.cdec-decoder.org/ 10We only compare runtime, instead of alignment quality, because retraining the MRF model with exact inference was too expensive. 7 input layer of an autoencoder, and reconstructing a transformation of the input at the output layer using simple categorical distributions. The key advantages of the proposed model are scalability and modeling flexibility. We applied the model to POS induction and bitext word alignment, obtaining results that are competitive with the state of the art on both tasks. Acknowledgments We thank Brendan O’Connor, Dani Yogatama, Jeffrey Flanigan, Manaal Faruqui, Nathan Schneider, Phil Blunsom and the anonymous reviewers for helpful suggestions. We also thank Taylor BergKirkpatrick for providing his implementation of the POS induction baseline, and Phil Blunsom for sharing POS induction evaluation scripts. This work was sponsored by the U.S. Army Research Laboratory and the U.S. Army Research Office under contract/grant number W911NF-10-1-0533. The statements made herein are solely the responsibility of the authors. References [1] T. L. Bailey and C. Elkan. Unsupervised learning of multiple motifs in biopolymers using expectation maximization. Machine learning, 1995. [2] K. Bellare, G. Druck, and A. McCallum. Alternating projections for learning with expectation constraints. In Proc. of UAI, 2009. [3] T. Berg-Kirkpatrick, A. Bouchard-Cˆot´e, J. DeNero, and D. Klein. Painless unsupervised learning with features. In Proc. of NAACL, 2010. [4] P. Blunsom and T. Cohn. Discriminative word alignment with conditional random fields. In Proc. of Proceedings of ACL, 2006. [5] P. F. Brown, P. V. deSouza, R. L. Mercer, V. J. D. Pietra, and J. C. Lai. Class-based n-gram models of natural language. Computational Linguistics, 1992. [6] P. F. Brown, V. J. D. Pietra, S. A. D. Pietra, and R. L. Mercer. The mathematics of statistical machine translation: parameter estimation. In Computational Linguistics, 1993. [7] S. Buchholz and E. Marsi. CoNLL-X shared task on multilingual dependency parsing. In CoNLL-X, 2006. [8] R. Collobert and J. Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proc. of ICML, 2008. [9] H. Daum´e III. Unsupervised search-based structured prediction. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 209–216. ACM, 2009. [10] A. P. Dempster, N. M. Laird, D. B. Rubin, et al. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal statistical Society, 39(1):1–38, 1977. [11] G. Druck and A. McCallum. High-performance semi-supervised learning using discriminatively constrained generative models. In Proc. of ICML, 2010. [12] J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. JMLR, 2011. [13] C. Dyer, A. Lopez, J. Ganitkevitch, J. Weese, F. Ture, P. Blunsom, H. Setiawan, V. Eidelman, and P. Resnik. cdec: A decoder, alignment, and learning framework for finite-state and contextfree translation models. In Proc. of ACL, 2010. [14] C. Dyer, J. Clark, A. Lavie, and N. A. Smith. Unsupervised word alignment with arbitrary features. In Proc. of ACL-HLT, 2011. [15] C. Dyer, V. Chahuneau, and N. A. Smith. A simple, fast, and effective reparameterization of IBM Model 2. In Proc. of NAACL, 2013. [16] K. Ganchev, J. Grac¸a, J. Gillenwater, and B. Taskar. Posterior regularization for structured latent variable models. Journal of Machine Learning Research, 11:2001–2049, 2010. [17] Q. Gao and S. Vogel. Parallel implementations of word alignment tool. In In Proc. of the ACL workshop, 2008. [18] A. Haghighi and D. Klein. Prototype-driven learning for sequence models. In Proc. of NAACLHLT, 2006. [19] F. Jelinek. Statistical Methods for Speech Recognition. MIT Press, 1997. 8 [20] M. Johnson. Why doesn’t EM find good HMM POS-taggers? In Proc. of EMNLP, 2007. [21] D. Klein and C. D. Manning. Corpus-based induction of syntactic structure: Models of dependency and constituency. In Proc. of ACL, 2004. [22] P. Koehn. Statistical Machine Translation. Cambridge, 2010. [23] P. Koehn, F. J. Och, and D. Marcu. Statistical phrase-based translation. In Proc. of NAACL, 2003. [24] J. Lafferty, A. McCallum, and F. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Proc. of ICML, 2001. [25] P. Liang. Semi-supervised learning for natural language. In Thesis, MIT, 2005. [26] C.-C. Lin, W. Ammar, C. Dyer, and L. Levin. The cmu submission for the shared task on language identification in code-switched data. In First Workshop on Computational Approaches to Code Switching at EMNLP, 2014. [27] A. V. Lukashin and M. Borodovsky. Genemark. hmm: new solutions for gene finding. Nucleic acids research, 26(4):1107–1115, 1998. [28] B. Merialdo. Tagging english text with a probabilistic model. In Comp. Ling., 1994. [29] T. Minka. Discriminative models, not discriminative training. Technical report, Technical Report MSR-TR-2005-144, Microsoft Research, 2005. [30] A. Mnih and Y. W. Teh. A fast and simple algorithm for training neural probabilistic language models. In Proc. of ICML, 2012. [31] J. Nivre, J. Hall, S. Kubler, R. McDonald, J. Nilsson, S. Riedel, and D. Yuret. The CoNLL 2007 shared task on dependency parsing. In Proc. of CoNLL, 2007. [32] F. Och and H. Ney. A systematic comparison of various statistical alignment models. Computational Linguistics, 2003. [33] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu. Bleu: a method for automatic evaluation of machine translation. In Proc. of ACL, 2002. [34] S. Petrov, D. Das, and R. McDonald. A universal part-of-speech tagset. In Proc. of LREC, May 2012. [35] H. Poon and P. Domingos. Joint unsupervised coreference resolution with Markov logic. In Proc. of EMNLP, 2008. [36] S. Reddy and S. Waxmonsky. Substring-based transliteration with conditional random fields. In Proc. of the Named Entities Workshop, 2009. [37] A. Rosenberg and J. Hirschberg. V-measure: A conditional entropy-based external cluster evaluation measure. In EMNLP-CoNLL, 2007. [38] N. A. Smith and J. Eisner. Contrastive estimation: Training log-linear models on unlabeled data. In Proc. of ACL, 2005. [39] R. Socher, C. D. Manning, and A. Y. Ng. Learning continuous phrase representations and syntactic parsing with recursive neural networks. In NIPS workshop, 2010. [40] V. Stoyanov, A. Ropson, and J. Eisner. Empirical risk minimization of graphical model parameters given approximate inference, decoding, and model structure. In Proc. of AISTATS, 2011. [41] J. Suzuki and H. Isozaki. Semi-supervised sequential labeling and segmentation using gigaword scale unlabeled data. In Proc. of ACL, 2008. [42] R. Swier and S. Stevenson. Unsupervised semantic role labelling. In Proc. of EMNLP, 2004. [43] D. Vickrey, C. C. Lin, and D. Koller. Non-local contrastive objectives. In Proc. of ICML, 2010. [44] P. Vincent, H. Larochelle, Y. Bengio, and P.-A. Manzagol. Extracting and composing robust features with denoising autoencoders. In Proc. of ICML, 2008. [45] S. Vogel, H. Ney, and C. Tillmann. Hmm-based word alignment in statistical translation. In Proc. of COLING, 1996. [46] M. Weber, M. Welling, and P. Perona. Unsupervised learning of models for recognition. 2000. [47] J. Yamato, J. Ohya, and K. Ishii. Recognizing human action in time-sequential images using hidden Markov model. In Proc. of CVPR, pages 379–385. IEEE, 1992. 9
2014
307
5,411
Optimal rates for k-NN density and mode estimation Sanjoy Dasgupta University of California, San Diego, CSE dasgupta@eng.ucsd.edu Samory Kpotufe ∗ Princeton University, ORFE samory@princeton.edu Abstract We present two related contributions of independent interest: (1) high-probability finite sample rates for k-NN density estimation, and (2) practical mode estimators – based on k-NN – which attain minimax-optimal rates under surprisingly general distributional conditions. 1 Introduction We prove finite sample bounds for k-nearest neighbor (k-NN) density estimation, and subsequently apply these bounds to the related problem of mode estimation. These two main results, while related, are interesting on their own. First, k-NN density estimation [1] is one of the better known and simplest density estimation procedures. The estimate fk(x) of an unknown density f (see Definition 1 of Section 3) is a simple functional of the distance rk(x) from x to its k-th nearest neighbor in a sample X[n] ≜{Xi}n i=1. As such it is intimately related to other functionals of rk(x), e.g. the degree of vertices x in k-NN graphs and their variants used in modeling communities and in clustering applications (see e.g. [2]). While this procedure has been known for a long time, its convergence properties are still not fully understood. The bulk of research in the area has concentrated on establishing its asymptotic convergence, while its finite sample properties have received little attention in comparison. Our finite sample bounds are concisely derived once the proper tools are identified. The bounds hold with high probability, under general conditions on the unknown density f. This generality proves quite useful as shown in our subsequent application to the problem of mode estimation. The basic problem of estimating the modes (local maxima) of an unknown density f has also been studied for a while (see e.g. [3] for an early take on the problem). It arises in various unsupervised problems where modes are used as a measure of typicality of a sample X. In particular, in modern applications, mode estimation is often used in clustering, with the modes representing cluster centers (see e.g. [4, 5] and general applications of the popular mean-shift procedure). While there exists a rich literature on mode estimation, the bulk of theoretical work concerns estimators of a single mode (highest maximum of f), and often concentrates on procedures that are hard to implement in practice. Given the generality of our first result on k-NN density estimation, we can prove that some simple implementable procedures yield optimal estimates of the modes of an unknown density f, under surprisingly general conditions on f. Our results are overviewed in the following section, along with an overview of the rich literature on k-NN density estimation and mode estimation. This is followed by our theoretical setup in Section 3; our rates for k-NN density estimation are detailed in Section 4, while the results on mode estimation are given in Section 5. ∗Much of this work was conducted when this author was at TTI-Chicago. 1 2 Overview of results and related Work 2.1 Rates for k-NN density estimates The k-NN density estimator dates back perhaps to the early work of [1] where it is shown to be consistent when the unknown density f is continuous on Rd. While one of the best known and simplest procedure for density estimation, it has proved more cumbersome to analyze than its smooth counterpart, the kernel density estimator. More general consistency results such as [6, 7] have been established since its introduction. In particular [6] shows that, for f Lipschitz in a neighborhood of a point x, where f(x) > 0, and k = k(n) satisfying k →∞and k/n2/(2+d) →0, the estimator is asymptotically normal, i.e. √ k(fk(x) −f(x))/f(x) D −→N(0, 1). The recent work of [8], concerning generalized weighted variants of k-NN, shows that asymptotic normality holds under the weaker restriction k/n4/(4+d) → 0 if f is twice differentiable at x. Asymptotic normality as stated above yields some insight into the rate of convergence of fk: we can expect that |fk(x) −f(x)| ≲f(x)/ √ k under the stated conditions on k. In fact, [8] shows that such a result can be obtained in expectation for n = n(x) sufficiently large. In particular, their conditions on k allows for a setting of k ≈n4/(4+d) (not allowed under the above conditions) yielding a minimax-optimal l2 risk E |fk(x) −f(x)|2 ≲f(x)2/k = O(n−4/(4+d)). While consistency results and bounds on expected error are now well understood, we still don’t have a clear understanding of the conditions under which high probability bounds on |fk(x) −f(x)| are possible. This is particularly important given the inherent instability of nearest neighbors estimates which are based on order-statistics rather than the more stable average statistics at the core of kerneldensity estimates. The recent result of [9] provides an initial answer: they obtain a high-probability bound uniformly over x taking value in the sample X[n], however under conditions not allowing for optimal settings of k (where f is assumed Lipschitz). The bounds in the present paper hold with high-probability, simultaneously for all x in the support of f. Rather than requiring smoothness conditions on f, we simply give the bounds in terms of the modulus of continuity of f at any x, i.e. how much f can change in a neighborhood of x. This allows for a useful degree of flexibility in applying these bounds. In particular, optimal bounds under various degrees of smoothness of f at x easily follow. More importantly, for our application to mode estimation, the bounds allow us to handle |fk(x) −f(x)| at different x ∈Rd with varying smoothness in f. As a result we can derive minimax-optimal mode estimation rates for practical procedures under surprisingly weak assumptions. 2.2 Mode estimation There is an extensive literature on mode estimation and we unfortunately can only overview some of the relevant work. Most of the literature covers the case of a unimodal distribution, or one where there is a single maximizer x0 of f. Early work on estimating the (single) mode of a distribution focused primarily on understanding the consistency and rates achievable by various approaches, with much less emphasis on the ease of implementation of these approaches. The common approaches consist of estimating x0 as ˆx ≜arg supx∈Rd fn(x) where fn is an estimate of f, usually a kernel density estimate. Various work such as [3, 10, 11] establish consistency properties of the approach and achievable rates under various Euclidean settings and regularity assumptions on the distribution F. More recent work such as [12, 13] address the problem of optimal choice of bandwidth and kernel to adaptively achieve the minimax risk for mode estimation. Essentially, under smoothness κ (e.g. f is κ times differentiable), the minimax risk (inf ˆx supf Ef ∥ˆx −x0∥) is of the form n−(κ−1)/(2κ+d), as independently established in [14] and [15]. As noticed early in [16], the estimator arg supx∈Rd fn(x), while yielding much insight into the problem, is hard to implement in practice. Hence, other work, apparently starting with [16, 14] have looked into so-called recursive estimators of the (single) mode which are practical and easy to update as the sample size increases. These approaches can be viewed as some form of gradient2 ascent of fn with carefully chosen step sizes. The later versions of [14] are shown to be minimaxoptimal. Another line of work is that of so-called direct mode estimators which estimate the mode from practical statistics of the data [17, 18]. In particular, [18] shows that the simple and practical estimator arg maxx∈X[n] fn(x), where fn is a kernel-density estimator, is a consistent estimator of the mode. We show in the present paper that arg maxx∈X[n] fk(x), where fk is a k-NN density estimator, is not only consistent, but converges at a minimax-optimal rate under surprisingly mild distributional conditions. The more general problem of estimating all modes of distribution has received comparatively little attention. The best known practical approach for this problem is the mean-shift procedure and its variants [19, 4, 20, 21], quite related to recursive-mode-estimators, as they essentially consist of gradient ascent of fn starting from every sample point, where fn is required to be appropriately smooth to ascend (e.g. a smooth kernel estimate). While mean-shift is popular in practice, it has proved quite difficult to analyze. A recent result of [22] comes close to establishing the consistency of mean-shift, as it establishes the convergence of the procedure to the right gradient lines (essentially the ascent path to the mode) if it is seeded from fixed starting points rather than the random samples themselves. It remains unclear however whether mean-shift produces only true modes, given the inherent variability in estimating f from sample. This question was recently addressed by [23] which proposes a hypothesis test to detect false modes based on confidence intervals around Hessians estimated at the modes returned by any procedure. Interestingly, while a k-NN density estimate fk is far from smooth, in fact not even continuous, we show a simple practical procedure that identifies any mode of the unknown density f under mild conditions: we mainly require that f is well approximated by a quadratic in a neighborhood of each mode. Our finite sample rates (on ∥ˆx −x0∥, for an estimate ˆx of any mode x0) are of the form O(k−1/4), hold with high-probability and are minimax-optimal for an appropriate choice of k = Θ(n4/(4+d)). If in addition f is Lipschitz or more generally H¨older-continuous (in principle uniform continuity of f is enough), all the modes returned above a level set λ of fk can be optimally assigned to separate modes of the unknown f. Since λ n→∞ −−−−→0, the procedure consistently prunes false modes. This feature is made intrinsic to the procedure by borrowing from insights of [9, 24] on identifying false clusters by inspecting levels sets of fn. These last works concern the related area of level set estimation, and do not study mode estimation rates. As alluded to so far, our results are given in terms of local assumptions on modes rather than global distributional conditions. We show that any mode that is sufficiently salient (this is locally parametrized) w.r.t. the finite sample size n, is optimally estimated, while false modes are pruned away. In particular our results allow for f having a countably infinite number of modes. 3 Preliminaries Throughout the analysis, we assume access to a sample X[n] = {Xi}n i=1 drawn i.i.d. from an absolutely continuous distribution F over Rd, with Lebesgue-density function f. We let X denote the support of the density function f. The k-NN density estimate at a point x is defined as follows. Definition 1 (k-NN density estimate). For every x ∈Rd, let rk(x) denote the distance from x to its k-th nearest neighbor in X[n]. The density estimate is given as: fk(x) ≜ k n · vd · rk(x)d , where vd denotes the volume of the unit sphere in Rd. All balls considered in the analysis are closed Euclidean balls of Rd. 3 4 k-NN density estimation rates In this section we bound the error in estimating f(x) as fk(x) at every x ∈X. The main results of the section are Lemmas 3 and 4. These lemmas are easily obtained given the right tools: uniform concentration bounds on the empirical mass of balls in Rd, using relative Vapnik-Chervonenkis bounds, i.e. Bernstein’s type bounds rather than Chernoff type bounds (see e.g. Theorem 5.1 of [25]). We next state a form of these bounds for completion. Lemma 1. Let G be a class of functions from X to {0, 1} with VC dimension d < ∞, and P a probability distribution on X. Let E denote expectation with respect to P. Suppose n points are drawn independently at random from P; let En denote expectation with respect to this sample. Then for any δ > 0, with probability at least 1 −δ, the following holds for all g ∈G: −min(βn p Eng, β2 n + βn p Eg) ≤Eg −Eng ≤min(β2 n + βn p Eng, βn p Eg), where βn = p (4/n)(d ln 2n + ln(8/δ)). These sort of relative VC bounds allows for a tighter relation (than Chernoff type bounds) between empirical and true mass of sets (Eng and Eg) in those situations where these quantities are small, i.e. of the order of β2 n = ˜O(1/n) above. This is particularly useful since the balls we have to deal with are those containing approximately k points, and hence of (small) mass approximately k/n. A direct result of the above lemma is the following lemma of [26]. This next lemma essentially reworks Lemma 1 above into a form we can use more directly. We re-use Cδ,n below throughout the analysis. Lemma 2 ([26]). Pick 0 < δ < 1. Let Cδ,n ≜16 log(2/δ)√d log n. Assume k ≥d log n. With probability at least 1 −δ, for every ball B ⊂Rd we have, F(B) ≥Cδ,n √d log n n =⇒Fn(B) > 0, F(B) ≥k n + Cδ,n √ k n =⇒Fn(B) ≥k n, and F(B) ≤k n −Cδ,n √ k n =⇒Fn(B) < k n. The main idea in bounding fk(x) is to bound the random term rk(x) in terms of f(x) using Lemma 2 above. We can deduce from the lemma that if a ball B(x, r) centered has mass roughly k/n, then its empirical mass is likely to be of the order k/n; hence rk(x) is likely to be close to the radius r of B(x, r). Now if f does not vary too much in B(x, r), then we can express the mass of B(x, r) in terms of f(x), and thus get our desired bound on rk(x) and fk(x) in terms of f(x). Our results are given in terms of how f varies in a neighborhood of x, captured as follows. Definition 2. For x ∈Rd and ϵ > 0, define ˆr(ϵ, x) ≜sup n r : sup∥x−x′∥≤r f(x′) −f(x) ≤ϵ o , and ˇr(ϵ, x) ≜sup n r : sup∥x−x′∥≤r f(x) −f(x′) ≤ϵ o . The continuity parameters ˆr(ϵ, x) and ˇr(ϵ, x) (related to the modulus of continuity of f at x) are easily bounded under smoothness assumptions on f at x. Our high-probability bounds on the estimates fk(x) in terms of f(x) and the continuity parameters are given as follows. Lemma 3 (Upper-bound on fk). Suppose k ≥4C2 δ,n. Then, with probability at least 1 −δ, for all x ∈Rd and all ϵ > 0, fk(x) <  1 + 2Cδ,n √ k  (f(x) + ϵ) , provided k satisfies vd · ˆr(ϵ, x)d · (f(x) + ϵ) ≥k n −Cδ,n √ k n . 4 Lemma 4 (Lower-bound on fk). Then, with probability at least 1 −δ, for all x ∈Rd and all ϵ > 0, fk(x) ≥  1 −Cδ,n √ k  (f(x) −ϵ) , provided k satisfies vd · ˇr(ϵ, x)d · (f(x) −ϵ) ≥k n + Cδ,n √ k n . The proof of these results are concise applications of Lemma 2 above. They are given in the appendix (long version). The trick is in showing that, under the conditions on k, there exists an r ≈(k/(n · f(x)))1/d which is at most ˆr(ϵ, x) or ˇr(ϵ, x) as appropriate; hence, f does not vary much on B(x, r) so we must have F (B(x, r)) ≈volume (B(x, r)) · f(x) = vd · rd · f(x) ≈k n. Using Lemma 2 we get rk(x) ≈r; plug this value into fk(x) to obtain fk(x) ≈(1 + 1/ √ k)f(x). Lemmas 3 and 4 allow a great deal of flexibility as we will soon see with their application to mode estimation. In particular we can consider various smoothness conditions simultaneously at different x for different biases ϵ. Suppose for instance that f is locally H¨older at x, i.e. ∃r, L, β > 0 s.t. for all x′ ∈ B(x, r), |f(x) −f(x′)| ≤L ∥x −x′∥β. Then for small ϵ, both ˆr(ϵ, x) and ˇr(ϵ, x) are at least (ϵ/L)1/β; pick ϵ = O(f(x)/ √ k) for n sufficiently large, then by both lemmas we have, w.h.p., |fk(x) −f(x)| ≤O(f(x)/ √ k) provided k = Ω(log2 n) and satisfies vd(1/L √ k)d/βf(x) ≥Ck/n for some constant C. This allows for a setting of k = Θ n2β/(2β+d) for a minimax-optimal rate of |fk(x) −f(x)| = O n−β/(2β+d . The ability to consider various biases ϵ would prove particularly helpful in the next section on mode estimation where we have to consider different approximations in different parts of space with varying smoothness in f. In particular, at a mode x, we will essentially have β = 2 (f is twice differentiable) while elsewhere on X we might not have much smoothness in f. 5 Mode estimation We start with the following definition of modes. Definition 3. We denote the set of modes of f by M ≡{x : ∃r > 0, ∀x′ ∈B(x, r), f(x′) < f(x)} . We need the following assumption at modes. Assumption 1. f is twice differentiable in a neighborhood of every x ∈M. We denote the gradient and Hessian of f by ∇f and ∇2f. Furthermore, ∇2f(x) is negative definite at all x ∈M. Assumption 1 excludes modes at the boundary of the support of f (where f cannot be continuously differentiable). We note that most work on the subject consider only interior modes as we are doing here. Modes on the boundary can however be handled under additional boundary smoothness assumptions to ensure that f puts sufficient mass on any ball around such modes. This however only complicates the analysis, while the main insights remain the same as for interior modes. An implication of Assumption 1 is that for all x ∈M, ∇f is continuous in a neighborhood of x, with ∇f(x) = 0. Together with ∇2f(x) ≺0 (i.e. negative definite), f is well-approximated by a quadratic in a neighborhood of a mode x ∈M. This is stated in the following lemma. Lemma 5. Let f satisfy Assumption 1. Consider any x ∈M. Then there exists a neighborhood B(x, r), r > 0, and constants ˆCx, ˇCx > 0 such that, for all x′ ∈B(x, r), we have ˇCx ∥x′ −x∥2 ≤f(x) −f(x′) ≤ˆCx ∥x′ −x∥2 . (1) We can therefore parametrize a mode x ∈M locally as follows: Definition 4 (Critical radius rx around mode x). For every mode x ∈M, there exists rx > 0, such that B(x, rx) is contained in a set Ax, satisfying the following conditions: (i) Ax is a connected component of a level set X λ ≜{x′ ∈X : f(x′) > λ} for some λ > 0. (ii) ∃ˆCx, ˇCx > 0, ∀x′ ∈Ax, ˇCx ∥x′ −x∥2 ≤f(x) −f(x′) ≤ˆCx ∥x′ −x∥2. (So Ax ∩M = {x}.) 5 Return arg maxx∈X[n] fk(x). Figure 1: Estimate the mode of a unimodal density f from X[n]. Figure 2: The analysis argues over different regions (depicted) around a mode x. Finally, we assume that every hill in f corresponds to a mode in M: Assumption 2. Each connected component of any level set X λ, λ > 0, contains a mode in M. 5.1 Single mode We start with the simple but common assumption that |M| = 1. This case has been extensively studied to get a handle on the inherent difficulty of mode estimation. The usual procedures in the statistical literature are known to be minimax-optimal but are not practical: they invariably return the maximizer of some density estimator (usually a kernel estimate) over the entire space Rd. Instead we analyze the practical procedure of Figure 1 where we pick the maximizer of fk out of the finite sample X[n]. The rates of Theorem 1 are optimal (O(n−1/(4+d))) for a setting of k = O(n4/(4+d)). Theorem 1. Let δ > 0. Assume f has a single mode x0 and satisfies Assumptions 1, 2. There exists Nx0,δ such that the following holds for n ≥Nx0,δ. Let ˆCx0, ˇCx0 be as in Definition 4. Suppose k satisfies 24Cδ,nf(x0) ˇCx0r2x0 !2 ≤k ≤ 1 2 s Cδ,n ˆCx0 !4d/(4+d) f(x0)(2d+4)/(4+d) vd 4 n 4/(4+d) . (2) Let x be the mode returned in the procedure of Figure 1. With probability at least 1 −2δ we have ∥x −x0∥≤5 s Cδ,n ˇCx0 f(x0) · 1 k1/4 . Proof. Let rx0 be the critical radius of Definition 4. Let rn(x0) ≡inf  r : B(x0, r) ∩X[n] ̸= ∅ . Let 0 < τ < 1 to be later specified, and assume the event that rn(x0) ≤τ 2rx0. We will bound the probability of this event once the proper setting of τ becomes clear. Consider ˜r satisfying rx0 ≥˜r ≥2rn(x0)/τ (see Figure 2). We will first upper bound fk for any x outside B(x0, ˜r), then lower-bound fk for x ∈B(x0, rn(x0)). Recall Ax0 from Definition 4. By equation (1) we have sup x∈Ax0\B(x0,˜r/2) f(x) ≤f(x0) −ˇCx0(˜r/2)2 ≜ˆF. (3) The above allows us to apply Lemma 3 as follows. First note that for any x ∈X\B(x0, ˜r/2), f(x) ≤ ˆF since Ax0 is a level set of the unimodal f, i.e. supx/∈Ax0 f(x) ≤infx∈Ax0 f(x). Therefore, for any x ∈X \ B(x0, ˜r) let ϵ .= ˆF −f(x). By equation (3) the modulus of continuity ˆr(ϵ, x) is at least 6 Initialize: Mn ←∅. For λ = maxx∈X[n] fn(x) down to 0: • Let ϵλ ≜λ · Cδ,n/ √ k. • Let n ˜Ai om i=1 be the CCs of G (λ −ϵλ −˜ϵ) disjoint from Mn. • Mn ←Mn ∪ n xi ≜arg maxx∈˜ Ai∩Xλ [n] fn(x) om i=1. Return the estimated modes Mn. Figure 3: Estimate the modes of a multimodal f from X[n]. The parameter ˜ϵ serves to prune. ˜r/2. Therefore, if k satisfies vd · (˜r/2)d · f(x0) −ˇCx0(˜r/2)2 ≥k n −Cδ,n √ k n , (4) we have with probability at least 1 −δ sup x∈X\B(x0,˜r) fk(x) <  1 + 2Cδ,n √ k  f(x0) −ˇCx0(˜r/2)2 . (5) Now we turn to x ∈B(x0, rn(x0)). We have again by equation (1) that infx∈B(x,τ ˜r) f(x) ≥ f(x0) −ˆCx0(τ ˜r)2 ≜ˇF. Therefore, for x ∈B(x0, rn(x0)) let ϵ = f(x) −ˇF, we have ˇr(ϵ, x) ≥ τ ˜r −rn(x0) ≥τ ˜r/2. It follows that, if k satisfies vd · ((τ/2)˜r)d ·  f(x0) −ˆCx0(τ ˜r)2 ≥k n + Cδ,n √ k n , (6) we have by Lemma 4 that, with probability at least 1 −δ (under the same event used in Lemma 3) inf x∈B(x,rn(x0)) fk(x) ≥  1 −Cδ,n √ k   f(x0) −ˆCx0(τ ˜r)2 . (7) Next, with a bit of algebra, we can pick τ and ˜r so that the l.h.s. of (5) is less than the l.h.s. of equation (7). It suffices to pick τ 2 = ˇCx0/8 ˆCx0 and ˜r2 ≥24f(x0)Cδ,n/ ˇCx0 √ k. Given these settings, equations (4) and (6) are satisfied whenever k satisfies equation (2) of the lemma statement. It follows that, with probability at least 1 −δ, infx∈B(x,rn(x0)) fk(x) > supx∈X\B(x0,˜r) fk(x). Therefore, the empirical mode chosen by the procedure is in B(x0, ˆr). We are free to choose ˜r as small as max r 24f(x0)Cδ,n/  ˇCx0 √ k  , 2rn(x0)/τ  . We’ve assumed so far the event that rn(x0) ≤ τ 2rx0. We bound the probability of this event as follows. Let r ≜ q 24f(x0)Cδ,n/ ˇCx0 √ k. Under the above setting of τ, the Theorem’s assumptions on k imply that r ≤rx0, and that vd · ((τ/2)r)d ·  f(x0) −ˆCx0((τ/2)r)2 ≥k n + Cδ,n √ k n . Again, by equation (1), this implies that F(B(x0, (τ/2)r)) ≥k n +Cδ,n √ k n . By Lemma, 2, with probability at least 1 −δ, Fn(B(x0, (τ/2)r)) ≥k/n and therefore rn(x0) ≤(τ/2)r ≤(τ/2)rx0. It now becomes clear that we can just pick ˜r = r. 5.2 Multiple modes In this section we turn to the problem of estimating the modes of a more general density f with an unknown number of modes. The algorithm of Figure 3 operates on the following set of nested graphs G(λ). These are subgraphs of a mutual k-NN graph on the sample X[n], where vertices are connected if they are in each other’s nearest neighbor sets. The connected components (CCs) of these graphs G(λ) are known to be good estimates of the CCs of corresponding level sets of the unknown density f [9, 26, 27]. 7 Definition 5 (k-NN level set G(λ)). Given λ ∈R, let G(λ) denote the graph with vertices in Xλ [n] ≜  x ∈X[n] : fn(x) ≥λ , and where vertices x, x′ are connected by an edge when and only when ∥x −x′∥≤α · min {rk(x), rk(x′)}, for some α ≥ √ 2. We will show that for a given n, any sufficiently salient mode is optimally recovered; furthermore, if f is uniformly continuous on Rd, then the procedure returns no false mode above a level λn →0. 5.2.1 Optimal Recovery for Any Mode The guarantees of this section would be given in terms of salient modes as defined below. Essentially a mode x0 is salient if it is separated from other modes by a sufficiently wide and deep valley. We define saliency in a way similar to [9], but simpler: we only require a wide valley since the smoothness of f at the mode (as expressed in equation 1) takes care of the depth. We start with a notion of separation between sets inspired from [26]. Definition 6 (r-separation). A, A′ ⊂X are r-separated if there exists a (separating) set S ⊂Rd such that: every path from A to A′ crosses S, and supx∈S+B(0,r) f(x) < infx∈A∪A′ f(x). Our notion of mode saliency follows: for a mode x, we require the critical set Ax of Definition 4 to be well separated from all components at the level where it appears. Definition 7 (r-salient Modes). A mode x of f is said to be r-salient for r > 0 if the following holds. There exist Ax as in Definition 4 (with the corresponding rx, ˆCx and ˇCx), which is a CC of say X λx ≜{x ∈X : f(x) ≥λx}. Ax is r-separated from X λx \ Ax. The next theorem again yields the optimal rates O(n−1/(4+d)) for k = O(n4/(4+d)). Theorem 2 (Recovery of salient modes). Assume f satisfies Assumptions 1, 2. Suppose ˜ϵ = ˜ϵ(n) n→∞ −−−−→0. Let x0 be an r-salient mode for some r > 0. Assume k = Ω  C2 δ,n  . Then there exist N = N (x0, {˜ϵ(n)}) depending on x0 and ˜ϵ(n) such that the following holds for n ≥N. Let Ax0, ˆCx0, ˇCx0 be as in Definition 4, and let λx0 ≜infx∈Ax0 f(x). Let δ > 0. Suppose k further satisfies 24Cδ,nf(x0) ˇCx0 min  r2x0/4, (r/α)2 !2 ≤k ≤ 1 2 s Cδ,n ˆCx0 !4d/(4+d) λ(2d+4)/(4+d) x0 vd 4 n 4/(4+d) . Let Mn be the modes returned by the procedure of Figure 3. With probability at least 1 −2δ, there exists x ∈Mn such that ∥x −x0∥≤5 s Cδ,n ˇCx0 f(x0) · 1 k1/4 . 5.2.2 Pruning guarantees The proof of the main theorem of this section is based on Lemma 7.4 of [24]. Theorem 3. Let Λ ≜supx f(x) and r(ϵ) ≜supx∈Rd max {ˆr(ϵ, x), ˇr(ϵ, x)}. Assume f satisfies Assumption 2. Suppose r(˜ϵ) = Ω(k/n)1/d, which is feasible whenever f is uniformly continuous on Rd. In particular, if f is H¨older continuous, i.e. ∀x, x′ ∈Rd, |f(x) −f(x′)| ≤L ∥x −x′∥β , for some L > 0, 0 < β ≤1, then we can just let ˜ϵ = Ω(k/n)β/d since r(˜ϵ) ≥(˜ϵ/L)1/β. Define λ0 = max ( 2˜ϵ, 8Λ k C2 δ,n, k n + Cδ,n √ k n ! 2 vdr(˜ϵ)d ) . Assume k ≥9C2 δ,n. The following holds with probability at least 1 −δ. Pick any λ ≥2λ0, and let λf = infx∈Xλ [n] f(x). All estimated modes in Mn ∩Xλ [n] can be assigned to distinct modes in M ∩X λf . 8 References [1] Don O Loftsgaarden, Charles P Quesenberry, et al. A nonparametric estimate of a multivariate density function. The Annals of Mathematical Statistics, 36(3):1049–1051, 1965. [2] M. Maier, M. Hein, and U. von Luxburg. Optimal construction of k-nearest neighbor graphs for identifying noisy clusters. Theoretical Computer Science, 410:1749–1764, 2009. [3] Emanuel Parzen et al. On estimation of a probability density function and mode. Annals of mathematical statistics, 33(3):1065–1076, 1962. [4] Yizong Cheng. Mean shift, mode seeking, and clustering. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 17(8):790–799, 1995. [5] Fr´ed´eric Chazal, Leonidas J Guibas, Steve Y Oudot, and Primoz Skraba. Persistence-based clustering in riemannian manifolds. Journal of the ACM (JACM), 60(6):41, 2013. [6] David S Moore and James W Yackel. Large sample properties of nearest neighbor density function estimators. Technical report, DTIC Document, 1976. [7] L.P. Devroye and T.J. Wagner. The strong uniform consistency of nearest neighbor density estimates. The Annals of Statistics, 5:536–540, 1977. [8] G´erard Biau, Fr´ed´eric Chazal, David Cohen-Steiner, Luc Devroye, Carlos Rodriguez, et al. A weighted k-nearest neighbor density estimate for geometric inference. Electronic Journal of Statistics, 5:204–237, 2011. [9] S. Kpotufe and U. von Luxburg. Pruning nearest neighbor cluster trees. In International Conference on Machine Learning, 2011. [10] Herman Chernoff. Estimation of the mode. Annals of the Institute of Statistical Mathematics, 16(1):31– 41, 1964. [11] William F Eddy et al. Optimum kernel estimators of the mode. The Annals of Statistics, 8(4):870–882, 1980. [12] Birgit Grund, Peter Hall, et al. On the minimisation of lp error in mode estimation. The Annals of Statistics, 23(6):2264–2284, 1995. [13] Jussi Klemel¨a. Adaptive estimation of the mode of a multivariate density. Journal of Nonparametric Statistics, 17(1):83–105, 2005. [14] Aleksandr Borisovich Tsybakov. Recursive estimation of the mode of a multivariate distribution. Problemy Peredachi Informatsii, 26(1):38–45, 1990. [15] David L Donoho and Richard C Liu. Geometrizing rates of convergence, iii. The Annals of Statistics, pages 668–701, 1991. [16] Luc Devroye. Recursive estimation of the mode of a multivariate density. Canadian Journal of Statistics, 7(2):159–167, 1979. [17] Ulf Grenander et al. Some direct estimates of the mode. The Annals of Mathematical Statistics, 36(1):131– 138, 1965. [18] Christophe Abraham, G´erard Biau, and Benoˆıt Cadre. On the asymptotic properties of a simple estimate of the mode. ESAIM: Probability and Statistics, 8:1–11, 2004. [19] Keinosuke Fukunaga and Larry Hostetler. The estimation of the gradient of a density function, with applications in pattern recognition. Information Theory, IEEE Transactions on, 21(1):32–40, 1975. [20] Dorin Comaniciu and Peter Meer. Mean shift: A robust approach toward feature space analysis. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 24(5):603–619, 2002. [21] Jia Li, Surajit Ray, and Bruce G Lindsay. A nonparametric statistical approach to clustering via mode identification. Journal of Machine Learning Research, 8(8), 2007. [22] Ery Arias-Castro, David Mason, and Bruno Pelletier. On the estimation of the gradient lines of a density and the consistency of the mean-shift algorithm. Unpublished Manuscript, 2013. [23] Christopher Genovese, Marco Perone-Pacifico, Isabella Verdinelli, and Larry Wasserman. Nonparametric inference for density modes. arXiv preprint arXiv:1312.7567, 2013. [24] K. Chaudhuri, S. Dasgupta, S. Kpotufe, and U. von Luxburg. Consistent procedures for cluster tree estimation and pruning. Arxiv, 2014. [25] O. Bousquet, S. Boucheron, and G. Lugosi. Introduction to statistical learning theory. Lecture Notes in Artificial Intelligence, 3176:169–207, 2004. [26] K. Chaudhuri and S. Dasgupta. Rates for convergence for the cluster tree. In Advances in Neural Information Processing Systems, 2010. [27] S. Balakrishnan, S. Narayanan, A. Rinaldo, A. Singh, and L. Wasserman. Cluster trees on manifolds. In Advances in Neural Information Processing Systems, pages 2679–2687, 2013. 9
2014
308
5,412
Coresets for k-Segmentation of Streaming Data Guy Rosman ∗† CSAIL, MIT 32 Vassar St., 02139, Cambridge, MA USA rosman@csail.mit.edu Mikhail Volkov † CSAIL, MIT 32 Vassar St., 02139, Cambridge, MA USA mikhail@csail.mit.edu Danny Feldman † CSAIL, MIT 32 Vassar St., 02139, Cambridge, MA USA dannyf@csail.mit.edu John W. Fisher III CSAIL, MIT 32 Vassar St., 02139, Cambridge, MA USA fisher@csail.mit.edu Daniela Rus † CSAIL, MIT 32 Vassar St., 02139, Cambridge, MA USA rus@csail.mit.edu Abstract Life-logging video streams, financial time series, and Twitter tweets are a few examples of high-dimensional signals over practically unbounded time. We consider the problem of computing optimal segmentation of such signals by a k-piecewise linear function, using only one pass over the data by maintaining a coreset for the signal. The coreset enables fast further analysis such as automatic summarization and analysis of such signals. A coreset (core-set) is a compact representation of the data seen so far, which approximates the data well for a specific task – in our case, segmentation of the stream. We show that, perhaps surprisingly, the segmentation problem admits coresets of cardinality only linear in the number of segments k, independently of both the dimension d of the signal, and its number n of points. More precisely, we construct a representation of size O(k log n/ε2) that provides a (1+ε)approximation for the sum of squared distances to any given k-piecewise linear function. Moreover, such coresets can be constructed in a parallel streaming approach. Our results rely on a novel reduction of statistical estimations to problems in computational geometry. We empirically evaluate our algorithms on very large synthetic and real data sets from GPS, video and financial domains, using 255 machines in Amazon cloud. 1 Introduction There is an increasing demand for systems that learn long-term, high-dimensional data streams. Examples include video streams from wearable cameras, mobile sensors, GPS, financial data and biological signals. In each, a time instance is represented as a high-dimensional feature, for example location vectors, stock prices, or image content feature histograms. We develop real-time algorithms for summarization and segmentation of large streams, by compressing the signals into a compact meaningful representation. This representation can then be used to enable fast analyses such as summarization, state estimation and prediction. The proposed algorithms support data streams that are too large to store in memory, afford easy parallelization, and are generic in that they apply to different data types and analyses. For example, the summarization of wearable video data can be used to efficiently detect different scenes and important events, while collecting GPS data for citywide drivers can be used to learn weekly transportation patterns and characterize driver behavior. ∗Guy Rosman was partially supported by MIT-Technion fellowship †Support for this research has been provided by Hon Hai/Foxconn Technology Group and MIT Lincoln Laboratory. The authors are grateful for this support. 1 In this paper we use a data reduction technique called coresets [1, 9] to enable rapid contentbased segmentation of data streams. Informally, a coreset D is problem dependent compression of the original data P, such that running algorithm A on the coreset D yields a result A(D) that provably approximates the result A(P) of running the algorithm on the original data. If the coreset D is small and its construction is fast, then computing A(D) is fast even if computing the result A(P) on the original data is intractable. See definition 2 for the specific coreset which we develop in this paper. 1.1 Main Contribution The main contributions of the paper are: (i) A new coreset for the k-segmentation problem (as given in Subsection 1.2) that can be computed at one pass over streaming data (with O(log n) insertion time/space) and supports distributed computation. Unlike previous results, the insertion time per new observation and required memory is only linear in both the dimension of the data, and the number k of segments. This result is summarized in Theorem 4, and proven in the supplementary material. Our algorithm is scalable, parallelizable, and provides a provable approximation of the cost function. (ii) Using this novel coreset we demonstrate a new system for segmentation and compression of streaming data. Our approach allows realtime summarization of large-scale video streams in a way that preserves the semantic content of the aggregated video sequences, and is easily extendable. (iii) Experiments to demonstrate our approach on various data types: video, GPS, and financial data. We evaluate performance with respect to output size, running time and quality and compare our coresets to uniform and random sample compression. We demonstrate the scalability of our algorithm by running our system on an Amazon cluster with 255 machines with near-perfect parallelism as demonstrated on 256, 000 frames. We also demonstrate the effectiveness of our algorithm by running several analysis algorithms on the computed coreset instead of the full data. Our implementation summarizes the video in less than 20 minutes, and allows real-time segmentation of video streams at 30 frames per second on a single machine. Streaming and Parallel computations. Maybe the most important property of coresets is that even an efficient off-line construction implies a fast construction that can be computed (a) Embarrassingly in parallel (e.g. cloud and GPUs), (b) in the streaming model where the algorithm passes only once over the (possibly unbounded) streaming data. Only small amount of memory and update time (∼log n) per new point insertion is allowed, where n is the number of observations so far. 1.2 Problem Statement The k-segment mean problem optimally fits a given discrete time signal of n points by a set of k linear segments over time, where k ≥1 is a given integer. That is, we wish to partition the signal into k consecutive time intervals such that the points in each time interval are lying on a single line; see Fig. 1(left) and the following formal definition. We make the following assumptions with respect to the data: (a) We assume the data is represented by a feature space that suitably represents its underlying structure; (b) The content of the data includes at most k segments that we wish to detect automatically; An example for this are scenes in a video, phases in the market as seen by stock behaviour, etc. and (c) The dimensionality of the feature space is often quite large (from tens to thousands of features), with the specific choice of the features being application dependent – several examples are given in Section 3. This motivates the following problem definition. Definition 1 (k-segment mean). A set P in Rd+1 is a signal if P = {(1, p1), (2, p2), · · · , (n, pn)} where pi ∈Rd is the point at time index i for every i = [n] = {1, · · · , n}. For an integer k ≥1, a k-segment is a k-piecewise linear function f : R →Rd that maps every time i ∈R to a point f(i) in Rd. The fitting error at time t is the squared distance between pi and its corresponding projected point f(i) on the k-segments. The fitting cost of f to P is the sum of these squared distances, cost(P, f) = n X i=1 ∥pi −f(i)∥2 2, (1) where ∥· ∥denotes the Euclidean distance. The function f is a k-segment mean of P if it minimizes cost(P, f). For the case k = 1 the 1-segment mean is the solution to the linear regression problem. If we restrict each of the k-segments to be a horizontal segment, then each segment will be the mean height of the corresponding input points. The resulting problem is similar to the k-mean problem, except 2 Figure 1: For every k-segment f, the cost of input points (red) is approximated by the cost of the coreset (dashed blue lines). Left: An input signal and a 3-segment f (green), along with the regression distance to one point (dashed black vertical lines). The cost of f is the sum of these squared distances from all the input points. Right: The coreset consists of the projection of the input onto few segments, with approximate per-segment representation of the data. each of the voronoi cells is forced to be a single region in time, instead of nearest center assignment, i.e. the regions are contiguous. In this paper we are interested in seeking a compact representation D that approximates cost(P, f) for every k-segment f using the above definition of cost′(D, f). We denote a set D as a (k, ε)coreset according to the following definition, Definition 2 ((k, ε)-coreset). Let P ⊆Rd+1, k ≥1 be an integer, for some small ε > 0. A set D, with a cost function cost′(·) is a (k, ε)-coreset for P if for every k-segment f we have (1 −ε)cost(P, f) ≤cost′(D, f) ≤(1 + ε)cost(P, f). We present a new coreset construction with provable approximations for a family of natural ksegmentation optimization problems. This is the first such construction whose running time is linear in both the number of data points n, their dimensionality d, and the number k of desired segments. The resulting coreset consists of O(dk/ε2) points that approximates the sum of square distances for any k-piecewise linear function (k segments over time). In particular, we can use this coreset to compute the k-piecewise linear function that minimize the sum of squared distances to the input points, given arbitrary constraints or weights (priors) on the desired segmentation. Such a generalization is useful, for example, when we are already given a set of candidate segments (e.g. maps or distribution of images) and wish to choose the right k segments that approximate the input signal. Previous results on coresets for k-segmentation achieved running time or coreset size that are at least quadratic in d and cubic in k [12, 11]. As such, they can be used with very large data, for example to long streaming video data which is usually high-dimensional and contains large number of scenes. This prior work is based on some non-uniform sampling of the input data. In order to achieve our results, we had to replace the sampling approach by a new set of deterministic algorithms that carefully select the coreset points. 1.3 Related Work Our work builds on several important contributions in coresets, k-segmentations, and video summarization. Approximation Algorithms. One of the main challenges in providing provable guarantees for segmentation w.r.t segmentation size and quality is global optimization. Current provable algorithms for data segmentation are cubic-time in the number of desired segments, quadratic in the dimension of the signal, and cannot handle both parallel and streaming computation as desired for big data. The closest work that provides provable approximations is that of [12]. Several works attempt to summarize high-dimensional data streams in various application domains. For example, [19] describe the video stream as a high-dimensional stream and run approximated clustering algorithms such as k-center on the points of the stream; see [14] for surveys on stream summarization in robotics. The resulting k-centers of the clusters comprise the video summarization. The main disadvantages of these techniques are (i) They partition the data stream into k clusters that do not provide k-segmentation over time. (ii) Computing the k-center takes time exponential in both d and k [16]. In [19] heuristics were used for dimension reduction, and in [14] a 2-approximation was suggested for the off-line case, which was replaced by a heuristic forstreaming. (iii) In the context of analysis of video streams, they use a feature space that is often simplistic and does not utilize the large data available effciently. In our work the feature space can be updated on-line using a coreset for k-means clustering of the features seen so far. k-segment Mean. The k-segment mean problem can be solved exactly using dynamic programming [4]. However, this takes O(dn2k) time and O(dn2) memory, which is impractical for streaming data. In [15, Theorem 8] a (1 + ε)-approximation was suggested using O(n(dk)4 log n/ε) time. While 3 the algorithm in [15] support efficient streaming, it is not parallel. Since it returns a k-segmentation and not a coreset, it cannot be used to solve other optimization problems with additional priors or constraints. In [12] an improved algorithm that takes O(nd2k + ndk3) time was suggested. The algorithm is based on a coreset of size O(dk3/ε3). Unlike the coreset in this paper, the running time of [12] is cubic in both d and k. The result in [12] is the last in a line of research for the k-segment mean problem and its variations; see survey in [11, 15, 13]. The application was segmentation of 3-dimensional GPS signal (time, latitude, longitude). The coreset construction in [12] and previous papers takes time and memory that is quadratic in the dimension d and cubic in the number of segments k. Conversely, our coreset construction takes time only linear in both k and d. While recent results suggest running time linear in n, and space that is near-logarithmic in n, the computation time is still cubic in k, the number of segments, and quadratic in d, the dimension. Since the number k represents the number of scenes, and d is the feature dimensionality, this complexity is prohibitive. Video Summarization One motivating application for us is online video summarization, where input video stream can be represented by a set of points over time in an appropriate feature space. Every point in the feature space represents the frame, and we aim to produce a compact approximation of the video in terms of this space and its Euclidean norm. Application-aware summarization and analysis of ad-hoc video streams is a difficult task with many attempts aimed at tackling it from various perspectives [5, 18, 2]. The problem is highly related to video action classification, scene classification, and object segmentation [18]. Applications where life-long video stream analysis is crucial include mapping and navigation medical / assistive interaction, and augmented-reality applications, among others. Our goal differs from video compression in that compression is geared towards preserving image quality for all frames, and therefore stores semantically redundant content. Instead, we seek a summarization approach that allows us to represent the video content by a set of key segments, for a given feature space. This paper is organized as follows. We begin by describing the k-segmentation problem and the proposed coresets, and describe their construction, and their properties in Section 2. We perform several experiments in order to validate the proposed approach on data collected from GPS and werable web-cameras, and demonstrate the aggregation and analysis of multiple long sequences of wearable user video in Section 3. Section 4 concludes the paper and discusses future directions. 2 A Novel Coreset for k-segment Mean The key insights for constructing the k-segment coreset are: i) We observe that for the case k = 1, a 1-segment coreset can be easily obtained using SVD. ii) For the general case, k ≥2 we can partition the signal into a suitable number of intervals, and compute a 1-segment coreset for each such interval. If the number of intervals and their lengths are carefully chosen, most of them will be well approximated by every k-segmentation, and the remaining intervals will not incur a large error contribution. Based on these observations, we propose the following construction. 1) Estimate the signal’s complexity, i.e., the approximated fitting cost to its k-segment mean. We denote this step as a call to the algorithm BICRITERIA. 2) Given an complexity measure for the data, approximate the data by a set of segments with auxiliary information, which is the proposed coreset, denoted as the output of algorithm BALANCEDPARTITION. We then prove that the resulting coreset allows us to approximate with guarantees the fitting cost for any k-segmentation over the data, as well as compute an optimal k-segmentation. We state the main result in Theorem 4, and describe the proposed algorithms as Algorithms 1 and 2. We refer the reader to the supplementary material for further details and proofs. 2.1 Computing a k-Segment Coreset We would like to compute a (k, ε)-coreset for our data. A (k, ε)-coreset D for a set P approximates the fitting cost of any query k-segment to P up to a small multiplicative error of 1 ± ε. We note that a (1, 0)-coreset can be computed using SVD; See the supplementary material for details and proof. However, for k > 2, we cannot approximate the data by a representative point set (we prove this in the supplementary material). Instead, we define a data structure D as our proposed coreset, and define a new cost function cost′(D, f) that approximates the cost of P to any k-segment f. The set D consists of tuples of the type (C, g, b, e). Each tuple corresponds to a different time interval [b, e] in R and represents the set P(b, e) of points in this interval. g is the 1-segment mean of the data P in the interval [b, e]. The set C is a (1, ε)-coreset for P(b, e). 4 We note the following: 1) If all the points of the k-segment f are on the same segment in this time interval, i.e, {f(t) | b ≤t ≤e} is a linear segment, then the cost from P(b, e) to f can be approximated well by C, up to (1 + ε) multiplicative error. 2) If we project the points of P(b, e) on their 1-segment mean g, then the projected set L of points will approximate well the cost of P(b, e) to f, even if f corresponds to more than one segment in the time interval [b, e]. Unlike the previous case, the error here is additive. 3) Since f is a k-segment there will be at most k −1 time intervals that will intersect more than two segments of f, so the overall additive error is small . This motivates the following definition of D and cost′. Definition 3 (cost′(D, f)). Let D = {(Ci, gi, bi, ei)}m i=1 where for every i ∈[m] we have Ci ⊆Rd+1, gi : R →Rd and bi ≤ei ∈R. For a k-segment f : R →Rd and i ∈[m] we say that Ci is served by one segment of f if {f(t) | bi ≤t ≤ei} is a linear segment. We denote by Good(D, f) ⊆[m] the union of indexes i such that Ci is served by one segment of f. We also define Li = {gi(t) | bi ≤t ≤ei}, the projection of Ci on gi. We define cost′(D, f) as P i∈Good(D,f) cost(Ci, f) + P i∈[m]\Good(D,f) cost(Li, f). Our coreset construction for general k > 1 is based on an input parameter σ > 0 such that for an appropriate σ the output is a (k, ε)-coreset. σ characterizes the complexity of the approximation. The BICRITERIA algorithm, given as Algorithm 1, provides us with such an approximation. Properties of this algorithms are described in the supplementary material. Theorem 4. Let P = {(1, p1), · · · , (n, pn)} such that pi ∈Rd for every i ∈[n]. Let D be the output of a call to BALANCEDPARTITION(P, ε, σ), and let f be the output of BICRITERIA(P, k); Let σ = cost(f). Then D is a (k, ε)-coreset for P of size |D| = O(k) · log n/ε2 , and can be computed in O(dn/ε4) time. Proof. We give a sketch of the proof, also given in Theorem 10 in the supplementary material, and accompanying theorems. Lemma 8 states that given an estimate σ of the optimal segmentation cost, BALANCEDPARTITION(P, ε, σ) provides a (k, ε)-coreset of the data P. This hinges on the observation that given a fine enough segmentation of the time domain, for each segment we can approximate the data by an SVD with bounded error. This approximation is exact for 1−segments (See claim 2 in the supplementary material), and can be bounded for a k-segments because of the number of segment intersections. According to Theorem 9 of the supplementary material, σ as computed by BICRITERIA(P, k) provides such an approximation. Algorithm 1: BICRITERIA(P, k) Input: A set P ⊆Rd+1 and an integer k ≥1 Output: A bicriteria (O(log n), O(log n))-approximation to the k-segment mean of P. 1 if n ≤2k + 1 then 2 f := a 1-segment mean of P; 3 return f; 4 Set t1 ≤· · · ≤tn and p1, · · · , pn ∈Rd such that P = {(t1, p1), · · · , (tn, pn)} 5 m ←{t ∈R | (t, p) ∈P} 6 Partition P into 4k sets P1, · · · , P2k ⊆P such that for every i ∈[2k −1]: (i) | {t | (t, p) ∈Pi} | = j m 4k k , and (ii) if (t, p) ∈Pi and (t′, p′) ∈Pi+1 then t < t′. ; 7 for i := 1 to 4k do 8 Compute a 2-approximation gi to the 1-segment mean of Pi 9 Q := the union of k + 1 signals Pi with the smallest value cost(Pi, gi) among i ∈[2k]. 10 h := BICRITERIA(P \ Q, k); Repartition the segments that do not have a good approx. 11 Set f(t) := gi(t) ∃(t, p) ∈Pi such that Pi ⊆Q h(t) otherwise . ; 12 return f; 5 Algorithm 2: BALANCEDPARTITION(P, ε, σ) Input: A set P = {(1, p1), · · · , (n, pn)} in Rd+1 an error parameters ε ∈(0, 1/10) and σ > 0. Output: A set D that satisfies Theorem 4. 1 Q := ∅; D = ∅; pn+1:= an arbitrary point in Rd ; 2 for i := 1 to n + 1 do 3 Q := Q ∪{(i, pi)}; Add new point to tuple 4 f ∗:= a linear approximation of Q; λ := cost(Q, f ∗) 5 if λ > σ or i = n + 1 then 6 T := Q \ {(i, pi)} ; take all the new points into tuple 7 C := a (1, ε/4)-coreset for T; Approximate points by a local representation 8 g := a linear approximation of T, b := i −|T|, e := i −1; save endpoints 9 D := D ∪{(C, g, b, e)} ; save a tuple 10 Q := {(i, pi)} ; proceed to new point 11 return D For efficient k-segmentation we run a k-segment mean algorithm on our small coreset instead of the original large input. Since the coreset is small we can apply dynamic programming (as in [4]) in an efficient manner. In order to compute an (1 + ε) approximation to the k-segment mean of the original signal P, it suffices to compute a (1 + ε) approximation to the k-segment mean of the coreset, where cost is replaced by cost′. However, since D is not a simple signal, but a more involved data structure, it is not clear how to run existing algorithms on D. In the supplementary material we show how to apply such algorithms on our coresets. In particular, we can run naive dynamic programming [4] on the coreset and get a (1 + ε) approximate solution in an efficient manner, as we summarize as follows. Theorem 5. Let P be a d-dimensional signal. A (1 + ε) approximation to the k-segment mean of P can be computed in O (ndk/ε + d(klog(n)/ε)O(1))) time . 2.2 Parallel and Streaming Implementation One major advantage of coresets is that they can be constructed in parallel as well as in a streaming setting. The main observation is that the union of coresets is a coreset — if a data set is split into subsets, and we compute a coreset for every subset, then the union of the coresets is a coreset of the whole data set. This allows us to have each machine separately compute a coreset for a part of the data, with a central node which approximately solves the optimization problem; see [10, Theorem 10.1] for more details and a formal proof. As we show in the supplementary material, this allows us to use coresets in the streaming and parallel model. 3 Experimental Results We now demonstrate the results of our algorithm on four data types of varying length and dimensionality. We compare our algorithms against several other segmentation algorithms. We also show that the coreset effectively improves the performance of several segmentation algorithms by running the algorithms on our coreset instead of the full data. 3.1 Segmentation of Large Datasets We first examine the behavior of the algorithm on synthetic data which provides us with easy groundtruth, to evaluate the quality of the approximation, as well as the efficiency, and the scalability of the coreset algorithms. We generate synthetic test data by drawing a discrete k-segment P with k = 20, and then add Gaussian and salt-and-pepper noise. We then benchmark the computed (k, ε)coreset D by comparing it against piecewise linear approximations with (1) a uniformly sampled subset of control points U and (2) a randomly placed control points R. For a fair comparison between the (k, ε)-coreset D and the corresponding approximations U, R we allow the same number of coefficients for each approximation. Coresets are evaluated by computing the fitting cost to a query k-segment Q that is constructed based on the a-priori parameters used to generate P. 6 (a) Coreset size vs coreset error (b) (k, ε)-coreset size vs CPU time (c) Coreset dim. vs coreset error Figure 2: Figure 2a shows the coreset error (ε) decreasing as a function of coreset size. The dotted black line indicates the point at which the coreset size is equal to the input size. Figure 2b shows the coreset construction time in minutes as a function of coreset size. Trendlines show the linear increase in construction time with coreset size. Figure 2c shows the reduction in coreset error as a function of the dimensionality of the 1-segment coreset, for fixed input size (dimensionality can often be reduced down to R2. Figure 3: Segmentation from Google Glass. Black vertical lines present segment boundaries, overlayed on top of the bags of word representation. Icon images are taken from the middle of each segment. Approximation Power: Figure 2a shows the aggregated fitting cost error for 1500 experiments on synthetic data. We varied the assumed k′ segment complexity. In the plot we show how well a given k′ performed as a guess for the true value of k. As Figure 2a shows, we significantly outperform the other schemes. As the coreset size approaches the size P the error decreases to zero as expected. Coreset Construction Time: Figure 2b shows the linear relationship between input size and construction time of D for different coreset size. Figure 2c shows how a high dimensionality benefits coreset construction. This is even more apparent in real data which tends to be sparse, so that in practice we are typically able to further reduce the coreset dimension in each segment. Scalability: The coresets presented in this work are parallelizable, as discussed in Section 2.2. We demonstrate scalability by conducting very large scale experiments on both real and synthetic data, running our algorithm on a network of 255 Amazon EC2 vCPU nodes. We compress a 256,000frame bags-of-words (BOW) stream in approximately 20 minutes with almost-perfect scalability. For a comparable single node running on the same data dataset, we estimate a total running time of approximately 42 hours. 3.2 Real Data Experiments We compare our coreset against uniform sample and random sample coresets, as well as two other segmentation techniques: Ramer-Douglas-Peucker (RDP) algorithm [20, 8], and the Dead Reckoning (DR) algorithm [23]. We also show that we can combine our coreset with segmentation algorithms, by running the algorithm on the coresets itself. We emphasize that segmentation techniques were chosen as simple examples and are not intended to reflect the state of the art – but rather to demonstrate how the k-segment coreset can improve on any given algorithm. To demonstrate the general applicability of our techniques, we run our algorithm using financial (1D) time series data, as well as GPS data. For the 1D case we use price data from the Mt.Gox Bitcoin exchange. Bitcoin is of interest because its price has grown exponentially with its popularity in the past two years. Bitcoin has also sustained several well-documented market crashes [3],[6] that we can relate to our analysis. For the 2D case we use GPS data from 343 taxis in San Francisco. This is of interest because a taxi-route segmentation has an intuitive interpretation that we can easily evaluate, and on the other hand GPS data forms an increasingly large information source in which we are interested. 7 Figure 4a shows the results for Bitcoin data. Price extrema are highlighted by local price highs (green) and lows (red). We observe that running the DR algorithm on our k-segment coreset captures these events quite well. Figures 4b,4c show example results for a single taxi. Again, we observe that the DR segmentation produces segments with a meaningful spatial interpretation. Figure 5 shows a plot of coreset errors for the first 50 taxis (right), and the table gives a summary of experimental results for the Bitcoin and GPS experiments. 3.3 Semantic Video Segmentation In addition, we demonstrate use of the proposed coreset for video streams summarization. While different choices of frame representations for video summarization are available [22, 17, 18], we used color-augmented SURF features, quantized into 5000 visual words, trained on the ImageNet 2013 dataset [7]. The resulting histograms are compressed in a streaming coreset. Computation in on a single core runs at 6Hz; A parallel version achieves 30Hz on a single i7 machine, processing 6 hours of video in 4 hours on a single machine, i.e. faster than real-time. In Figure 3 we demonstrate segmentation of a video taken from Google Glass. We visualize BOWs, as well as the segments suggested by the k-segment mean algorithm [4] run on the coreset. Inspecting the results, most segment transitions occur at scene and room changes. Even though optimal segmentation can not be done in real-time, the proposed coreset is computed in real-time and can further be used to automatically summarize the video by associating representative frames with segments. To evaluate the “semantic” quality of our segmentation, we compared the resulting segments to uniform segmentation by contrasting them with a human annotation of the video into scenes. Our method gave a 25% improvement (in Rand index [21]) over a 3000 frames sequence. Apr−2013 Jul−2013 Oct−2013 Jan−2014 −200 0 200 400 600 800 1000 1200 1400 Date Price (USD/BTC) MTGOXUSD MTGOXUSD D1 closing price Dead Reckoning segmentation Local price maxima Local price minima (a) MTGOXUSD daily price data Time Latitude (top), Longitude (bottom) X1: Latitude (top) X2: Longitude (bottom) Dead Reckoning segmentation (b) GPS taxi data 37.6 37.65 37.7 37.75 37.8 37.85 −122.47 −122.46 −122.45 −122.44 −122.43 −122.42 −122.41 −122.4 −122.39 −122.38 −122.37 Latitude (X1) Longitude (X2) (c) GPS taxi data Figure 4: (a) shows the Bitcoin prices from 2013 on, overlayed with a DR segmentation computed on our coreset. The red/green triangles indicate prominent market events. (b) 4c shows normalized GPS data overlayed with a DR segmentation computed on our coreset. (c) shows a lat/long plot (right) demonstrating that the segmentation yields a meaningful spatial interpretation. Average ε Bitcoin data GPS data k-segment coreset 0.0092 0.0014 Uniform sample coreset 1.8726 0.0121 Random sample coreset 8.0110 0.0214 RDP on original data 0.0366 0.0231 RDP on k-segment 0.0335 0.0051 DeadRec on original data 0.0851 0.0417 DeadRec on k-segment 0.0619 0.0385 0 5 10 15 20 25 30 35 40 45 50 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 Taxi ID coreset error k−segment coreset (mean and std) Uniform sample coreset Random sample coreset RDP on points Dead Reckoning on points Figure 5: Table: Summary for Bitcoin / GPS data. Plot: Errors / standard deviations for the first 50 cabs. 4 Conclusions In this paper we demonstrated a new framework for segmentation and event summarization of highdimensional data. We have shown the effectiveness and scalability of the algorithms proposed, and its applicability for large distributed video analysis. In the context of video processing, we demonstrate how using the right framework for analysis and clustering, even relatively straightforward representations of image content lead to a meaningful and reliable segmentation of video streams at real-time speeds. 8 References [1] P. K. Agarwal, S. Har-Peled, and K. R. Varadarajan. Geometric approximations via coresets. Combinatorial and Computational Geometry - MSRI Publications, 52:1–30, 2005. [2] S. Bandla and K. Grauman. Active learning of an action detector from untrimmed videos. In ICCV, 2013. [3] BBC. Bitcoin panic selling halves its value, 2013. [4] R. Bellman. On the approximation of curves by line segments using dynamic programming. Commun. ACM, 4(6):284, 1961. [5] W. Churchill and P. Newman. Continually improving large scale long term visual navigation of a vehicle in dynamic urban environments. In Proc. IEEE Intelligent Transportation Systems Conference (ITSC), Anchorage, USA, September 2012. [6] CNBC. Bitcoin crash spurs race to create new exchanges, April 2013. [7] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In Computer Vision and Pattern Recognition, 2009. [8] D. H. Douglas and T. K. Peucker. Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. Cartographica: The International Journal for Geographic Information and Geovisualization, 10(2):112–122, 1973. [9] D. Feldman and M. Langberg. A unified framework for approximating and clustering data. In STOC, 2010. Manuscript available at arXiv.org. [10] D. Feldman, M. Schmidt, and C. Sohler. Turning big data into tiny data: Constant-size coresets for k-means, PCA and projective clustering. SODA, 2013. [11] D. Feldman, A. Sugaya, and D. Rus. An effective coreset compression algorithm for large scale sensor networks. In IPSN, pages 257–268, 2012. [12] D. Feldman, C. Sung, and D. Rus. The single pixel gps: learning big data signals from tiny coresets. In Proceedings of the 20th International Conference on Advances in Geographic Information Systems, pages 23–32. ACM, 2012. [13] A. C. Gilbert, S. Guha, P. Indyk, Y. Kotidis, S. Muthukrishnan, and M. J. Strauss. Fast, small-space algorithms for approximate histogram maintenance. In STOC, pages 389–398. ACM, 2002. [14] Y. Girdhar and G. Dudek. Efficient on-line data summarization using extremum summaries. In ICRA, pages 3490–3496. IEEE, 2012. [15] S. Guha, N. Koudas, and K. Shim. Approximation and streaming algorithms for histogram construction problems. ACM Transactions on Database Systems (TODS), 31(1):396–438, 2006. [16] D. S. Hochbaum. Approximation algorithms for NP-hard problems. PWS Publishing Co., 1996. [17] Y. Li, D. J. Crandall, and D. P. Huttenlocher. Landmark classification in large-scale image collections. In ICCV, pages 1957–1964, 2009. [18] Z. Lu and K. Grauman. Story-driven summarization for egocentric video. In CVPR, pages 2714–2721, 2013. [19] R. Paul, D. Feldman, D. Rus, and P. Newman. Visual precis generation using coresets. In ICRA. IEEE Press, 2014. accepted. [20] U. Ramer. An iterative procedure for the polygonal approximation of plane curves. Computer Graphics and Image Processing, 1(3):244 – 256, 1972. [21] W. Rand. Objective criteria for the evaluation of clustering methods. Journal of the American Statistical Association, 66(336):846–850, 1971. [22] J. Sivic and A. Zisserman. Video Google: A text retrieval approach to object matching in videos. In ICCV, volume 2, pages 1470–1477, Oct. 2003. [23] G. Trajcevski, H. Cao, P. Scheuermann, O. Wolfson, and D. Vaccaro. On-line data reduction and the quality of history in moving objects databases. In MobiDE, pages 19–26, 2006. 9
2014
309
5,413
Recursive Inversion Models for Permutations Christopher Meek Microsoft Research Redmond, Washington 98052 meek@microsoft.com Marina Meil˘a University of Washington Seattle, Washington 98195 mmp@stat.washington.edu Abstract We develop a new exponential family probabilistic model for permutations that can capture hierarchical structure and that has the Mallows and generalized Mallows models as subclasses. We describe how to do parameter estimation and propose an approach to structure search for this class of models. We provide experimental evidence that this added flexibility both improves predictive performance and enables a deeper understanding of collections of permutations. 1 Introduction Among the many probabilistic models over permutations, models based on penalizing inversions with respect to a reference permutation have proved particularly elegant, intuitive, and useful. Typically these generative models “construct” a permutation in stages by inserting one item at each stage. An example of such models are the Generalized Mallows Models (GMMs) of Fligner and Verducci (1986). In this paper, we propose a superclass of the GMM, which we call the recursive inversion model (RIM), which allows more flexibility than the original GMM, while preserving its elegant and useful properties of compact parametrization, tractable normalization constant, and interpretability of parameters. Essentially, while the GMM constructs a permutation sequentially by a stochastic insertion sort process, the RIM constructs one by a stochastic merge sort. In this sense, the RIM is a compactly parametrized Riffle Independence (RI) model (Huang & Guestrin, 2012) defined in terms of inversions rather than independence. 2 Recursive Inversion Models We are interested in probabilistic models of permutations of a set of elements E = {e1, ..., en}. We use π ∈SE to denote a permutation (a total ordering) of the elements in E, and use ei <π ej to denote that two elements are ordered. We define an n × n (lower diagonal) discrepancy matrix Dij that captures the discrepancies between two permutations. Dij(π, π0) =  1 i <π j ∧j <π0 i 0 otherwise (1) We call the first argument of Dij(·, ·) the test permutation (typically π) and the second argument the reference permutation (typically π0). Two classic models for permutations are the Mallows and the generalized Mallows models. The Mallows model is defined in terms of the inversion distance d(π, π0) = P ij Dij(π, π0) which is the total number of inversions between π and π0 (Mallows, 1957). The Mallows models is then P(π|π0, θ) = 1 Z(θ) exp(−θd(π, π0)), θ ∈R. Note that the normalization constant does not depend on π0 but only on the concentration parameter θ. The Generalized Mallows model (GMM) of Fligner and Verducci (1986) extends the Mallows model by introducing a parameter for each of the elements in E and decomposes the inversion distance into a per element dis1 tance1. In particular, we define vj(π, π0) to be the number of inversions for element j in π with respect to π0 is vj(π, π0) = P i>π0j Dij(π, π0). In this case, the GMM is defined as P(π|π0, θ) = 1 Z(θ) exp(−P e∈E θeve) θ ∈Rn. The GMM can be thought of as a stagewise model in which each of the elements in E are inserted according to the reference permutation π0 into a list where the parameter θe controls how likely the insertion of element e will yield an inversion with respect to the reference permutation. For both of these models the normalization constant can be computed in closed form Our RIMs generalize the GMM by replacing the sequence of single element insertions with a sequence of recursive merges of subsequences where the relative order within the subsequences is preserved. For example, the sequence [a, b, c, d, e] can be obtained by merging the two subsequences [a, b, c] with [d, e] with zero inversions and the sequence [a, d, b, e, c] can be obtained from these subsequences with 3 inversions. The RIM generates a permutation recursively by merging subsequences defined by a binary recursive decomposition of the elements in E and where the number of inversions is controlled by a separate parameter associated with each merge operation. More formally, a RIM τ(θ) for a set of elements E = {e1, . . . , en}, has a structure τ that represents a recursive decomposition of the set E and a set of parameters θ ∈Rn−1. We represent a RIM as a binary tree with n = |E| leaves, each associated with a distinct element of E. We denote the set of internal vertices of the binary tree by I and each internal vertex is represented as a triple i = (θi, iL, iR) where iL (iR) is the left (right) subtree, and θi controls the number of inversions when merging the subsequences generated from each of the subtrees. Traversing the tree τ in preorder, with the left child preceding the right child induces a permutation on E called the reference permutation of the RIM which we denote as πτ. The RIM is defined in terms of the vertex discrepancy, the number of inversions at (internal) vertex i = (θi, iL, iR) of τ(θ) for test permutation π is vi(π, πτ) = P l∈Li P r∈Ri Dlr(π, πτ) where Li (Ri) is the subset of elements E that appear as leaves of iL (iR), the left (right) subtree of internal vertex i. Note that the sum of the vertex discrepancies over the internal vertices is the inversion distance between π and the reference permutation πτ. Finally, the likelihood of a permutation π with respect to RIM τ(θ) is as follows: P(π|τ) ∝ Y i∈I exp(−θivi(π, πτ)) (2) Example: For elements E = {a, b, c, d}, Figure 1 shows a RIM τ for preferences over four types of fruit. The reference permutation for this model is πτ = (a, b, c, d) and the modal permutation is (c, d, a, b) due to the sign of the root vertex. For test permutation π = (d, a, b, c), we have that vroot(π, πτ) = 2, vleft = 0, and vright = 1. Note that the model captures strong preferences between the pairs (a, b) and (c, d) and weak preferences between (c, a),(d, a),(c, b) and (d, b). This is an example of a set of preferences that cannot be captured in a GMM as choosing a strong preference between the pairs (a, b) and (c, d) induces a strong preference between either (a, d) or (c, b) which differs in both strength and order from the example. apple banana cherry durian 0.8 1.6 -0.1 Figure 1: An example of a RIM for fruit preferences among (a)pple, (b)anana, (c)herry, and (d)urian. The parameter for internal vertices indicates the preference between items in the left and right subtree with 0 indicating no preference and a negative number indicating the right items are more preferable than the left items. Naive computation of the partition function Z(τ(θ)) for a recursive inversion model would require a sum with n! summands (all permutations). We can, however, use the recursive structure of τ(θ) to compute it as follows: 1Note that a GMM can be parameterized in terms of n −1 parameters due to the fact that vn = 0. 2 Proposition 1 Z(τ(θ)) = Y i∈I G(|Li|, |Ri|; exp(−θi)). (3) G(n, m; q) = (q)n+m (q)n(q)m def ≡Zn,m(q) . (4) In the above G(n, m; q) is the Gaussian polynomial (Andrews, 1985) and (q)n = Qn i=1(1 −qi). The Gaussian polynomial is not defined for q = 1 so we extend the definition so that G(n, m, 1) = n+m m  which corresponds to the limit of the Gaussian polynomial as q approaches 1 (and θ approaches 0). Note that when all θi ≥0 the reference permutation πτ is also a modal permutation and that this modal permutation is unique when all θi > 0. Also note that a GMM can be represented by using a chain-like tree structure in which each element in the reference permutation is split from the remaining elements one at a time. 3 Estimating Recursive Inversion Models In this section, we present a Maximum Likelihood (ML) approach to parameter and structure estimation from an observed data D = {π1, π2, . . . πN} of permutations over E. Parameter estimation is straight-forward. Given a structure τ, we see from (2) that the likelihood factors according to the structure. In particular, a RIM is a product of exponential family models, one for each internal node i ∈I. Consequently, the (negative) log-likelihood given D decomposes into a sum −ln P(D|τ(θ)) = X i∈I [θi ¯Vi + ln Z|Li|,|Ri|(e−θi)] | {z } score(i,θi) (5) with ¯Vi = 1 |D| P π∈D vi(π, πτ) representing the sufficient statistic for node i from data. This is a convex function of the parameters θi, and hence the ML estimate can be obtained numerically solving a set of univariate minimization problems. In the remainder of the paper we use D to be the sum of the discrepancy matrices for all of the observed data D with respect to the identity permutation. Note that this matrix provides a basis for efficiently computing the sufficient statistics of any RIM. In the remainder of this section, we consider the problem of estimating the structure of a RIM from observed data beginning with a brief exploration of the degree to which the structure of a RIM can be identified. 3.1 Identifiability First, we consider whether the structure of a RIM can be identified from data. From the previous section, we know that the parameters are identifiable given the structure. However, the structure of a RIM can only be identified under suitable assumptions. The first type of non-identifiability occurs when some θi parameters are zero. In this case, the permutation πτ is not identifiable, because switching the left and right child of node i with θi = 0 will not change the distribution represented by the RIM. In fact, as shown by the next proposition, the left and right children can be swapped without changing the distribution if the sign of the parameter is changed. Proposition 2 Let τ(θ) be a RIM over E, D a matrix of sufficient statistics and i any internal node of τ, with parameter θi and iL, iR its left and right children. Denote by τ ′(θ′) the RIM obtained from τ(θ) by switching iL, iR, and setting θ′ i = −θi. Then, P(π|τ(θ)) = P(π|τ ′(θ′)) for all permutations π of E. This proposition demonstrates that the structure of a RIM cannot be identified in general and that there is an equivalence class of alternative structures among which we cannot distinguish. We elimi3 nate this particular type of non-identifiability by considering RIM that are in canonical form. Proposition 2 provides a way to put any τ(θ) in canonical form. Algorithm 1 Algorithm CANONICALPERMUTATION Input any τ(θ) for each internal node i with parameter θi do if θi < 0 then θi ←−θi; switch left child with right child end if end for Proposition 3 For any matrix of sufficient statistics D, and any RIM τ(θ), Algorithm CANONICALPERMUTATION does not change the log-likelihood. The proof of correctness follows from repeated application of Proposition 2. Moreover, if θi ̸= 0 before applying CANONICALPERMUTATION, then the output of the algorithm will have all θi > 0. A further non identifiability arises when parameters of the generating model are equal. It is easy to see that if all the parameters θi are equal to the same value θ, then the likelihood of a permutation π would be P(π|τ, (θ, . . . θ)) ∝exp(−θd(π, πτ)), which is the likelihood corresponding to the Mallows model. In this case πτ is identifiable, but the internal structure is not. Similarly, if all the parameters θi are equal in a subtree of τ, then the structure in that subtree is not identifiable. We say that a RIM τ(θ) is locally identifiable iff θi ̸= 0, i ∈I and |θi| ̸= |θi′| whenever i is a child of i′. We say that a RIM τ(θ) is identifiable if there is a unique canonical RIM that represents the same distribution. The following proposition captures the degree to which one can identify the structure of a RIM. Proposition 4 A RIM τ(θ) is identifiable iff it is locally identifiable. 3.2 ML estimation or τ for fixed πτ is tractable We first consider ML estimation when we fix πτ, the reference permutation over the leaves in E. For the remainder of this section we assume that the optimal value of ˆθi for any internal node i is available (e.g., via the convex optimization problem described in the previous section). Hence, what remains to be estimated is the internal tree structure Proposition 5 For any set E, permutation πτ over E, and observed data D, the Maximum Likelihood RIM structure inducing this πτ can be computed in polynomial time by Dynamic Programming algorithm STRUCTBYDP. Proof sketch Note that there is a one-to-one correspondence between tree structures representing alternative binary recursive partitioning over a fixed permutation of E and alternative ways in which the one can parenthesize the permutation of E. The negative log-likelihood decomposes according to the structure of the model with the cost of a subtree rooted at i depending only on the structure of this subtree. Furthermore, this cost can be decomposed recursively into a sum of score(i, ˆθi) and the costs of iL, iR the subtrees of i. The recursion is identical to the recursion of the “optimal matrix chain multiplication” problem, or to the “inside” part of the Inside-Outside algorithm in string parsing by SCFGs (Earley, 1970). Without loss of generality, we consider that πτ is the identity, πτ = (e1, . . . en). For any subsequence ej, . . . em of length l = m −j + 1, we define the variables cost(j, m), θ(j, m), Z(j, m) that will store respectively the negative log-likelihood, the parameter at the root, and the Z for the root node of the optimal tree over the subsequence ej, . . . em. If all the values of cost(j, m) are known for m −j + 1 < l, then the values of cost(j, j + l −1), θ(j, j + l −1), Z(j, j + l −1) are obtained recursively from the existing values. We also maintain the pointers back(j, m) that indicate which subtrees were used in obtaining cost(j, m). When cost(1, n) and the corresponding θ and Z are obtained, the optimal structure and its parameters have been found, and they can be read 4 recursively by following the pointers back(j, m). Note that in the innermost loop, the quantities score(j, m), θ(j, m), ¯V are recalculated for each k. We call the algorithm implementing this optimization STRUCTBYDP. Algorithm 2 Algorithm STRUCTBYDP 1: Input sample discrepancy matrix D computed from the observed data 2: for m = 1 : n do 3: cost(m, m) ←0 4: end for 5: for l ←2 . . . n do 6: for j ←1 : n −l + 1 do 7: m ←j + l −1 8: cost(j, m) ←∞ 9: for k ←j : m −1 do 10: calculate ¯V = Pk j′=j Pm m′=k Dm′j′ 11: L = k −j + 1, R = m −k 12: estimate θjm from L, R, ¯V 13: calculate score(j, m) by (5) 14: s ←cost(j, k) + cost(k + 1, m) + score(j, m) 15: if s < cost(j, m) then 16: cost(j, m) ←s, back(j, m) ←k 17: store θ(j, m), ZLR(j, m) 18: end if 19: end for 20: end for 21: end for Algorithm 3 Algorithm SASEARCH Input set E, discrepancy matrix D computed from observed data, inverse temperature β Initialize Estimate GMM τ0 by BRANCH&BOUND , τ best = τ0 for t = 1, 2, . . . tmax do while accept= FALSE do sample π ∼P(π|τt−1) τ ′ ←STRUCTBYDP(π, D) τ ′ ←CANONICALPERMUTATION(τ ′) π′ ←reference order of τ ′ τ ′ ←STRUCTBYDP(π′, D) accept=TRUE, u ∼uniform[0, 1) if e−β(ln P (D|τt−1)−ln P (D|τ ′)) < u then accept←FALSE end if end while τt ←τ ′ (store accepted new model) if P(D|τt) > P(D|τ best) then τ best ←τt end if end for Output τ best To evaluate the running time of STRUCTBYDP algorithm, we consider the inner loop over k for a given l. This loop computes ¯V , ˆθ, Z for each L, R split of l, with L + R = l. Apparently, this would take time cubic in l, since ¯V is a summation over LR terms. However, one can notice that in the calculations of all ¯V values over this submatrix of size l × l, for L = 1, 2, . . . l −1, each of the Drl elements is added once to the sum, is kept in the sum for a number of steps, then is removed. Therefore, the total number of additions and subtractions is no more than twice l(l−1)/2, the number of submatrix elements . Estimating θ and the score involved computing Z by (3) (for 5 the score) and its gradient (for the θ estimation). These take min(L, R) < l operations per iteration. If we consider the number of iterations to convergence a constant, then the inner loop over k will take O(l2) operations. Since there are n −l subsequences of length l, it is easy now to see that the running time of the whole STRUCTBYDP algorithm is of the the order n4. 3.3 A local search algorithm Next we develop a local search algorithm for the structure when a reference permutation is not provided. In part, this approach can be motivated by previous work on structure estimation for the Mallows model, where the structure is a permutation. For these problems, researchers have found that an approach in which one greedily improves the log-likelihood by transposing adjacent elements coupled with a good initialization is a very effective approximate optimization method (Schalekamp & van Zuylen, 2009; Ali & Meila, 2011). In our approach, we take a similar approach and treat the problem as a search for good reference permutations leveraging the STRUCTBYDP algorithm to find the structure given a reference permutation. At a high level, we initialize πτ = π0 by estimating a GMM from the data D and then improve πτ by “local changes” starting from π0. We rely on estimation of a GMM for initialization but, unfortunately, the ML estimation of a Mallows model, as well as that of a GMM, is NP-hard (Bartholdi et al., 1989). For the initialization, we can use any of the fast heuristic methods of estimating a Mallows model, or a more computationally expensive search algorithm, The latter approach, if the search space is small enough, can find a provably optimal permutation but, in most cases, it will return a suboptimal result. For the local search, we make two variations with respect to the previous works, and we add a local optimization step specific to the class of Recursive Inversion models. First, we replace the greedy search with a simulated annealing search. Thus, we will generate proposal permutations π′ near the current π. Second, the proposals permutations π′ are not restricted to pairwise transpositions. Instead, we sample a permutation π′ from the current RIM τt. The reason is that if some of the pairs e ≺πτ e′ are only weakly ordered by τt (which would happen if this ordering or e, e′ is not well supported by the data), then the sampling process will be likely to create inversions between these pairs. Conversely, if τt puts a very high confidence on e ≺e′, then it is probable that this ordering is well supported by the data and reversing it will be improbable in the proposed τ. For each accepted proposal permutation π, we estimate the optimal structure τ give this π and the optimal parameters ˆθ given the structure τ. Rather than sampling a permutation from the RIM τ(ˆθ) we then apply CANONICALPERMUTATION, which does not change the log-likelihood, to convert τ(ˆθ) into a canonical model and perform another structure optimization step STRUCTBYDP. This has the chance of once again increasing the log-likelihood, and experimentally we find that it often does increase the log-likelihood significantly. We then use the estimated structure and associated parameters to sample a new permutation. These steps are implemented by algorithm SASEARCH. 4 Related work In addition to the Mallows and GMM models, our RIM model is related to the work of Manilla & Meek (2000). To understand the connection between this work and our RIM model consider a restricted RIM model in which parameter values can either be 0 or ∞. Such a model provides a uniform distribution over permutations consistent with a series-parallel partial order defined in terms of the binary recursive partition where a parameter whose value is 0 corresponds to a parallel combination and a parameter value of ∞corresponds to a series combination. The work of Manilla & Meek (2000) considers the problem of learning the structures and estimating the parameters of mixtures of these series-parallel RIM models using a local greedy search over recursive partitions of elements. Another close connection exists between RIM models and the riffle independence models (RI) proposed by Huang et al. (2009); Huang & Guestrin (2012); Huang et al. (2012). Both approaches use a recursive partitioning of the set of elements to define a distribution over permutations. Unlike the RIM model, the RI model is not defined in terms of inversions but rather in terms of independence between the merging processes. The RI model requires exponentially more parameters than the 6 Irish Meath elections Sushi Figure 2: Log-likelihood scores for the models alph, HG, and GMM as differences from the loglikelihood of SASEARCH output, on held-out sets from Meath elections data (left) and Sushi data (middle). Train/test set split was 90/2400, respectively 300/4700, with 50 random replications. Negative score indicate that a model has lower likelihood than the model obtained by SASEARCH. The far outlier(s) in meath represent one run where SA scored poorly on the test set. Right: Most common structure and typical parameters learned for the sushi data. Interior nodes contain the associated parameter value, with higher values and darker green indicating a stronger ordering between the items in the left and right subtrees. The leaves are the different types of sushi. RIM model due to the fact that the model defines a general distribution over mergings which grows exponentially in the cardinality of the left and right sets of elements. In addition, the RI models do not have the same ease of interpretation as the RIM model. For instance, one cannot easily extract a reference permutation or modal permutation from a given a RI model, and the comparison of alternative RI models, even when the two RI models have the same structure, is limited to the comparison of rank marginals and Fourier coefficients. It is worth noting that there have been a wide range of approaches that use multiple reference permutations. One benefit of such approaches is that they enable the model to capture multi-modal distributions over permutations. Examples of such approaches include the mixture modeling approaches of Manilla & Meek (2000) discussed above and the work of Lebanon & Lafferty (2002) and Klementiev et al. (2008), where the model is a weighted product of a set of Mallows models each with their own reference order. It is natural to consider both mixtures and products of RIM models. 5 Experiments We performed experiments on synthetic data and real-world data sets. In our synthetic experiments we found that our approach was typically able to identify both the structure and parameters of the generative model. More specifically, we ran extensive experiments with n = 16 and n = 33, choosing the model structures to have varying degrees of balance, and choosing the parameters randomly chosen with exp(−θi) between 0.4 and 0.9. We then used these RIMs to generate datasets containing varying numbers of permutations to investigate whether the true model could be recovered. We found that all models were recoverable with high probability when using between 200-1000 SASEARCH iterations. We did find that the identification of the correct tree structure in its entirety typically required a large sample size. We note that failures to identify the correct structure were typically due to the fact that alternative structures had higher likelihood than the generating structure in a particular sample rather than a failure of the search algorithm. While our experiments had at most n = 33 this was not due to the running time of the algorithms. For instance, STRUCTBYDP ran in a few seconds for domains with 33 items. For the smaller domains and for the real-world data below, the whole search with hundreds of accepted proposals typically ran in less than three minutes. In particular, this search was faster than the BRANCH&BOUND search for GMM models. In our experiments on real-world data sets we examine two datasets. The first data set is an Irish House of Parliament election dataset from the Meath constituency in Ireland. The parliament uses the single transferable vote election system, in which voters rank candidates. There were 14 candi7 dates in the 2002 election, running for five seats. Candidates are associated with the two major rival political parties, as well as a number of smaller parties. We use the roughly 2500 fully ranked ballots from the election. See Gormley & Murphy (2007) for more details about the dataset. The second dataset consists of 5,000 permutations of 10 different types of sushi where the permutation captures preferences about sushi (Kamisha, 2003). The different types of sushi considered are: anago (sea eel), ebi (shrimp), ika (squid), kappa-maki (cucumber roll), maguro (tuna), sake (salmon), tamago (egg), tekka-maki (tuna roll), toro (fatty tuna), uni (sea urchin). We compared a set of alternative recursive inversion models and approaches for identifying their structure. Our baseline approach, denoted alph, is one where the reference permutation is alphabetical and fixed and we estimate the optimal structure given that order by STRUCTBYDP. Our second approach, GMM, is to use the BRANCH&BOUND algorithm of Mandhani & Meila (2009)2 to estimate a generalized Mallows Model. A third approach, HG, is to fit the optimal RIM parametrization to the hierarchical tree structure identified by Huang & Guestrin (2012) on the same data.3 Finally, we search over both structures and orderings with SASEARCH, with 150 (100) iterations for Meath (sushi) at temperature 0.02. The quantitative results are shown in Figure 2. We plot the difference in test log-likelihood for each model as compared with SASEARCH. We see that on the Meath data SASEARCH outperforms alph in 94% of the runs, HG in 75%, and GMM in 98%; on the Sushi data, SASEARCH is always superior to alph and GMM, and has higher likelihood than GMM in 75% of runs. On the training sets, SASEARCH had always the best fit (not shown). We also investigated the structure and parameters of the learned models. For the Meath data we found that there was significant variation in the learned structure across runs. Despite the variation there were a number of substructures common to the learned models. Similar to the findings in Huang & Guestrin (2012) on the structure of a learned riffle independence model, we found that candidates from the same party were typically separated from candidates of other parties as a group. In addition, within these political clusters we found systematic preference orderings among the candidates. Thus, many substructures in our trees were also found in the HG tree. In addition, again as found by Huang & Guestrin (2012), we found that a single candidate in an extreme political party is typically split near the top of the hierarchy, with a θ ≈0, indicating that this candidate can be inserted anywhere in a ranking. We suspect that the inability of a GMM to capture such dependencies leads to the poor empirical performance relative to HG and full search which can capture such dependencies. We note that alph is allowed to have θi < 0, and therefore the alphabetic reference permutation does not represent a major handicap. For the sushi data roughly 90% of the runs had the structure shown in Figure 2 with the other variants being quite similar. The structure found is interesting in a number of different ways. First, the model captures a strong preference between different varieties of tuna (toro, maguro and tekka) which corresponds with the typical price of these varieties. Second, the model captures a preference against tamago and kappa as compared with several other types of sushi and both of these varieties are distinct in that they are not varieties of fish but rather egg and cucumber respectively. Finally, uni (sea urchin), which many people describe as being quite distinct in flavor, is ranked independently of preferences between other sushi and, additionally, there is no consensus on its rank. 2www.stat.washington.edu/mmp/intransitive.html 3We would have liked to make a direct comparison with the algorithm of Huang & Guestrin (2012), but the code was not available. Due to this, we aim only at comparing the quality of the HG structure, a structure found to model these data well albeit with a different estimation algorithm, with the structures found by SASEARCH. 8 References Ali, Alnur and Meila, Marina. Experiments with Kemeny ranking: What works when? Mathematics of Social Sciences, Special Issue on Computational Social Choice, pp. (in press), 2011. Andrews, G.E. The Theory of Partitions. Cambridge University Press, 1985. Bartholdi, J., Tovey, C. A., and Trick, M. Voting schemes for which it can be difficult to tell who won. Social Choice and Welfare, 6(2):157–165, 1989. proof that consensus ordering is NP hard. Earley, Jay. An efficient context-free parsing algorithm. Communications of the ACM, 13(2):94–102, 1970. Fligner, M. A. and Verducci, J. S. Distance based ranking models. Journal of the Royal Statistical Society B, 48:359–369, 1986. Gormley, I. C. and Murphy, T. B. A latent space model for rank data. In Proceedings of the 24th Annual International Conference on Machine Learning, pp. 90–102, New York, 2007. ACM. Huang, Jonathan and Guestrin, Carlos. Uncovering the riffled independence structure of ranked data. Electronic Journal of Statistics, 6:199–230, 2012. Huang, Jonathan, Guestrin, Carlos, and Guibas, Leonidas. Fourier theoretic probabilistic inference over permutations. Journal of Machine Learning Research, 10:997–1070, May 2009. Huang, Jonathan, Kapoor, Ashish, and Guestrin, Carlos. Riffled independence for efficient inference with partial rankings. Journal of Artificial Intelligence Research, 44:491–532, 2012. Kamisha, T. Nantonac collaborative filtering: recommendation based on order responses. In Proceedings of the ninth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 583–588, New York, 2003. ACM. Klementiev, Alexandre, Roth, Dan, and Small, Kevin. Unsupervised rank aggregation with distancebased models. In Proceedings of the 25th International Conference on Machine Learning, pp. 472–479, New York, NY, USA, 2008. ACM. Lebanon, Guy and Lafferty, John. Cranking: Combining rankings using conditional probability models on permutations. In Proceedings of the 19th International Conference on Machine Learning, pp. 363–370, 2002. Mallows, C. L. Non-null ranking models. Biometrika, 44:114–130, 1957. Mandhani, Bhushan and Meila, Marina. Better search for learning exponential models of rankings. In VanDick, David and Welling, Max (eds.), Artificial Intelligence and Statistics AISTATS, number 12, 2009. Manilla, Heiki and Meek, Christopher. Global partial orders from sequential data. In Proceedings of the Sixth Annual Confrerence on Knowledge Discovery and Data Mining (KDD), pp. 161–168, 2000. Schalekamp, Frans and van Zuylen, Anke. Rank aggregation: Together we’re strong. In Finocchi, Irene and Hershberger, John (eds.), Proceedings of the Workshop on Algorithm Engineering and Experiments, ALENEX 2009, New York, New York, USA, January 3, 2009, pp. 38–51. SIAM, 2009. 9
2014
31
5,414
Message Passing Inference for Large Scale Graphical Models with High Order Potentials Jian Zhang ETH Zurich jizhang@ethz.ch Alexander G. Schwing University of Toronto aschwing@cs.toronto.edu Raquel Urtasun University of Toronto urtasun@cs.toronto.edu Abstract To keep up with the Big Data challenge, parallelized algorithms based on dual decomposition have been proposed to perform inference in Markov random fields. Despite this parallelization, current algorithms struggle when the energy has high order terms and the graph is densely connected. In this paper we propose a partitioning strategy followed by a message passing algorithm which is able to exploit pre-computations. It only updates the high-order factors when passing messages across machines. We demonstrate the effectiveness of our approach on the task of joint layout and semantic segmentation estimation from single images, and show that our approach is orders of magnitude faster than current methods. 1 Introduction Graphical models are a very useful tool to capture the dependencies between the variables of interest. In domains such as computer vision, natural language processing and computational biology they have been very widely used to solve problems such as semantic segmentation [37], depth reconstruction [21], dependency parsing [4, 25] and protein folding [36]. Despite decades of research, finding the maximum a-posteriori (MAP) assignment or the minimimum energy configuration remains an open problem, as it is NP-hard in general. Notable exceptions are specialized solvers such as graph-cuts [7, 3] and dynamic programming [19, 1], which retrieve the global optima for sub-modular energies and tree-shaped graphs. Algorithms based on message passing [18, 9], a series of graph cut moves [16] or branch-and-bound techniques [5] are common choices to perform approximate inference in the more general case. A task closely related to MAP inference but typically harder is computation of the probability for a given configuration. It requires computing the partition function, which is typically done via message passing [18], sampling or by repeatedly using MAP inference to solve tasks perturbed via Gumbel distributions [8]. Of particular difficulty is the case where the involved potentials depend on more than two variables, i.e., they are high-order, or the graph is densely connected. Several techniques have been developed to allow current algorithms to handle high-order potentials, but they are typically restricted to potentials of a specific form, e.g., a function of the cardinality [17] or piece-wise linear potentials [11, 10]. For densely connected graphs with Gaussian potentials efficient inference methods based on filtering have been proposed [14, 33]. Alternating minimization approaches, which iterate between solving for subsets of variables have also been studied [32, 38, 29]. However, most approaches loose their guarantees since related subproblems are solved independently. Another method to improve computational efficiency is to divide the model into smaller tasks, which are solved in parallel using dual decomposition techniques [13, 20, 22]. Contrasting alternating minimization, convergence properties are ensured. However, these techniques are computationally expensive despite the division of computation, since global and dense interactions are still present. 1 In this work we show that for many graphical models it is possible to devise a partitioning strategy followed by a message passing algorithm such that efficiency can be improved significantly. In particular, our approach adds additional terms to the energy function (i.e., regions to the Hasse diagram) such that the high-order factors can be pre-computed and remain constant during local message passing within each machine. As a consequence, high-order factors are only accessed once before sending messages across machines. This contrasts tightening approaches [27, 28, 2, 26], where additional regions are added to better approximate the marginal polytope at the cost of additional computations, while we are mainly interested in computational efficiency. In contrast to re-scheduling strategies [6, 30, 2], our rescheduling is fixed and does not require additional computation. Our experimental evaluations show that state-of-the-art techniques [9, 22] have difficulties optimizing energy functions that correspond to densely connected graphs with high-order factors. In contrast our approach is able to achieve more than one order of magnitude speed-ups while retrieving the same solution in the complex task of jointly estimating 3D room layout and image segmentation from a single RGB-D image. 2 Background: Dual Decomposition for Message Passing We start by reviewing dual-decomposition approaches for inference in graphical models with highorder factors. To this end, we consider distributions defined over a discrete domain S = QN i=1 Si, which is composed of a product of N smaller discrete spaces Si = {1, . . . , |Si|}. We model our distribution to depend log-linearly on a scoring function θ(s) defined over the aforementioned discrete product space S, i.e., p(s) = 1 Z exp θ(s), with Z the partition function. Given the scoring function θ(s) of a configuration s, it is unfortunately generally #P-complete to compute its probability since the partition function Z is required. Its logarithm equals the following variational program [12]: log Z = max p∈∆ X s p(s)θ(s) + H(p), (1) where H denotes the entropy and ∆indicates the probability simplex. The variational program in Eq. (1) is challenging as it operates on the exponentially sized domain S. However, we can make use of the fact that for many relevant applications the scoring function θ(s) is additively composed of local terms, i.e., θ(s) = P r∈R θr(sr). These local scoring functions θr depend on a subset of variables sr = (si)i∈r, defined on a domain Sr ⊆S, which is specified by the restriction often referred to as region r ⊆{1, . . . , N}, i.e., Sr = Q i∈r Si. We refer to R as the set of all restriction required to compute the scoring function θ. Locality of the scoring function allows to equivalently rewrite the expected score via P s p(s)θ(s) = P r,sr pr(sr)θr(sr) by employing marginals pr(sr) = P s\sr p(s). Unfortunately an exact decomposition of the entropy H(p) using marginals is not possible. Instead, the entropy is typically approximated by a weighted sum of local entropies H(p) ≈P r crH(pr), with cr the counting numbers. The task remains intractable despite the entropy approximation since the marginals pr(sr) are required to arise from a valid joint distribution p(s). However, if we require the marginals to be consistent only locally, we obtain a tractable approximation [34]. We thus introduce local beliefs br(sr) to denote the approximation, not to be confused with the true marginals pr. The beliefs are required to fulfill local marginalization constraints, i.e., P sp\sr bp(sp) = br(sr) ∀r, sr, p ∈P(r), where the set P(r) subsumes the set of all parents of region r for which we want marginalization to hold. Putting all this together, we obtain the following approximation: max b X r,sr br(sr)θr(sr) + X r crH(br) s.t. ∀r br ∈C =  br : br ∈∆ P sp\sr bp(sp) = br(sr) ∀sr, p ∈P(r). (2) The computation and memory requirements can be too demanding when dealing with large graphical models. To address this issue, [13, 22] showed that this task can be distributed onto multiple 2 Algorithm: Distributed Message Passing Inference Let a = 1/|M(r)| and repeat until convergence 1. For every κ in parallel: iterate T times over r ∈R(κ): ∀p ∈P(r), sr µp→r(sr) = ϵˆcp ln X sp\sr exp ˆθp(sp) −P p′∈P (p) λp→p′(sp) + P r′∈C(p)∩κ\r λr′→p(sr′) + νκ→p(sp) ϵˆcp (3) λr→p(sr) ∝ ˆcp ˆcr+ P p∈P (r) ˆcp  ˆθr(sr) + X c∈C(r)∩κ λc→r(sc) + νκ→r(sr) + X p∈P (r) µp→r(sr)  −µp→r(sr)(4) 2. Exchange information by iterating once over r ∈G ∀κ ∈M(r) νκ→r(sr) = a X c∈C(r) λc→r(sc) − X c∈C(r)∩κ λc→r(sc) + X p∈P (r) λr→p(sr) −a X κ∈M(r),p∈P (r) λr→p(sr) (5) Figure 1: A block-coordinate descent algorithm for the distributed inference task. computers κ by employing dual decomposition techniques. More specifically, the task is partitioned into multiple independent tasks with constraints at the boundary ensuring consistency of the parts upon convergence. Hence, an additional constraint is added to make sure that all beliefs bκ r that are assigned to multiple computers, i.e., those at the boundary of the parts, are consistent upon convergence and equal a single region belief br. The distributed program is then: max br,bκ r ∈∆ X κ,r,sr bκ r(sr)ˆθr(sr) + X κ,r ˆcrH(bκ r) s.t. ∀κ, r ∈Rκ, sr, p ∈P(r) P sp\sr bκ p(sp) = bκ r(sr) ∀κ, r ∈Rκ, sr bκ r(sr) = br(sr), where Rκ refers to regions on comptuer κ. We uniformly distributed the scores θr(sr) and the counting numbers cr of a region r to all overlapping machines. Thus ˆθr = θr/|M(r)| and ˆcr = cr/|M(r)| with M(r) the set of machines that are assigned to region r. Note that this program operates on the regions defined by the energy decomposition. To derive an efficient algorithm making use of the structure incorporated in the constraints we follow [22] and change to the dual domain. For the marginalization constraints we introduce Lagrange multipliers λκ r→p(sr) for every computer κ, all regions r ∈Rκ assigned to that computer, all its states sr and all its parents p. For the consistency constraint we introduce Lagrange multipliers νκ→r(sr) for all computers, regions and states. The arrows indicate that the Lagrange multipliers can be interpreted as messages sent between different nodes in a Hasse diagram with nodes corresponding to the regions. The resulting distributed inference algorithm [22] is summarized in Fig. 1. It consists of two parts, the first of which is a standard message passing on the Hasse-diagram defined locally on each computer κ. The second operation interrupts message passing occasionally to exchange information between computers. This second task of exchanging messages is often visualized on a graph G with nodes corresponding to computers and additional vertices denoting shared regions. Fig. 2(a) depicts a region graph with four unary regions and two high-order ones, i.e., R = {{1}, {2}, {3}, {4}, {1, 2, 3}, {1, 2, 3, 4}}. We partition this region graph onto two computers κ1, κ2 as indicated via the dashed rectangles. The graph G containing as nodes both computers and the shared region is provided as well. The connections between all regions are labeled with the corresponding message, i.e., λ, µ and ν. We emphasize that the consistency messages ν are only modified when sending information between computers κ. Investigating the provided example in Fig. 2(a) more carefully we observe that the computation of µ as defined in Eq. (3) in Fig. 1 involves summing over the state-space of the third-order region {1, 2, 3} and the fourth-order region {1, 2, 3, 4}. The presence of those high-order regions make dual decomposition approaches [22] 3 α = {1, 2, 3} β = {1, 2, 3, 4} α = {1, 2, 3} β = {1, 2, 3, 4} {1} {2} {3} {4} 1 α λ → 1 α µ → 1 β λ → 1 β µ → 2 α λ → 2 α µ → 2 β λ → 2 β µ → 3 α λ → 3 α µ → 4 β λ → 4 β µ → 3 β λ → 3 β µ → κ1 2 κ α = {1, 2, 3} β = {1, 2, 3, 4} 1 κ β υ → 2 κ α υ → 2 κ β υ → 1 κ α υ → (a) α = {1, 2, 3} β = {1, 2, 3, 4} α = {1, 2, 3} β = {1, 2, 3, 4} σ = {1, 2} π = {3, 4} {1} {2} {3} {4} κ1 2 κ 1 σ λ → 1 σ µ → 2 σ λ → 2 σ µ → 3 π λ → 3 π µ → 4 π λ → 4 π µ → σ α λ → α σ µ → σ β λ → β σ µ → 3 α λ → 3 α µ → π β λ → β π µ → α = {1, 2, 3} β = {1, 2, 3, 4} 1 κ β υ → 2 κ α υ → 2 κ β υ → 1 κ α υ → (b) Figure 2: Standard distributed message passing operating on an inference task partitioned to two computers (left) is compared to the proposed approach (right) where newly introduced regions (yellow) ensure constant messages µ from the high-order regions. impractical. In the next section we show how message passing algorithms can become orders of magnitude faster when adding additional regions. 3 Efficient Message Passing for High-order Models The distributed message passing procedure described in the previous section involves summations over large state-spaces when computing the messages µ. In this section we derive an approach that can significantly reduce the computation by adding additional regions and performing messagepassing with a specific message scheduling. Our key observation is that computation can be greatly reduced if the high-order regions are singly-connected since their outgoing message µ remains constant. Generally, singly-connected high-order regions do not occur in graphical models. However, in many cases we can use dual decomposition to distribute the computation in a way that the high-order regions become singly-connected if we introduce additional intermediate regions located between the high-order regions and the low-order ones (e.g., unary regions). At first sight, adding regions increases computational complexity since we have to iterate over additional terms. However, we add regions only if they result in constant messages from regions with even larger state space. By pre-computing those constant messages rather than re-evaluating them at every iteration, we hence decrease computation time despite augmenting the graph with additional regions, i.e., additional marginal beliefs br. Specifically, we observe that there are no marginalization constraints for the singly-connected highorder regions, subsumed in the set Hκ = {r ∈ˆRκ : P(r) = ∅, |C(r)| = 1}, since their set of parents is empty. An important observation made precise in Claim 1 is that the corresponding messages µ are constant for high-order regions unless νκ→r changes. Therefore we can improve the message passing algorithm discussed in the previous section by introducing additional regions to increase the size of the set |Hκ| as much as possible while not changing the cost function. The latter is ensured by requiring the additional counting numbers and potentials to equal zero. However, we note that the program will change since the constraint set is augmented. More formally, let ˆRκ be the set of all regions, i.e., the regions Rκ of the original task on computer κ in addition to the newly added regions ˆr ∈ˆRκ \Rκ. Let Hκ = {r ∈ˆRκ : P(r) = ∅, |C(r)| = 1} be the set of high-order regions on computer κ that are singly connected and have no parent. Further, let its complement Hκ = ˆRκ \ Hκ denote all remaining regions. The inference task is given by max br,bκ r ∈∆ X κ,r,sr bκ r(sr)ˆθr(sr) + X κ,r ˆcrH(bκ r) s.t. ∀κ, r ∈Hκ, sr, p ∈P(r) P sp\sr bκ p(sp) = bκ r(sr) ∀κ, r ∈ˆRκ, sr bκ r(sr) = br(sr). (9) Even though we set θr(sr) ≡0 for all states sr, and ˆcr = 0 for all newly added regions r ∈ˆRκ\Rκ, the inference task is not identical to the original problem since the constraint set is not the same. Note that new regions introduce new marginalization constraints. Next we show that messages leaving singly-connected high-order regions are constant. 4 Algorithm: Message Passing for Large Scale Graphical Models with High Order Potentials Let a = 1/|M(r)| and repeat until convergence 1. For every κ in parallel: Update singly-connected regions p ∈Hκ: let r = C(p) ∀sr µp→r(sr) = ϵˆcp ln X sp\sr exp ˆθp(sp) −P p′∈P (p) λp→p′(sp) + P r′∈C(p)∩κ\r λr′→p(sr′) + νκ→p(sp) ϵˆcp 2. For every κ in parallel: iterate T times over r ∈ˆRκ: ∀p ∈P(r) \ Hκ, sr µp→r(sr) = ϵˆcp ln X sp\sr exp ˆθp(sp) −P p′∈P (p) λp→p′(sp) + P r′∈C(p)∩κ\r λr′→p(sr′) + νκ→p(sp) ϵˆcp (6) ∀p ∈P(r), sr λr→p(sr) ∝ ˆcp ˆcr+ P p∈P (r) ˆcp  ˆθr(sr) + X c∈C(r)∩κ λc→r(sc) + νκ→r(sr) + X p∈P (r) µp→r(sr)  −µp→r(sr)(7) 3. Exchange information by iterating once over r ∈G ∀κ ∈M(r) νκ→r(sr) = a X c∈C(r) λc→r(sc) − X c∈C(r)∩κ λc→r(sc) + X p∈P (r) λr→p(sr) −a X κ∈M(r),p∈P (r) λr→p(sr) (8) Figure 3: A block-coordinate descent algorithm for the distributed inference task. Claim 1. During message passing updates defined in Fig. 1 the multiplier µp→r(sr) is constant for singly-connected high-order regions p. Proof: More carefully investigating Eq. (3) which defines µ, it follows that P p′∈P (p) λp→p′(sp) = 0 because P(p) = ∅since p is assumed singly-connected. For the same reason we obtain P r′∈C(p)∩κ\r λr′→p(sr′) = 0 because r′ ∈C(p) ∩κ \ r = ∅and νκ→p(sp) is constant upon each exchange of information. Therefore, µp→r(sr) is constant irrespective of all other messages and can be pre-computed upon exchange of information. ■ We can thus pre-compute the constant messages before performing message passing. Our approach is summarized in Fig. 3. We now provide its convergence properties in the following claim. Claim 2. The algorithm outlined in Fig. 3 is guaranteed to converge to the global optimum of the program given in Eq. (9) for ϵcr > 0 ∀r and is guaranteed to converge in case ϵcr ≥0 ∀r. Proof: The message passing algorithm is derived as a block-coordinate descent algorithm in the dual domain. Hence it inherits the properties of block-coordinate descent algorithms [31] which are guaranteed to converge to a single global optimum in case of strict concavity (ϵcr > 0 ∀r) and which are guaranteed to converge in case of concavity only (ϵcr ≥0 ∀r), which proves the claim. ■ We note that Claim 1 nicely illustrates the benefits of working with region graphs rather than factor graphs. A bi-partite factor graph contains variable nodes connected to possibly high-order factors. Assume that we distributed the task at hand such that every high-order region of size larger than two is connected to at most two local variables. By adding a pairwise region in between the original high-order factor node and the variable nodes we are able to reduce computational complexity since the high-order factors are now singly connected. Therefore, we can guarantee that the complexity of the local message-passing steps run in each machine reduces from the state-space size of the largest factor to the size of the largest newly introduced region in each computer. This is summarized in the following claim. Claim 3. Assume we are given a high-order factor-graph representation of a graphical model. By distributing the model onto multiple computers and by introducing additional regions we reduce the complexity of the message passing iterations on every computer generally dominated by the state5 (a) Layout parameterization. vp0 vp1 vp2 y1 y2 y3 y4 r1 r2 r3 r4 (b) Compatibility. y4 y3 y2 y1 l4 l5 l3 l2 l1 Layout Network Segmentation Network Compatibility Network vp0 vp1 vp2 y1 y2 y3 y4 r1 r2 r3 r4 (c) Joint model. Figure 4: Parameterization of the layout task is visualized in (a). Compatibility of a superpixel labeling with a wall parameterization using third-order functions is outlined in (b) and the graphical model for the joint layout-segmentation task is depicted in (c). rel. duality gap 1 0.1 0.01 Ours [s] 0.78 5.92 51.59 cBP [s] 31.60 986.54 1736.6 dcBP [s] 19.48 1042.8 1772.6 rel. duality gap 1 0.1 0.01 Ours [s] 15.58 448.26 1150.1 cBP [s] 411.81 4357.9 4479.9 dcBP [s] 451.71 4506.6 4585.3 ϵ = 0 ϵ = 1 Table 1: Average time to achieve the specified relative duality gap for ϵ = 0 (left) and ϵ = 1 (right). space size of the largest region smax = maxr∈Rκ |Sr| from O(smax) to O(s′ max) with s′ max = maxr∈ˆ Rκ |Sr∩Hκ|. Proof: The complexity of standard message passing on a region graph is linear on the largest statespace region, i.e., O(smax). Since some operations can be pre-computed as per Claim 1 we emphasize that the largest newly introduced region on computer κ is of state-space size s′ max which concludes the proof. ■ Claim 3 indicates that distributing computation in addition to message rescheduling is a powerful tool to cope with high-order potentials. To gain some insight, we illustrate our idea with a specific example. Suppose we distribute the inference computation on two computers κ1, κ2 as shown in Fig. 2(a). We compare it to a task on ˆR regions, i.e., we introduce additional regions ˆr ∈ˆR\R. The messages required in the augmented task are visualized in Fig. 2(b). Each computer (box highlighted with dashed lines) is assigned a task specified by the contained region graph. As before we also visualize the messages ν occasionally sent between the computers in a graph containing as nodes the shared factors and the computers (boxes drawn with dashed lines). The algorithm proceeds by passing messages λ, µ on each computer independently for T rounds. Afterwards messages ν are exchanged between computers. Importantly, we note that messages for singly-connected high-order regions within dashed boxes are only required to be computed once upon exchanging message ν. This is the case for all high-order regions in Fig. 2(b) and for no high-order region in Fig. 2(a), highlighting the obtained computational benefits. 4 Experimental Evaluation We demonstrate the effectiveness of our approach in the task of jointly estimating the layout and semantic labels of indoor scenes from a single RGB-D image. We use the dataset of [38], which is a subset of the NYU v2 dataset [24]. Following [38], we utilize 202 images for training and 101 for testing. Given the vanishing points (points where parallel lines meet at infinity), the layout task can be formulated with four random variables s1, . . . , s4, each of which corresponds to angles for rays originating from two distinct vanishing points [15]. We discretize each ray into |Si| = 25 states. To define the segmentation task, we partition each image into super pixels. We then define a random variable with six states for each super pixel si ∈Si = {left, front, right, ceiling, floor, clutter} with i > 4. We refer the reader to Fig. 4(a) and Fig. 4(b) for an illustration of the parameterization of the problem. The graphical model for the joint problem is depicted in Fig. 4(c). The score of the joint model is given by a sum of scores θ(s) = θlay(s1, . . . , s4) + θlabel(s5, . . . , sM+4) + θcomp(s), where θlay is defined as the sum of scores over the layout faces, which can be decomposed into a sum of pairwise functions using integral geometry [23]. The labeling score θlabel contains unary 6 10 0 10 1 10 2 10 3 0 0.5 1 1.5 2 2.5 ours primal cBP primal dcBP c = 1 primal dcBP c = 2 primal ours dual cBP dual dcBP c = 1 dual dcBP c = 2 dual 10 1 10 2 10 3 −3 −2 −1 0 1 2 3 4 5 ours primal cBP primal dcBP c = 1 primal dcBP c = 2 primal ours dual cBP dual dcBP c = 1 dual dcBP c = 2 dual (normalized primal/dual ϵ = 0) (normalized primal/dual ϵ = 1) 0 100 200 300 400 500 600 700 800 900 1000 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 ours agreement cBP agreement dcBP c = 1 agreement dcBP c = 2 agreement 0 500 1000 1500 2000 2500 3000 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 ours agreement cBP agreement dcBP c = 1 agreement dcBP c = 2 agreement (factor agreement ϵ = 0) (factor agreement ϵ = 1) Figure 5: Average normalized primal/dual and factor agreement for ϵ = 1 and ϵ = 0. potentials and pairwise regularization between neighboring superpixels. The third function, θcomp, couples the two tasks and encourages the layout and the segmentation to agree in their labels, e.g., a superpixel on the left wall of the layout is more likely to be assigned the left-wall or the object label. The compatibility score decomposes into a sum of fifth-order scores, one for each superpixel, i.e., θcomp(s) = P i>4 θcomp,i(s1, . . . , s4, si). Using integral geometry [23], we can further decompose each superpixel score θcomp,i into a sum of third-order energies. As illustrated in Fig. 4(c), every superpixel variable si, i > 4 is therefore linked to 4-choose-2 third order functions of state-space size 6 · 252. These functions measure the overlap of each superpixel with a region specified by two layout ray angles si, sj with i, j ∈{1, . . . , 4}, i ̸= j. This is illustrated in Fig. 4(b) for the area highlighted in purple and the blue region defined by s2 and s3. Since a typical image has around 250 superpixels, there are approximately 1000 third-order factors. Following Claim 3 we recognize that the third-order functions are connected to at most two variables if we distribute the inference such that the layout task is assigned to one computer while the segmentation task is divided onto other machines. Importantly, this corresponds to a roughly equal split of the problem when using our approach, since all tasks are pairwise and the state-space of the layout task is higher than the one of the semantic-segmentation. Despite the third-order regions involved in the original model, every local inference task contains at most pairwise factors. We use convex BP [35, 18, 9] and distributed convex BP [22] as baselines. For our method, we assign layout nodes to the first machine and segmentation nodes to the second one. Without introducing additional regions and pre-computations the workload of this split is highly unbalanced. This makes distributed convex BP even slower than convex BP since many messages are exchanged over the network. To be more fair to distributed convex BP, we split the nodes into two parts, each with 2 layout variables and half of the segmentation variables. For all experiments, we set cr = 1 and evaluate the settings ϵ = 1 and ϵ = 0. For a fair comparison we employ a single core for our approach and convex BP and two cores for distributed convex BP. Note that our approach can be run in parallel to achieve even faster convergence. We compare our method to the baselines using two metrics: Normalized primal/dual is a rescaled version of the original primal and dual normalized by the absolute value of the optimal score. This allow us to compare different images that might have fairly different energies. In case none of the algorithms converged we normalize all energies using the mean of the maximal primal and the minimum dual. The second metric is the factor agreement, which is defined as the proportion of factors that agree with the connected node marginals. Fig. 5 depicts the normalized primal/dual as well as the factor agreement for ϵ = 0 (i.e., MAP) and ϵ = 1 (i.e., marginals). We observe that our proposed approach converges significantly faster 7 layout err: 0.90% segmentation err: 4.74% layout err: 1.15% segmentation err: 5.12% layout err: 1.75% segmentation err: 3.98% layout err: 2.36% segmentation err: 4.06% layout err: 2.38% segmentation err: 3.77% layout err: 2.88% segmentation err: 6.01% layout err: 2.89% segmentation err: 3.99% layout err: 4.20% segmentation err: 3.65% layout err: 4.79% segmentation err: 4.17% layout err: 13.97% segmentation err: 32.08% layout err: 25.89% segmentation err: 16.70% layout err: 18.04% segmentation err: 5.34% Figure 6: Qualitative Result (ϵ = 0) : First column illustrates the inferred layout (blue) and layout ground truth (red). The second and third columns are estimated and ground truth segmentations respectively. Failure modes are shown in the last row. They are due to bad vanishing point estimation. than the baselines. We additionally observe that for densely coupled tasks, the performance of dcBP degrades when exchanging messages every other iteration (yellow curves). Importantly, in our experiments we never observed any of the other approaches to converge when our approach did not converge. Tab. 1 depicts the time in seconds required to achieve a certain relative duality gap. We observe that our proposed approach outperforms all baselines by more than one order of magnitude. Fig. 6 shows qualitative results for ϵ = 0. Note that our approach manages to accurately predict layouts and corresponding segmentations. Some failure cases are illustrated in the bottom row. They are largely due to failures in the vanishing point detection which our approach can not recover from. 5 Conclusions We have proposed a partitioning strategy followed by a message passing algorithm which is able to speed-up significantly dual decomposition methods for parallel inference in Markov random fields with high-order terms and dense connections. We demonstrate the effectiveness of our approach on the task of joint layout and semantic segmentation estimation from single images, and show that our approach is orders of magnitude faster than existing methods. In the future, we plan to investigate the applicability of our approach to other scene understanding tasks. References [1] A. Amini, T. Wymouth, and R. Jain. Using Dynamic Programming for Solving Variational Problems in Vision. PAMI, 1990. [2] D. Batra, S. Nowozin, and P. Kohli. Tighter Relaxations for MAP-MRF Inference: A Local Primal-Dual Gap based Separation Algorithm. In Proc. AISTATS, 2011. [3] Y. Boykov, O. Veksler, and R. Zabih. Fast Approximate Energy Minimization via Graph Cuts. PAMI, 2001. [4] M. Collins. Head-Driven Statistical Models for Natural Language Parsing. Computational Linguistics, 2003. [5] R. Dechter. Reasoning with Probabilistic and Deterministic Graphical Models: Exact Algorithms. Morgan & Claypool, 2013. [6] G. Elidan, I. McGraw, and D. Koller. Residual belief propagation: Informed scheduling for asynchronous message passing. In Proc. UAI, 2006. [7] L. R. Ford and D. R. Fulkerson. Maximal flow through a network. Canadian Journal of Mathematics, 1956. [8] T. Hazan and T. Jaakkola. On the Partition Function and Random Maximum A-Posteriori Perturbations. In Proc. ICML, 2012. [9] T. Hazan and A. Shashua. Norm-Product Belief Propagation: Primal-Dual Message-Passing for LPRelaxation and Approximate-Inference. Trans. Information Theory, 2010. 8 [10] P. Kohli and P. Kumar. Energy Minimization for Linear Envelope MRFs. In Proc. CVPR, 2010. [11] P. Kohli, L. Ladick`y, and P. H. S. Torr. Robust higher order potentials for enforcing label consistency. IJCV, 2009. [12] D. Koller and N. Friedman. Probabilistic Graphical Models: Principles and Techniques. MIT Press, 2009. [13] N. Komodakis, N. Paragios, and G. Tziritas. MRF Optimization via Dual Decomposition: MessagePassing Revisited. In Proc. ICCV, 2007. [14] P. Kr¨ahenb¨uhl and V. Koltun. Efficient Inference in Fully Connected CRFs with Gaussian Edge Potentials. In Proc. NIPS, 2011. [15] D. C. Lee, A. Gupta, M. Hebert, and T. Kanade. Estimating Spatial Layout of Rooms using Volumetric Reasoning about Objects and Surfaces. In Proc. NIPS, 2010. [16] V. Lempitsky, C. Rother, S. Roth, and A. Blake. Fusion Moves for Markov Random Field Optimization. PAMI, 2010. [17] Y. Li, D. Tarlow, and R. Zemel. Exploring compositional high order pattern potentials for structured output learning. In Proc. CVPR, 2013. [18] T. Meltzer, A. Globerson, and Y. Weiss. Convergent Message Passing Algorithms: a unifying view. In Proc. UAI, 2009. [19] J. Pearl. Probabilistic Reasoning in Intelligent Systems: Networks of Plausible Inference. Morgan Kaufmann, 1988. [20] M. Salzmann. Continuous Inference in Graphical Models with Polynomial Energies. In Proc. CVPR, 2013. [21] M. Salzmann and R Urtasun. Beyond feature points: structured prediction for monocular non-rigid 3d reconstruction. In Proc. ECCV, 2012. [22] A. G. Schwing, T. Hazan, M. Pollefeys, and R. Urtasun. Distributed Message Passing for Large Scale Graphical Models. In Proc. CVPR, 2011. [23] A. G. Schwing, T. Hazan, M. Pollefeys, and R. Urtasun. Efficient Structured Prediction for 3D Indoor Scene Understanding. In Proc. CVPR, 2012. [24] N. Silberman, D. Hoiem, P. Kohli, and R. Fergus. Indoor Segmentation and Support Inference from RGBD Images. In Proc. ECCV, 2012. [25] D. A. Smith and J. Eisner. Dependency parsing by belief propagation. In Proc. EMNLP, 2008. [26] D. Sontag, D. K. Choe, and Y. Li. Efficiently Searching for Frustrated Cycles in MAP Inference. In Proc. UAI, 2012. [27] D. Sontag and T. Jaakkola. New Outer Bounds on the Marginal Polytope. In Proc. NIPS, 2007. [28] D. Sontag, T. Meltzer, A. Globerson, and T. Jaakkola. Tightening LP Relaxations for MAP using Message Passing. In Proc. NIPS, 2008. [29] D. Sun, C. Liu, and H. Pfister. Local Layering for Joint Motion Estimation and Occlusion Detection. In Proc. CVPR, 2014. [30] C. Sutton and A. McCallum. Improved dynamic schedules for belief propagation. In Proc. UAI, 2007. [31] P. Tseng and D. P. Bertsekas. Relaxation Methods for Problems with Strictly Convex Separable Costs and Linear Constraints. Mathematical Programming, 1987. [32] L. Valgaerts, A. Bruhn, H. Zimmer, J. Weickert, C. Stroll, and C. Theobalt. Joint Estimation of Motion, Structure and Geometry from Stereo Sequences. In Proc. ECCV, 2010. [33] V. Vineet and P. H. S. Torr J. Warrell. Filter-based Mean-Field Inference for Random Fields with Higher Order Terms and Product Label-Spaces. In Proc. ECCV, 2012. [34] M. J. Wainwright and M. I. Jordan. Graphical Models, Exponential Families and Variational Inference. Foundations and Trends in Machine Learning, 2008. [35] Y. Weiss, C. Yanover, and T. Meltzer. MAP Estimation, Linear Programming and Belief Propagation with Convex Free Energies. In Proc. UAI, 2007. [36] C. Yanover, O. Schueler-Furman, and Y. Weiss. Minimizing and Learning Energy Functions for SideChain Prediction. J. of Computational Biology, 2008. [37] J. Yao, S. Fidler, and R. Urtasun. Describing the scene as a whole: Joint object detection, scene classification and semantic segmentation. In Proc. CVPR, 2012. [38] J. Zhang, K. Chen, A. G. Schwing, and R. Urtasun. Estimating the 3D Layout of Indoor Scenes and its Clutter from Depth Sensors. In Proc. ICCV, 2013. 9
2014
310
5,415
Weighted importance sampling for off-policy learning with linear function approximation A. Rupam Mahmood, Hado van Hasselt, Richard S. Sutton Reinforcement Learning and Artificial Intelligence Laboratory University of Alberta Edmonton, Alberta, Canada T6G 1S2 {ashique,vanhasse,sutton}@cs.ualberta.ca Abstract Importance sampling is an essential component of off-policy model-free reinforcement learning algorithms. However, its most effective variant, weighted importance sampling, does not carry over easily to function approximation and, because of this, it is not utilized in existing off-policy learning algorithms. In this paper, we take two steps toward bridging this gap. First, we show that weighted importance sampling can be viewed as a special case of weighting the error of individual training samples, and that this weighting has theoretical and empirical benefits similar to those of weighted importance sampling. Second, we show that these benefits extend to a new weighted-importance-sampling version of offpolicy LSTD(λ). We show empirically that our new WIS-LSTD(λ) algorithm can result in much more rapid and reliable convergence than conventional off-policy LSTD(λ) (Yu 2010, Bertsekas & Yu 2009). 1 Importance sampling and weighted importance sampling Importance sampling (Kahn & Marshall 1953, Rubinstein 1981, Koller & Friedman 2009) is a wellknown Monte Carlo technique for estimating an expectation under one distribution given samples from a different distribution. Consider that data samples Yk 2 R are generated i.i.d. from a sample distribution l, but we are interested in estimating the expected value of these samples, vg .= EEEg [Yk], under a different distribution g. In importance sampling this is achieved simply by averaging the samples weighted by the ratio of their likelihoods ⇢k .= g(Yk) l(Yk) , called the importance-sampling ratio. That is, vg is estimated as: ˜vg .= Pn k=1 ⇢kYk n . (1) This is an unbiased estimate because each of the samples it averages is unbiased: EEEl [⇢kYk] = Z y l(y)g(y) l(y) y dy = Z y g(y)y dy = EEEg [Yk] = vg . Unfortunately, this importance sampling estimate is often of unnecessarily high variance. To see how this can happen, consider a case in which the samples Yk are all nearly the same (under both distributions) but the importance-sampling ratios ⇢k vary greatly from sample to sample. This should be an easy case because the samples are so similar for the two distributions, but importance sampling will average the ⇢kYk, which will be of high variance, and thus its estimates will also be of high variance. In fact, without further bounds on the importance-sampling ratios, ˜vg may have infinite variance (Andrad´ottir et al. 1995, Robert & Casella 2004). An important variation on importance sampling that often has much lower variance is weighted importance sampling (Rubinstein 1981, Koller & Friedman 2009). The weighted importance sampling 1 (WIS) estimate vg as a weighted average of the samples with importance-sampling ratios as weights: ˆvg .= Pn k=1 ⇢kYk Pn k=1 ⇢k . This estimate is biased, but consistent (asymptotically correct) and typically of much lower variance than the ordinary importance-sampling (OIS) estimate, as acknowledged by many authors (Hesterberg 1988, Casella & Robert 1998, Precup, Sutton & Singh 2000, Shelton 2001, Liu 2001, Koller & Friedman 2009). For example, in the problematic case sketched above (near constant Yk, widely varying ⇢k) the variance of the WIS estimate will be related to the variance of Yk. Note also that when the samples are bounded, the WIS estimate has bounded variance, because the estimate itself is bounded by the highest absolute value of Yk, no matter how large the ratios ⇢k are (Precup, Sutton & Dasgupta 2001). Although WIS is the more successful importance sampling technique, it has not yet been extended to parametric function approximation. This is problematic for applications to off-policy reinforcement learning, in which function approximation is viewed as essential for large-scale applications to sequential decision problems with large state and action spaces. Here an important subproblem is the approximation of the value function—the expected sum of future discounted rewards as a function of state—for a designated target policy that may differ from that used to select actions. The existing methods for off-policy value-function approximation either use OIS (Maei & Sutton 2010, Yu 2010, Sutton et al. 2014, Geist & Scherrer 2014, Dann et al. 2014) or use WIS but are limited to the tabular or non-parametric case (Precup et al. 2000, Shelton 2001). How to extend WIS to parametric function approximation is important, but far from clear (as noted by Precup et al. 2001). 2 Importance sampling for linear function approximation In this section, we take the first step toward bridging the gap between WIS and off-policy learning with function approximation. In a general supervised learning setting with linear function approximation, we develop and analyze two importance-sampling methods. Then we show that these two methods have theoretical properties similar to those of OIS and WIS. In the fully-representable case, one of the methods becomes equivalent to the OIS estimate and the other to the WIS estimate. The key idea is that OIS and WIS can be seen as least-squares solutions to two different empirical objectives. The OIS estimate is the least-squares solution to an empirical mean-squared objective where the samples are importance weighted: ˜vg = arg min v 1 n n X k=1 (⇢kYk −v)2 =) n X k=1 (⇢kYk −˜vg) = 0 =) ˜vg = Pn k=1 ⇢kYk n . (2) Similarly, the WIS estimate is the least-squares solution to an empirical mean-squared objective where the individual errors are importance weighted: ˆvg = arg min v 1 n n X k=1 ⇢k (Yk −v)2 =) n X k=1 ⇢k (Yk −ˆvg) = 0 =) ˆvg = Pn k=1 ⇢kYk Pn k=1 ⇢k . (3) We solve similar empirical objectives in a general supervised learning setting with linear function approximation to derive the two new methods. Consider two correlated random variables Xk and Yk, where Xk takes values from a finite set X, and where Yk 2 R. We want to estimate the conditional expectation of Yk for each x 2 X under a target distribution gY |X. However, the samples (Xk, Yk) are generated i.i.d. according to a joint sample distribution lXY (·) with conditional probabilities lY |X that may differ from the conditional target distribution. Each input is mapped to a feature vector φk .= φ(Xk) 2 Rm, and the goal is to estimate the expectation EEEgY |X[Yk | Xk = x] as a linear function of the features ✓>φ(x) ⇡vg(x) .= EEEgY |X [Yk|Xk = x] . Estimating this expectation is again difficult because the target joint distribution of the input-output pairs gXY can be different than the sample joint distribution lXY . Generally, the discrepancy in 2 the joint distribution may arise from two sources: difference in marginal distribution of inputs, gX 6= lX, and difference in the conditional distribution of outputs, gY |X 6= lY |X. Problems where only the former discrepancy arise are known as covariate shift problems (Shimodaira 2000). In these problems the conditional expectation of the outputs is assumed unchanged between the target and the sample distributions. In off-policy learning problems, the discrepancy between conditional probabilities is more important. Most off-policy learning methods correct only the discrepancy between the target and the sample conditional distributions of outputs (Hachiya et al. 2009, Maei & Sutton 2010, Yu 2010, Maei 2011, Geist & Scherrer 2014, Dann et al. 2014). In this paper, we also focus only on correcting the discrepancy between the conditional distributions. The problem of estimating vg(x) as a linear function of features using samples generated from l can be formulated as the minimization of the mean squared error (MSE) where the solution is as follows: ✓⇤˙= arg min ✓ EEElX ⇣ EEEgY |X [Yk|Xk] −✓>φk ⌘2' = EEElX ⇥ φkφ> k ⇤−1 EEElX ⇥ EEEgY |X [Yk|Xk] φk ⇤ . (4) Similar to the empirical mean-squared objectives defined in (2) and (3), two different empirical objectives can be defined to approximate this solution. In one case the importance weighting is applied to the output samples, Yk, and in the other case the importance weighting is applied to the error, Yk −✓>φk, ˜Jn(✓) .= 1 n n X k=1 ⇣ ⇢kYk −✓>φk ⌘2 ; ˆJn(✓) .= 1 n n X k=1 ⇢k ⇣ Yk −✓>φk ⌘2 , where importance-sampling ratios are defined by ⇢k .= gY |X(Yk|Xk)/lY |X(Yk|Xk). We can minimize these objectives by equating the derivatives of the above empirical objectives to zero. Provided the relevant matrix inverses exist, the resulting solutions are, respectively ˜✓n .= n X k=1 φkφ> k !−1 n X k=1 ⇢kYkφk , and (5) ˆ✓n .= n X k=1 ⇢kφkφ> k !−1 n X k=1 ⇢kYkφk . (6) We call ˜✓the OIS-LS estimator and ˆ✓the WIS-LS estimator. A least-squares method similar to WIS-LS above was introduced for covariate shift problems by Hachiya, Sugiyama and Ueda (2012). Although superficially similar, that method uses importancesampling ratios to correct for the discrepancy in the marginal distributions of inputs, whereas WIS-LS corrects for the discrepancy in the conditional expectations of the outputs. For the fullyrepresentable case, unlike WIS-LS, the method of Hachiya et al. becomes an ordinary Monte Carlo estimator with no importance sampling. 3 Analysis of the least-squares importance-sampling methods The two least-squares importance-sampling methods have properties similar to those of the OIS and the WIS methods. In Theorems 1 and 2, we prove that when vg can be represented as a linear function of the features, then OIS-LS is an unbiased estimator of ✓⇤, whereas WIS-LS is a biased estimator, similar to the WIS estimator. If the solution is not linearly representable, least-squares methods are not generally unbiased. In Theorem 3 and 4, we show that both least-squares estimators are consistent for ✓⇤. Finally, we demonstrate that the least-squares methods are generalizations of OIS and WIS by showing, in Theorem 5 and 6, that in the fully representable case (when the features form an orthonormal basis) OIS-LS is equivalent to OIS and WIS-LS is equivalent to WIS. Theorem 1. If vg is a linear function of the features, that is, vg(x) = ✓> ⇤φ(x), then OIS-LS is an unbiased estimator, that is, EEElXY [˜✓n] = ✓⇤. Theorem 2. Even if vg is a linear function of the features, that is, vg(x) = ✓> ⇤φ(x), WIS-LS is in general a biased estimator, that is, EEElXY [ˆ✓n] 6= ✓⇤. 3 Theorem 3. The OIS-LS estimator ˜✓n is a consistent estimator of the MSE solution ✓⇤given in (4). Theorem 4. The WIS-LS estimator ˆ✓n is a consistent estimator of the MSE solution ✓⇤given in (4). Theorem 5. If the features form an orthonormal basis, then the OIS-LS estimate ˜✓ > n φ(x) of input x is equivalent to the OIS estimate of the outputs corresponding to x. Theorem 6. If the features form an orthonormal basis, then the WIS-LS estimate ˆ✓ > n φ(x) of input x is equivalent to the WIS estimate of the outputs corresponding to x. Proofs of Theorem 1-6 are given in the Appendix. The WIS-LS estimate is perhaps the most interesting of the two least-squares estimates, because it generalizes WIS to parametric function approximation for the first time and extends its advantages. 4 A new off-policy LSTD(λ) with WIS In sequential decision problems, off-policy learning methods based on important sampling can suffer from the same high-variance issues as discussed above for the supervised case. To address this, we extend the idea of WIS-LS to off-policy reinforcement learning and construct a new off-policy WISLSTD(λ) algorithm. We first explain the problem setting. Consider a learning agent that interacts with an environment where at each step t the state of the environment is St and the agent observes a feature vector φt .= φ(St) 2 Rm. The agent takes an action At based on a behavior policy b(·|St), that is typically a function of the state features. The environment provides the agent a scalar (reward) signal Rt+1 and transitions to state St+1. This process continues, generating a trajectory of states, actions and rewards. The goal is to estimate the values of the states under the target policy ⇡, defined as the expected returns given by the sum of future discounted rewards: v⇡(s) .= EEE " 1 X t=0 Rt+1 tY k=1 γ(Sk) | S0 = s, At ⇠⇡(·|St), 8t # , where γ(Sk) 2 [0, 1] is a state-dependent degree of discounting on arrival in Sk (as in Sutton et al. 2014). We assume the rewards and discounting are chosen such that v⇡(s) is well-defined and finite. Our primary objective is to estimate v⇡as a linear function of the features: v⇡(s) ⇡✓>φ(s), where ✓2 Rm is a parameter vector to be estimated. As before, we need to correct for the difference in sample distribution resulting from the behavior policy and the target distribution as induced by the target policy. Consider a partial trajectory from time step k to time t, consisting of a sequence Sk, Ak, Rk, Sk+1, . . . , St. The probability of this trajectory occurring given it starts at Sk under the target policy will generally differ from its probability under the behavior policy. The importancesampling ratio ⇢t k is defined to be the ratio of these probabilities. This importance-sampling ratio can be written in terms of the product of action-selection probabilities without needing a model of the environment (Sutton & Barto 1998): ⇢t k .= Qt−1 i=k ⇡(Ai|Si) Qt−1 i=k b(Ai|Si) = t−1 Y i=k ⇡(Ai|Si) b(Ai|Si) = t−1 Y i=k ⇢i , where we use the shorthand ⇢i .= ⇢i+1 i = ⇡(Ai|Si)/b(Ai|Si). We incorporate a common technique to reinforcement learning (RL) where updates are estimated by bootstrapping, fully or partially, on previously constructed state-value estimates. Bootstrapping potentially reduces the variance of the updates compared to using full returns and makes RL algorithms applicable to non-episodic tasks. In this paper we assume that the bootstrapping parameter λ(s) 2 [0, 1] may depend on the state s (as in Sutton & Barto 1998, Maei & Sutton 2010). In the following, we use the notational shorthands γk .= γ(Sk) and λk .= λ(Sk). Following Sutton et al. (2014), we construct an empirical loss as a sum of pairs of squared corrected and uncorrected errors, each corresponding to a different number of steps of lookahead, and each weighted as a function of the intervening discounting and bootstrapping. Let Gt k .= Rk+1 +. . .+Rt be the undiscounted return truncated after looking ahead t −k steps. Imagine constructing the 4 empirical loss for time 0. After leaving S0 and observing R1 and S1, the first uncorrected error is G1 0 −✓>φ0, with weight equal to the probability of terminating 1 −γ1. If we do not terminate, then we continue to S1 and form the first corrected error G1 0 + v>φ1 −✓>φ0 using the bootstrapping estimate v>φ1. The weight on this error is γ1(1−λ1), and the parameter vector v may differ from ✓. Continuing to the next time step, we obtain the second uncorrected error G2 0 −✓>φ0 and the second corrected error G2 0+v>φ2−✓>φ0, with respective weights γ1λ1(1−γ2) and γ1λ1γ2(1−λ2). This goes on until we reach the horizon of our data, say at time t, when we bootstrap fully with v>φt, generating a final corrected return error of Gt 0 + v>φt −✓>φ0 with weight γ1λ1 · · · γt−1λt−1γt. The general form for the uncorrected error is ✏t k(✓) .= Gt k −✓>φk, and the general form for the corrected error is ¯δt k(✓, v) .= Gt k + v>φt −✓>φk. All these errors could be squared, weighted by their weights, and summed to form the overall empirical loss. In the off-policy case, we need to also weight the squares of the errors ✏t k and ¯δt k by the importance-sampling ratio ⇢t k. Hence, the overall empirical loss at time k for data up to time t can be written as `t k(✓, v) .= ⇢k t−1 X i=k+1 Ci−1 k  (1 −γi) ⇣ ✏i k(✓) ⌘2 + γi(1 −λi) ⇣ ¯δi k(✓, v) ⌘2% + ⇢kCt−1 k h (1 −γt) ' ✏t k(✓) (2 + γt '¯δt k(✓, v) (2i , where Ct k .= t Y j=k+1 γjλj⇢j. This loss differs from that used by other LSTD(λ) methods in that importance weighting is applied to the individual errors within `t k(✓, v). Now, we are ready to state the least-squares problem. As noted by Geist & Scherrer (2014), LSTD(λ) methods can be derived by solving least-squares problems where estimates at each step are matched with multi-step returns starting from those steps given that bootstrapping is done using the solution itself. Our proposed new method, called WIS-LSTD(λ), computes at each time t the solution to the least-squares problem: ✓t .= arg min ✓ t−1 X k=0 `t k(✓, ✓t). At the solution, the derivative of the objective is zero: @ @✓ Pt−1 k=0 `t k(✓, ✓t) 00 ✓=✓t = −Pt−1 k=0 2δ⇢ k,t(✓t, ✓t)φk = 0, where the errors δ⇢ k,t are defined by δ⇢ k,t(✓, v) .= ⇢k t−1 X i=k+1 Ci−1 k ⇥ (1 −γi)✏i k(✓) + γi(1 −λi)¯δi k(✓, v) ⇤ + ⇢kCt−1 k ⇥ (1 −γt)✏t k(✓) + γt¯δt k(✓, v) ⇤ . Next, we separate the terms of δ⇢ k,t(✓t, ✓t)φk that involve ✓t from those that do not: δ⇢ k,t(✓t, ✓t)φk = bk,t −Ak,t✓t, where bk,t 2 Rm, Ak,t 2 Rm⇥m and they are defined as bk,t .= ⇢k t−1 X i=k+1 Ci−1 k (1 −γiλi)Gi kφk + ⇢kCt−1 k Gt kφk, Ak,t .= ⇢k t−1 X i=k+1 Ci−1 k φk((1 −γiλi)φk −γi(1 −λi)φi)> + ⇢kCt−1 k φk(φk −γtφt)>. Therefore, the solution can be found as follows: t−1 X k=0 (bk,t −Ak,t✓t) = 0 =) ✓t = A−1 t bt, where At .= t−1 X k=0 Ak,t, bt .= t−1 X k=0 bk,t. (7) In the following we show that WIS-LS is a special case of the above algorithm defined by (7). As Theorem 6 shows that WIS-LS generalizes WIS, it follows that the above algorithm generalizes WIS as well. Theorem 7. At termination, the algorithm defined by (7) is equivalent to the WIS-LS method in the sense that if λ0 = · · · = λt = γ0 = · · · = γt−1 = 1 and γt = 0, then ✓t defined in (7) equals ˆ✓t as defined in (6), with Yk .= Gt k. (Proved in the Appendix). 5 Our last challenge is to find an equivalent efficient online algorithm for this method. The solution in (7) cannot be computed incrementally in this form. When a new sample arrives at time t+1, Ak,t+1 and bk,t+1 have to be computed for each k = 0, . . . , t, and hence the computational complexity of this solution grows with time. It would be preferable if the solution at time t + 1 could be computed incrementally based on the estimates from time t, requiring only constant computational complexity per time step. It is not immediately obvious such an efficient update exists. For instance, for λ = 1 this method achieves full Monte Carlo (weighted) importance-sampling estimation, which means whenever the target policy deviates from the behavior policy all previously made updates have to be unmade so that no updates are made towards a trajectory which is impossible under the target policy. Sutton et al. (2014) show it is possible to derive efficient updates in some cases with the use of provisional parameters which keep track of the provisional updates that might need to be unmade when a deviation occurs. In the following, we show that using such provisional parameters it is also possible to achieve an equivalent efficient update for (7). We first write both bk,t and Ak,t recursively in t (derivations in Appendix A.8): bk,t+1 = bk,t + ⇢kCt kRt+1φk + (⇢t −1)γtλt⇢kCt−1 k Gt kφk, Ak,t+1 = Ak,t + ⇢kCt kφk(φt −γt+1φt+1)> + (⇢t −1)γtλt⇢kCt−1 k φk(φk −φt)>. Using the above recursions, we can write the updates of both bt and At incrementally. The vector bt can be updated incrementally as bt+1 = t X k=0 bk,t+1 = t−1 X k=0 bk,t+1 + bt,t+1 = t−1 X k=1 bk,t + ⇢tRt+1φt + Rt+1 t−1 X k=1 ⇢kCt kφk + (⇢t −1)γtλt t−1 X k=1 ⇢kCt−1 k Gt kφk = bt + Rt+1et + (⇢t −1)ut, (8) where the eligibility trace et 2 Rm and the provisional vector ut 2 Rm are defined as follows: et = ⇢tφt + t−1 X k=1 ⇢kCt kφk = ⇢tφt + ⇢tγtλt ⇢t−1φt−1 + t−2 X k=1 ⇢kCt−1 k φk ! = ⇢t(φt + γtλtet−1), (9) ut = γtλt t−1 X k=1 ⇢kCt−1 k Gt kφk = γtλt ⇢t−1γt−1λt−1 t−2 X k=1 ⇢kCt−2 k Gt−1 k φk + Rt t−2 X k=1 ⇢kCt−1 k φk + ⇢t−1Rtφt−1 ! = γtλt (⇢t−1ut−1 + Rtet−1) . (10) The matrix At can be updated incrementally as At+1 = t X k=0 Ak,t+1 = t−1 X k=0 Ak,t+1 + At,t+1 = t−1 X k=0 Ak,t + ⇢tφt(φt −γt+1φt+1)> + t−1 X k=1 ⇢kCt kφk(φt −γt+1φt+1)> + (⇢t −1)γtλt t−1 X k=1 ⇢kCt−1 k φk(φk −φt)> = At + et(φt −γt+1φt+1)> + (⇢t −1)Vt, (11) where the provisional matrix Vt 2 Rm⇥m is defined as Vt = γtλt t−1 X k=1 ⇢kCt−1 k φk(φk −φt)> = γtλt ⇢t−1γt−1λt−1 t−2 X k=1 ⇢kCt−2 k φk(φk −φt−1)> + t−2 X k=1 ⇢kCt−1 k φk(φt−1 −φt)> + ⇢t−1φt−1(φt−1 −φt)> ! = γtλt 1 ⇢t−1Vt−1 + et−1(φt−1 −φt)>2 . (12) Then the parameter vector can be updated as: ✓t+1 = (At+1)−1 bt+1. (13) Equations (8–13) comprise our WIS-LSTD(λ). Its per-step computational complexity is O(m3), where m is the number of features. The computational cost of this method does not increase with time. At present we are unsure whether or not there is an O(m2) implementation. 6 Theorem 8. The off-policy LSTD(λ) method defined in (8–13) is equivalent to the off-policy LSTD(λ) method defined in (7) in the sense that they compute the same ✓t at each time t. Proof. The result follows immediately from the above derivation. It is easy to see that in the on-policy case this method becomes equivalent to on-policy LSTD(λ) (Boyan 1999) by noting that the third term of both bt and At updates in (8) and (11) becomes zero, because in the on-policy case all the importance-sampling ratios are 1. Recently Dann et al. (2014) proposed another least-squares based off-policy method called recursive LSTD-TO(λ). Unlike our algorithm, that algorithm does not specialize to WIS in the fully representable case, and it does not seem as closely related to WIS. The Adaptive Per-Decision Importance Weighting (APDIW) method by Hachiya et al. (2009) is superficially similar to WIS-LSTD(λ), there are several important differences. APDIW is a one-step method that always fully bootstraps whereas WIS-LSTD(λ) covers the full spectrum of multi-step backups including both one-step backup and Monte Carlo update. In the fully representable case, APDIW does not become equivalent to the WIS estimate, whereas WIS-LSTD(1) does. Moreover, APDIW does not find a consistent estimation of the off-policy target whereas WIS algorithms do. 5 Experimental results We compared the performance of the proposed WIS-LSTD(λ) method with the conventional offpolicy LSTD(λ) by Yu (2010) on two random-walk tasks for off-policy policy evaluation. These random-walk tasks consist of a Markov chain with 11 non-terminal and two terminal states. They can be imagined to be laid out horizontally, where the two terminal states are at the left and the right ends of the chain. From each non-terminal state, there are two actions available: left, which leads to the state to the left and right, which leads to the state to the right. The reward is 0 for all transitions except for the rightmost transition to the terminal state, where it is +1. The initial state was set to the state in the middle of the chain. The behavior policy chooses an action uniformly randomly, whereas the target policy chooses the right action with probability 0.99. The termination function γ was set to 1 for the non-terminal states and 0 for the terminal states. We used two tasks based on this Markov chain in our experiments. These tasks differ by how the non-terminal states were mapped to features. The terminal states were always mapped to a vector with all zero elements. For each non-terminal state, the features were normalized so that the L2 norm of each feature vector was one. For the first task, the feature representation was tabular, that is, the feature vectors were standard basis vectors. In this representation, each feature corresponded to only one state. For the second task, the feature vectors were binary representations of state indices. There were 11 non-terminal states, hence each feature vector had blog2(11)c + 1 = 4 components. These vectors for the states from left to right were (0, 0, 0, 1)>, (0, 0, 1, 0)>, (0, 0, 1, 1)>, . . . , (1, 0, 1, 1)>, which were then normalized to get unit vectors. These features heavily underrepresented the states, due to the fact that 11 states were represented by only 4 features. We tested both algorithms for different values of constant λ, from 0 to 0.9 in steps of 0.1 and from 0.9 to 1.0 in steps of 0.025. The matrix to be inverted in both methods was initialized to ✏I, where the regularization parameter ✏was varied by powers of 10 with powers chosen from -3 to +3 in steps of 0.2. Performance was measured as the empirical mean squared error (MSE) between the estimated value of the initial state and its true value under the target policy projected to the space spanned by the given features. This error was measured at the end of each of 200 episodes for 100 independent runs. Figure 1 shows the results for the two tasks in terms of empirical convergence rate, optimum performance and parameter sensitivity. Each curve shows MSE together with standard errors. The first row shows results for the tabular task and the second row shows results for the function approximation task. The first column shows learning curves using (λ, ✏) = (0, 1) for the first task and (0.95, 10) for the second. It shows that in both cases WIS-LSTD(λ) learned faster and gave lower error throughout the period of learning. The second column shows performance with respect to different λ optimized over ✏. The x-axis is plotted in a reverse log scale, where higher values are more spread out than the lower values. In both tasks, WIS-LSTD(λ) outperformed the conventional LSTD(λ) for all values of λ. For the best parameter setting (best λ and ✏), WIS-LSTD(λ) outperformed LSTD(λ) by an order 7 MSE MSE MSE MSE MSE MSE episodes λ — ... ‒‒ 0.0 0.5 0.9 λ — ... ‒‒ 0.5 0.9 1.0 Tabular task Func. approx. task off-policy LSTD( ) WIS-LSTD( ) λ λ regularization parameter ✏ episodes regularization parameter ✏ WIS-LSTD( ) off-policy LSTD( ) λ λ λ λ Figure 1: Empirical comparison of our WIS-LSTD(λ) with conventional off-policy LSTD(λ) on two random-walk tasks. The empirical Mean Squared Error shown is for the initial state at the end of each episode, averaged over 100 independent runs (and also over 200 episodes in column 2 and 3). of magnitude. The third column shows performance with respect to the regularization parameter ✏ for three representative values of λ. For a wide range of ✏, WIS-LSTD(λ) outperformed conventional LSTD(λ) by an order of magnitude. Both methods performed similarly for large ✏, as such large values essentially prevent learning for a long period of time. In the function approximation task when smaller values of ✏were chosen, λ close to 1 led to more stable estimates, whereas smaller λ introduced high variance for both methods. In both tasks, the better-performing regions of ✏(the U-shaped depressions) were wider for WIS-LSTD(λ). 6 Conclusion Although importance sampling is essential to off-policy learning and has become a key part of modern reinforcement learning algorithms, its most effective form—WIS—has been neglected because of the difficulty of combining it with parametric function approximation. In this paper, we have begun to overcome these difficulties. First, we have shown that the WIS estimate can be viewed as the solution to an empirical objective where the squared errors of individual samples are weighted by the importance-sampling ratios. Second, we have introduced a new method for general supervised learning called WIS-LS by extending the error-weighted empirical objective to linear function approximation and shown that the new method has similar properties as those of the WIS estimate. Finally, we have introduced a new off-policy LSTD algorithm WIS-LSTD(λ) that extends the benefits of WIS to reinforcement learning. Our empirical results show that the new WIS-LSTD(λ) can outperform Yu’s off-policy LSTD(λ) in both tabular and function approximation tasks and shows robustness in terms of its parameters. An interesting direction for future work is to extend these ideas to off-policy linear-complexity methods. Acknowledgement This work was supported by grants from Alberta Innovates Technology Futures, National Science and Engineering Research Council, and Alberta Innovates Centre for Machine Learning. 8 References Andrad´ottir, S., Heyman, D. P., Ott, T. J. (1995). On the choice of alternative measures in importance sampling with markov chains. Operations Research, 43(3):509–519. Bertsekas, D. P., Yu, H. (2009). Projected equation methods for approximate solution of large linear systems. Journal of Computational and Applied Mathematics, 227(1):27–50. Boyan, J. A. (1999). Least-squares temporal difference learning. In Proceedings of the 17th International Conference, pp. 49–56. Casella, G., Robert, C. P. (1998). Post-processing accept-reject samples: recycling and rescaling. Journal of Computational and Graphical Statistics, 7(2):139–157. Dann, C., Neumann, G., Peters, J. (2014). Policy evaluation with temporal differences: a survey and comparison. Journal of Machine Learning Research, 15:809–883. Geist, M., Scherrer, B. (2014). Off-policy learning with eligibility traces: A survey. Journal of Machine Learning Research, 15:289–333. Hachiya, H., Akiyama, T., Sugiayma, M., Peters, J. (2009). Adaptive importance sampling for value function approximation in off-policy reinforcement learning. Neural Networks, 22(10):1399–1410. Hachiya, H., Sugiyama, M., Ueda, N. (2012). Importance-weighted least-squares probabilistic classifier for covariate shift adaptation with application to human activity recognition. Neurocomputing, 80:93–101. Hesterberg, T. C. (1988), Advances in importance sampling, Ph.D. Dissertation, Statistics Department, Stanford University. Kahn, H., Marshall, A. W. (1953). Methods of reducing sample size in Monte Carlo computations. In Journal of the Operations Research Society of America, 1(5):263–278. Koller, D., Friedman, N. (2009). Probabilistic Graphical Models: Principles and Techniques. MIT Press, 2009. Liu, J. S. (2001). Monte Carlo strategies in scientific computing. Berlin, Springer-Verlag. Maei, H. R., Sutton, R. S. (2010). GQ(λ): A general gradient algorithm for temporal-difference prediction learning with eligibility traces. In Proceedings of the Third Conference on Artificial General Intelligence, pp. 91–96. Atlantis Press. Maei, H. R. (2011). Gradient temporal-difference learning algorithms. PhD thesis, University of Alberta. Precup, D., Sutton, R. S., Singh, S. (2000). Eligibility traces for off-policy policy evaluation. In Proceedings of the 17th International Conference on Machine Learning, pp. 759–766. Morgan Kaufmann. Precup, D., Sutton, R. S., Dasgupta, S. (2001). Off-policy temporal-difference learning with function approximation. In Proceedings of the 18th International Conference on Machine Learning. Robert, C. P., and Casella, G., (2004). Monte Carlo Statistical Methods, New York, Springer-Verlag. Rubinstein, R. Y. (1981). Simulation and the Monte Carlo Method, New York, Wiley. Shelton, C. R. (2001). Importance Sampling for Reinforcement Learning with Multiple Objectives. PhD thesis, Massachusetts Institute of Technology. Shimodaira, H. (2000). Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of Statistical Planning and Inference, 90(2):227–244. Sutton, R. S., Barto, A. G. (1998). Reinforcement Learning: An Introduction. MIT Press. Sutton, R. S., Mahmood, A. R., Precup, D., van Hasselt, H. (2014). A new Q(λ) with interim forward view and Monte Carlo equivalence. In Proceedings of the 31st International Conference on Machine Learning, Beijing, China. Yu, H. (2010). Convergence of least squares temporal difference methods under general conditions. In Proceedings of the 27th International Conference on Machine Learning, pp. 1207–1214. 9
2014
311
5,416
Incremental Clustering: The Case for Extra Clusters Margareta Ackerman Florida State University 600 W College Ave, Tallahassee, FL 32306 mackerman@fsu.edu Sanjoy Dasgupta UC San Diego 9500 Gilman Dr, La Jolla, CA 92093 dasgupta@eng.ucsd.edu Abstract The explosion in the amount of data available for analysis often necessitates a transition from batch to incremental clustering methods, which process one element at a time and typically store only a small subset of the data. In this paper, we initiate the formal analysis of incremental clustering methods focusing on the types of cluster structure that they are able to detect. We find that the incremental setting is strictly weaker than the batch model, proving that a fundamental class of cluster structures that can readily be detected in the batch setting is impossible to identify using any incremental method. Furthermore, we show how the limitations of incremental clustering can be overcome by allowing additional clusters. 1 Introduction Clustering is a fundamental form of data analysis that is applied in a wide variety of domains, from astronomy to zoology. With the radical increase in the amount of data collected in recent years, the use of clustering has expanded even further, to applications such as personalization and targeted advertising. Clustering is now a core component of interactive systems that collect information on millions of users on a daily basis. It is becoming impractical to store all relevant information in memory at the same time, often necessitating the transition to incremental methods. Incremental methods receive data elements one at a time and typically use much less space than is needed to store the complete data set. This presents a particularly interesting challenge for unsupervised learning, which unlike its supervised counterpart, also suffers from an absence of a unique target truth. Observe that not all data possesses a meaningful clustering, and when an inherent structure exists, it need not be unique (see Figure 1 for an example). As such, different users may be interested in very different partitions. Consequently, different clustering methods detect distinct types of structure, often yielding radically different results on the same data. Until now, differences in the input-output behaviour of clustering methods have only been studied in the batch setting [12, 13, 8, 4, 3, 5, 2, 19]. In this work, we take a first look at the types of cluster structures that can be discovered by incremental clustering methods. To qualify the type of cluster structure present in data, a number of notions of clusterability have been proposed (for a detailed discussion, see [1] and [8]). These notions capture the structure of the target clustering: the clustering desired by the user for a specific application. As such, notions of clusterability facilitate the analysis of clustering methods by making it possible to formally ascertain whether an algorithm correctly recovers the desired partition. One elegant notion of clusterability, introduced by Balcan et al. [8], requires that every element be closer to data in its own cluster than to other points. For simplicity, we will refer to clusterings that adhere to this requirement as nice. It was shown by [8] that such clusterings are readily detected offline by classical batch algorithms. On the other hand, we prove (Theorem 3.8) that no incremental method can discover these partitions. Thus, batch algorithms are significantly stronger than incremental methods in their ability to detect cluster structure. 1 Figure 1: An example of different cluster structures in the same data. The clustering on the left finds inherent structure in the data by identifying well-separated partitions, while the clustering on the right discovers structure in the data by focusing on the dense region. The correct partitioning depends on the application at hand. In an effort to identify types of cluster structure that incremental methods can recover, we turn to stricter notions of clusterability. A notion used by Epter et al. [9] requires that the minimum separation between clusters be larger than the maximum cluster diameter. We call such clusterings perfect, and we present an incremental method that is able to recover them (Theorem 4.3). Yet, this result alone is unsatisfactory. If, indeed, it were necessary to resort to such strict notions of clusterability, then incremental methods would have limited utility. Is there some other way to circumvent the limitations of incremental techniques? It turns out that incremental methods become a lot more powerful when we slightly alter the clustering problem: if, instead of asking for exactly the target partition, we are satisfied with a refinement, that is, a partition each of whose clusters is contained within some target cluster. Indeed, in many applications, it is reasonable to allow additional clusters. Incremental methods benefit from additional clusters in several ways. First, we exhibit an algorithm that is able to capture nice k-clusterings if it is allowed to return a refinement with 2k−1 clusters (Theorem 5.3), which could be reasonable for small k. We also show that this exponential dependence on k is unavoidable in general (Theorem 5.4). As such, allowing additional clusters enables incremental techniques to overcome their inability to detect nice partitions. A similar phenomenon is observed in the analysis of the sequential k-means algorithm, one of the most popular methods of incremental clustering. We show that it is unable to detect perfect clusterings (Theorem 4.4), but that if each cluster contains a significant fraction of the data, then it can recover a refinement of (a slight variant of) nice clusterings (Theorem 5.6). Lastly, we demonstrate the power of additional clusters by relaxing the niceness condition, requiring only that clusters have a significant core (defined in Section 5.3). Under this milder requirement, we show that a randomized incremental method is able to discover a refinement of the target partition (Theorem 5.10). Due to space limitations, many proofs appear in the supplementary material. 2 Definitions We consider a space X equipped with a symmetric distance function d : X × X →R+ satisfying d(x, x) = 0. An example is X = Rp with d(x, x′) = ∥x −x′∥2. It is assumed that a clustering algorithm can invoke d(·, ·) on any pair x, x′ ∈X. A clustering (or, partition) of X is a set of clusters C = {C1, . . . , Ck} such that Ci ∩Cj = ∅for all i ̸= j, and X = ∪k i=1Ci. A k-clustering is a clustering with k clusters. Write x ∼C y if x, y are both in some cluster Cj; and x ̸∼C y otherwise. This is an equivalence relation. 2 Definition 2.1. An incremental clustering algorithm has the following structure: for n = 1, . . . , N: See data point xn ∈X Select model Mn ∈M where N might be ∞, and M is a collection of clusterings of X. We require the algorithm to have bounded memory, typically a function of the number of clusters. As a result, an incremental algorithm cannot store all data points. Notice that the ordering of the points is unspecified. In our results, we consider two types of ordering: arbitrary ordering, which is the standard setting in online learning and allows points to be ordered by an adversary, and random ordering, which is standard in statistical learning theory. In exemplar-based clustering, M = X k: each model is a list of k “centers” (t1, . . . , tk) that induce a clustering of X, where every x ∈X is assigned to the cluster Ci for which d(x, ti) is smallest (breaking ties by picking the smallest i). All the clusterings we will consider in this paper will be specified in this manner. We also note that the incremental clustering model is closely related to streaming clustering [6, 10], the primary difference being that in the latter framework multiple passes of the data are allowed. 2.1 Examples of incremental clustering algorithms The most well-known incremental clustering algorithm is probably sequential k-means, which is meant for data in Euclidean space. It is an incremental variant of Lloyd’s algorithm [16, 17]: Algorithm 2.2. Sequential k-means. Set T = (t1, . . . , tk) to the first k data points Initialize the counts n1, n2, ..., nk to 1 Repeat: Acquire the next example, x If ti is the closest center to x: Increment ni Replace ti by ti + (1/ni)(x −ti) This method, and many variants of it, have been studied intensively in the literature on selforganizing maps [15]. It attempts to find centers T that optimize the k-means cost function: cost(T) = X data x min t∈T ∥x −t∥2. It is not hard to see that the solution obtained by sequential k-means at any given time can have cost far from optimal; we will see an even stronger lower bound in Theorem 4.4. Nonetheless, we will also see that if additional centers are allowed, this algorithm is able to correctly capture some fundamental types of cluster structure. Another family of clustering algorithms with incremental variants are agglomerative procedures [12] like single-linkage [11]. Given n data points in batch mode, these algorithms produce a hierarchical clustering on all n points. But the hierarchy can be truncated at the intermediate k-clustering, yielding a tree with k leaves. Moreover, there is a natural scheme for updating these leaves incrementally: Algorithm 2.3. Sequential agglomerative clustering. Set T to the first k data points Repeat: Get the next point x and add it to T Select t, t′ ∈T for which dist(t, t′) is smallest Replace t, t′ by the single center merge(t, t′) Here the two functions dist and merge can be varied to optimize different clustering criteria, and often require storing additional sufficient statistics, such as counts of individual clusters. For instance, Ward’s method of average linkage [18] is geared towards the k-means cost function. We will consider the variant obtained by setting dist(t, t′) = d(t, t′) and merge(t, t′) to either t or t′: 3 Algorithm 2.4. Sequential nearest-neighbour clustering. Set T to the first k data points Repeat: Get the next point x and add it to T Let t, t′ be the two closest points in T Replace t, t′ by either of these two points We will see that this algorithm is effective at picking out a large class of cluster structures. 2.2 The target clustering Unlike supervised learning tasks, which are typically endowed with a unique correct classification, clustering is ambiguous. One approach to disambiguating clustering is identifying an objective function such as k-means, and then defining the clustering task as finding the partition with minimum cost. Although there are situations to which this approach is well-suited, many clustering applications do not inherently lend themselves to any specific objective function. As such, while objective functions play an essential role in deriving clustering methods, they do not circumvent the ambiguous nature of clustering. The term target clustering denotes the partition that a specific user is looking for in a data set. This notion was used by Balcan et al. [8] to study what constraints on cluster structure make them efficiently identifiable in a batch setting. In this paper, we consider families of target clusterings that satisfy different properties, and ask whether incremental algorithms can identify such clusterings. The target clustering C is defined on a possibly infinite space X, from which the learner receives a sequence of points. At any time n, the learner has seen n data points and has some clustering that ideally agrees with C on these points. The methods we consider are exemplar-based: they all specify a list of points T in X that induce a clustering of X (recall the discussion just before Section 2.1). We consider two requirements: • (Strong) T induces the target clustering C. • (Weaker) T induces a refinement of the target clustering C: that is, each cluster induced by T is part of some cluster of C. If the learning algorithm is run on a finite data set, then we require these conditions to hold once all points have been seen. In our positive results, we will also consider infinite streams of data, and show that these conditions hold at every time n, taking the target clustering restricted to the points seen so far. 3 A basic limitation of incremental clustering We begin by studying limitations of incremental clustering compared with the batch setting. One of the most fundamental types of cluster structure is what we shall call nice clusterings for the sake of brevity. Originally introduced by Balcan et al. [8] under the name “strict separation,” this notion has since been applied in [2], [1], and [7], to name a few. Definition 3.1 (Nice clustering). A clustering C of (X, d) is nice if for all x, y, z ∈X, d(y, x) < d(z, x) whenever x ∼C y and x ̸∼C z. See Figure 2 for an example. Observation 3.2. If we select one point from every cluster of a nice clustering C, the resulting set induces C. (Moreover, niceness is the minimal property under which this holds.) A nice k-clustering is not, in general, unique. For example, consider X = {1, 2, 4, 5} on the real line under the usual distance metric; then both {{1}, {2}, {4, 5}} and {{1, 2}, {4}, {5}} are nice 3-clusterings of X. Thus we start by considering data with a unique nice k-clustering. Since niceness is a strong requirement, we might expect that it is easy to detect. Indeed, in the batch setting, a unique nice k-clustering can be recovered by single-linkage [8]. However, we show that nice partitions cannot be detected in the incremental setting, even if they are unique. 4 Figure 2: A nice clustering may include clusters with very different diameters, as long as the distance between any two clusters scales as the larger diameter of the two. We start by formalizing the ordering of the data. An ordering function O takes a finite set X and returns an ordering of the points in this set. An ordered distance space is denoted by (O[X], d). Definition 3.3. An incremental clustering algorithm A is nice-detecting if, given a positive integer k and (X, d) that has a unique nice k-clustering C, the procedure A(O[X], d, k) outputs C for any ordering function O. In this section, we show (Theorem 3.8) that no deterministic memory-bounded incremental method is nice-detecting, even for points in Euclidean space under the ℓ2 metric. We start with the intuition behind the proof. Fix any incremental clustering algorithm and set the number of clusters to 3. We will specify a data set D with a unique nice 3-clustering that this algorithm cannot detect. The data set has two subsets, D1 and D2, that are far away from each other but are otherwise nearly isomorphic. The target 3-clustering is either: (D1, together with a 2-clustering of D2) or (D2, together with a 2-clustering of D1). The central piece of the construction is the configuration of D1 (and likewise, D2). The first point presented to the learner is xo. This is followed by a clique of points xi that are equidistant from each other and have the same, slightly larger, distance to xo. For instance, we could set distances within the clique d(xi, xj) to 1, and distances d(xi, xo) to 2. Finally there is a point x′ that is either exactly like one of the xi’s (same distances), or differs from them in just one specific distance d(x′, xj) which is set to 2. In the former case, there is a nice 2-clustering of D1, in which one cluster is xo and the other cluster is everything else. In the latter case, there is no nice 2-clustering, just the 1-clustering consisting of all of D1. D2 is like D1, but is rigged so that if D1 has a nice 2-clustering, then D2 does not; and vice versa. The two possibilities for D1 are almost identical, and it would seem that the only way an algorithm can distinguish between them is by remembering all the points it has seen. A memory-bounded incremental learner does not have this luxury. Formalizing this argument requires some care; we cannot, for instance, assume that the learner is using its memory to store individual points. In order to specify D1, we start with a larger collection of points that we call an M-configuration, and that is independent of any algorithm. We then pick two possibilities for D1 (one with a nice 2-clustering and one without) from this collection, based on the specific learner. Definition 3.4. In any metric space (X, d), for any integer M > 0, define an M-configuration to be a collection of 2M + 1 points xo, x1, . . . , xM, x′ 1, . . . , x′ M ∈X such that • All interpoint distances are in the range [1, 2]. • d(xo, xi), d(xo, x′ i) ∈(3/2, 2] for all i ≥1. • d(xi, xj), d(x′ i, x′ j), d(xi, x′ j) ∈[1, 3/2] for all i ̸= j ≥1. • d(xi, x′ i) > d(xo, xi). The significance of this point configuration is as follows. 5 Lemma 3.5. Let xo, x1, . . . , xM, x′ 1, . . . , x′ M be any M-configuration in (X, d). Pick any index 1 ≤j ≤M and any subset S ⊂[M] with |S| > 1. Then the set A = {xo, x′ j} ∪{xi : i ∈S} has a nice 2-clustering if and only if j ̸∈S. Proof. Suppose A has a nice 2-clustering {C1, C2}, where C1 is the cluster that contains xo. We first show that C1 is a singleton cluster. If C1 also contains some xℓ, then it must contain all the points {xi : i ∈S} by niceness since d(xℓ, xi) ≤3/2 < d(xℓ, xo). Since |S| > 1, these points include some xi with i ̸= j. Whereupon C1 must also contain x′ j, since d(xi, x′ j) ≤3/2 < d(xi, xo). But this means C2 is empty. Likewise, if C1 contains x′ j, then it also contains all {xi : i ∈S, i ̸= j}, since d(xi, x′ j) < d(xo, x′ j). There is at least one such xi, and we revert to the previous case. Therefore C1 = {xo} and, as a result, C2 = {xi : i ∈S} ∪{x′ j}. This 2-clustering is nice if and only if d(xo, x′ j) > d(xi, x′ j) and d(xo, xi) > d(x′ j, xi) for all i ∈S, which in turn is true if and only if j ̸∈S. By putting together two M-configurations, we obtain: Theorem 3.6. Let (X, d) be any metric space that contains two M-configurations separated by a distance of at least 4. Then, there is no deterministic incremental algorithm with ≤M/2 bits of storage that is guaranteed to recover nice 3-clusterings of data sets drawn from X, even when limited to instances in which such clusterings are unique. Proof. Suppose the deterministic incremental learner has a memory capacity of b bits. We will refer to the memory contents of the learner as its state, σ ∈{0, 1}b. Call the two M-configurations xo, x1, . . . , xM, x′ 1, . . . , x′ M and zo, z1, . . . , zM, z′ 1, . . . , z′ M. We feed the following points to the learner: Batch 1: xo and zo Batch 2: b distinct points from x1, . . . , xM Batch 3: b distinct points from z1, . . . , zM Batch 4: Two final points x′ j1 and z′ j2 The learner’s state after seeing batch 2 can be described by a function f : {x1, . . . , xM}b →{0, 1}b. The number of distinct sets of b points in batch 2 is M b  > (M/b)b. If M ≥2b, this is > 2b, which means that two different sets of points must lead to the same state, call it σ ∈{0, 1}b. Let the indices of these sets be S1, S2 ⊂[M] (so |S1| = |S2| = b), and pick any j1 ∈S1 \ S2. Next, suppose the learner is in state σ and is then given batch 3. We can capture its state at the end of this batch by a function g : {z1, . . . , zM}b →{0, 1}b, and once again there must be distinct sets T1, T2 ⊂[M] that yield the same state σ′. Pick any j2 ∈T1 \ T2. It follows that the sequences of inputs xo, zo, (xi : i ∈S1), (zi : i ∈T2), x′ j1, z′ j2 and xo, zo, (xi : i ∈S2), (zi : i ∈T1), x′ j1, z′ j2 produce the same final state and thus the same answer. But in the first case, by Lemma 3.5, the unique nice 3-clustering keeps the x’s together and splits the z’s, whereas in the second case, it splits the x’s and keeps the z’s together. An M-configuration can be realized in Euclidean space: Lemma 3.7. There is an absolute constant co such that for any dimension p, the Euclidean space Rp, with L2 norm, contains M-configurations for all M < 2cop. The overall conclusions are the following. Theorem 3.8. There is no memory-bounded deterministic nice-detecting incremental clustering algorithm that works in arbitrary metric spaces. For data in Rp under the ℓ2 metric, there is no deterministic nice-detecting incremental clustering algorithm using less than 2cop−1 bits of memory. 6 4 A more restricted class of clusterings The discovery that nice clusterings cannot be detected using any incremental method, even though they are readily detected in a batch setting, speaks to the substantial limitations of incremental algorithms. We next ask whether there is a well-behaved subclass of nice clusterings that can be detected using incremental methods. Following [9, 2, 5, 1], among others, we consider clusterings in which the maximum cluster diameter is smaller than the minimum inter-cluster separation. Definition 4.1 (Perfect clustering). A clustering C of (X, d) is perfect if d(x, y) < d(w, z) whenever x ∼C y, w ̸∼C z. Any perfect clustering is nice. But unlike nice clusterings, perfect clusterings are unique: Lemma 4.2. For any (X, d) and k, there is at most one perfect k-clustering of (X, d). Whenever an algorithm can detect perfect clusterings, we call it perfect-detecting. Formally, an incremental clustering algorithm A is perfect-detecting if, given a positive integer k and (X, d) that has a perfect k-clustering, A(O[X], d, k) outputs that clustering for any ordering function O. We start with an example of a simple perfect-detecting algorithm. Theorem 4.3. Sequential nearest-neighbour clustering (Algorithm 2.4) is perfect-detecting. We next turn to sequential k-means (Algorithm 2.2), one of the most popular methods for incremental clustering. Interestingly, it is unable to detect perfect clusterings. It is not hard to see that a perfect k-clustering is a local optimum of k-means. We will now see an example in which the perfect k-clustering is the global optimum of the k-means cost function, and yet sequential k-means fails to detect it. Theorem 4.4. There is a set of four points in R3 with a perfect 2-clustering that is also the global optimum of the k-means cost function (for k = 2). However, there is no ordering of these points that will enable this clustering to be detected by sequential k-means. 5 Incremental clustering with extra clusters Returning to the basic lower bound of Theorem 3.8, it turns out that a slight shift in perspective greatly improves the capabilities of incremental methods. Instead of aiming to exactly discover the target partition, it is sufficient in some applications to merely uncover a refinement of it. Formally, a clustering C of X is a refinement of clustering C′ of X, if x ∼C y implies x ∼C′ y for all x, y ∈X. We start by showing that although incremental algorithms cannot detect nice k-clusterings, they can find a refinement of such a clustering if allowed 2k−1 centers. We also show that this is tight. Next, we explore the utility of additional clusters for sequential k-means. We show that for a random ordering of the data, and with extra centers, this algorithm can recover (a slight variant of) nice clusterings. We also show that the random ordering is necessary for such a result. Finally, we prove that additional clusters extend the utility of incremental methods beyond nice clusterings. We introduce a weaker constraint on cluster structure, requiring only that each cluster possess a significant “core”, and we present a scheme that works under this weaker requirement. 5.1 An incremental algorithm can find nice k-clusterings if allowed 2k centers Earlier work [8] has shown that that any nice clustering corresponds to a pruning of the tree obtained by single linkage on the points. With this insight, we develop an incremental algorithm that maintains 2k−1 centers that are guaranteed to induce a refinement of any nice k-clustering. The following subroutine takes any finite S ⊂X and returns at most 2k−1 distinct points: CANDIDATES(S) Run single linkage on S to get a tree Assign each leaf node the corresponding data point Moving bottom-up, assign each internal node the data point in one of its children Return all points at distance < k from the root 7 Lemma 5.1. Suppose S has a nice ℓ-clustering, for ℓ≤k. Then the points returned by CANDIDATES(S) include at least one representative from each of these clusters. Here’s an incremental algorithm that uses 2k−1 centers to detect a nice k-clustering. Algorithm 5.2. Incremental clustering with extra centers. T0 = ∅ For t = 1, 2, . . .: Receive xt and set Tt = Tt−1 ∪{xt} If |Tt| > 2k−1: Tt ←CANDIDATES(Tt) Theorem 5.3. Suppose there is a nice k-clustering C of X. Then for each t, the set Tt has at most 2k−1 points, including at least one representative from each Ci for which Ci ∩{x1, . . . , xt} ̸= ∅. It is not possible in general to use fewer centers. Theorem 5.4. Pick any incremental clustering algorithm that maintains a list of ℓcenters that are guaranteed to be consistent with a target nice k-clustering. Then ℓ≥2k−1. 5.2 Sequential k-means with extra clusters Theorem 4.4 above shows severe limitations of sequential k-means. The good news is that additional clusters allow this algorithm to find a variant of nice partitionings. The following condition imposes structure on the convex hull of the partitions in the target clustering. Definition 5.5. A clustering C = {C1, . . . , Ck} is convex-nice if for any i ̸= j, any points x, y in the convex hull of Ci, and any point z in the convex hull of Cj, we have d(y, x) < d(z, x). Theorem 5.6. Fix a data set (X, d) with a convex-nice clustering C = {C1, . . . , Ck} and let β = mini |Ci|/|X|. If the points are ordered uniformly at random, then for any ℓ≥k, sequential ℓ-means will return a refinement of C with probability at least 1 −ke−βℓ. The probability of failure is small when the refinement contains ℓ= Ω((log k)/β) centers. We can also show that this positive result no longer holds when data is adversarially ordered. Theorem 5.7. Pick any k ≥3. Consider any data set X in R (under the usual metric) that has a convex-nice k-clustering C = {C1, . . . , Ck}. Then there exists an ordering of X under which sequential ℓ-means with ℓ≤mini |Ci| centers fails to return a refinement of C. 5.3 A broader class of clusterings We conclude by considering a substantial generalization of niceness that can be detected by incremental methods when extra centers are allowed. Definition 5.8 (Core). For any clustering C = {C1, . . . , Ck} of (X, d), the core of cluster Ci is the maximal subset Co i ⊂Ci such that d(x, z) < d(x, y) for all x ∈Ci, z ∈Co i , and y ̸∈Ci. In a nice clustering, the core of any cluster is the entire cluster. We now require only that each core contain a significant fraction of points, and we show that the following simple sampling routine will find a refinement of the target clustering, even if the points are ordered adversarially. Algorithm 5.9. Algorithm subsample. Set T to the first ℓelements For t = ℓ+ 1, ℓ+ 2, . . .: Get a new point xt With probability ℓ/t: Remove an element from T uniformly at random and add xt to T It is well-known (see, for instance, [14]) that at any time t, the set T consists of ℓelements chosen at random without replacement from {x1, . . . , xt}. Theorem 5.10. Consider any clustering C = {C1, . . . , Ck} of (X, d), with core {Co 1, . . . , Co k}. Let β = mini |Co i |/|X|. Fix any ℓ≥k. Then, given any ordering of X, Algorithm 5.9 detects a refinement of C with probability 1 −ke−βℓ. 8 References [1] M. Ackerman and S. Ben-David. Clusterability: A theoretical study. Proceedings of AISTATS09, JMLR: W&CP, 5(1-8):53, 2009. [2] M. Ackerman, S. Ben-David, S. Branzei, and D. Loker. Weighted clustering. Proc. 26th AAAI Conference on Artificial Intelligence, 2012. [3] M. Ackerman, S. Ben-David, and D. Loker. Characterization of linkage-based clustering. COLT, 2010. [4] M. Ackerman, S. Ben-David, and D. Loker. Towards property-based classification of clustering paradigms. NIPS, 2010. [5] M. Ackerman, S. Ben-David, D. Loker, and S. Sabato. Clustering oligarchies. Proceedings of AISTATS-09, JMLR: W&CP, 31(6674), 2013. [6] Charu C Aggarwal. A survey of stream clustering algorithms., 2013. [7] M.-F. Balcan and P. Gupta. Robust hierarchical clustering. In COLT, pages 282–294, 2010. [8] M.F. Balcan, A. Blum, and S. Vempala. A discriminative framework for clustering via similarity functions. In Proceedings of the 40th annual ACM symposium on Theory of Computing, pages 671–680. ACM, 2008. [9] S. Epter, M. Krishnamoorthy, and M. Zaki. Clusterability detection and initial seed selection in large datasets. In The International Conference on Knowledge Discovery in Databases, volume 7, 1999. [10] Sudipto Guha, Nina Mishra, Rajeev Motwani, and Liadan O’Callaghan. Clustering data streams. In Foundations of computer science, 2000. proceedings. 41st annual symposium on, pages 359–366. IEEE, 2000. [11] J.A. Hartigan. Consistency of single linkage for high-density clusters. Journal of the American Statistical Association, 76(374):388–394, 1981. [12] N. Jardine and R. Sibson. Mathematical taxonomy. London, 1971. [13] J. Kleinberg. An impossibility theorem for clustering. Proceedings of International Conferences on Advances in Neural Information Processing Systems, pages 463–470, 2003. [14] D.E. Knuth. The Art of Computer Programming: Seminumerical Algorithms, volume 2. 1981. [15] T. Kohonen. Self-organizing maps. Springer, 2001. [16] S.P. Lloyd. Least squares quantization in PCM. IEEE Transactions on Information Theory, 28(2):129–137, 1982. [17] J.B. MacQueen. Some methods for classification and analysis of multivariate observations. In Proceedings of Fifth Berkeley Symposium on Mathematical Statistics and Probability, volume 1, pages 281–297. University of California Press, 1967. [18] J.H. Ward. Hierarchical grouping to optimize an objective function. Journal of the American Statistical Association, 58:236–244, 1963. [19] R.B. Zadeh and S. Ben-David. A uniqueness theorem for clustering. In Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, pages 639–646. AUAI Press, 2009. 9
2014
312
5,417
Positive Curvature and Hamiltonian Monte Carlo Christof Seiler Simon Rubinstein-Salzedo∗ Susan Holmes Department of Statistics Stanford University {cseiler,simonr}@stanford.edu, susan@stat.stanford.edu Abstract The Jacobi metric introduced in mathematical physics can be used to analyze Hamiltonian Monte Carlo (HMC). In a geometrical setting, each step of HMC corresponds to a geodesic on a Riemannian manifold with a Jacobi metric. Our calculation of the sectional curvature of this HMC manifold allows us to see that it is positive in cases such as sampling from a high dimensional multivariate Gaussian. We show that positive curvature can be used to prove theoretical concentration results for HMC Markov chains. 1 Introduction In many important applications, we are faced with the problem of sampling from high dimensional probability measures [19]. For example, in computational anatomy [8], the goal is to estimate deformations between patient anatomies observed from medical images (e.g. CT and MRI). These deformations are then analyzed for geometric differences between patient groups, for instance in cases where one group of patients has a certain disease, and the other group are healthy. The anatomical deformations of interest have very high effective dimensionality. Each voxel of the image has essentially three degrees of freedom, although prior knowledge about spatial smoothness helps regularize the estimation problem and narrow down the effective degrees of freedom. Recently, several authors formulated Bayesian approaches for this type of inverse problem [1, 2, 4], turning computational anatomy into a high dimensional sampling problem. Most high dimensional sampling problems have intractable normalizing constants. Therefore to draw multiple samples we have to resort to general Markov chain Monte Carlo (MCMC) algorithms. Many such algorithms scale poorly with the number of dimensions. One exception is Hamiltonian Monte Carlo (HMC). For example, in computational anatomy, various authors [22, 23] have used HMC to sample anatomical deformations efficiently. Unfortunately, the theoretical aspects of HMC are largely unexplored, although some recent work addresses the important question of how to choose the numerical parameters in HMC optimally [3, 7]. 1.1 Main Result In this paper, we present a theoretical analysis of HMC. As a first step toward a full theoretical analysis of HMC in the context of computational anatomy [22, 23], we focus our attention on the numerical calculation of the expectation I = Z Rd f(q) π(dq) (1.1) ∗The first and second authors made equal contributions and should be considered co-first authors. 1 by drawing samples (X1, X2, . . . ) from π using HMC, and then approximating the integral by the sample mean of the chain: bI = 1 T T0+T X k=T0+1 f(Xk). (1.2) Here, T0 is the burn-in time, a certain number of steps taken in the chain that we discard due to the influence of the starting state, and T is the running time, the number of steps in the chain that we need to take to obtain a representative sample of the actual measure. Our main result quantifies how large T must be in order to obtain a good approximation to the above stated integral through its sample mean (V 2 will be defined in §3, and κ in the next paragraph): P(|I −bI| ≥r∥f∥Lip) ≤2e−r2/(16V 2(κ,T )). The most interesting part of this result is the use of coarse Ricci curvature κ. Following on ideas from Sturm [20, 21], Ollivier introduced κ to quantify the curvature of a Markov chain [16]. Joulin and Ollivier [12] used this concept of curvature to calculate new error bounds and concentration inequalities for a wide range of MCMC algorithms. Their work links MCMC to Riemannian geometry; this link is our main tool for analyzing HMC. Our key idea is to recast the analysis of HMC as a problem in Riemannian geometry by using the Jacobi metric. In high dimensional settings, we are able to make simplifications that allow us to calculate distributions of curvatures on the Riemannian manifold associated to HMC. This distribution is then used to calculate κ and thus concentration inequalities. Our results hold in high dimensions (large d) and for Markov chains with positive curvature. The Jacobi metric connects seemingly different problems and enables us to transform a sampling problem into a geometrical problem. It has been known since Jacobi [10] that Hamiltonian flows correspond to geodesics on certain Riemannian manifolds. The Jacobi metric has been successfully used in the study of phase transitions in physics; for a book-length account see [17]. In probability and statistics, the Jacobi metric has been mentioned in the rejoinder of [7] as an area of research promise. The Jacobi metric enables us to distort space according to a probability distribution. This idea is familiar to statisticians in the simple case of using the inverse cumulative distribution function to distort uniformly spaced points into points from another distribution. When we want to sample y ∈R from a distribution with cumulative distribution function F we can pick a uniform random number x ∈[0, 1] and let y be the largest number so that F(y) ≤x. Here we are shrinking the regions of low density so that they are less likely to be selected. 1.2 Structure of the Paper After introducing basic concepts from Riemannian geometry, we recast HMC into the Riemmanian setting, i.e. as geodesics on Riemannian manifolds (§2). This provides the necessary language to state and prove that HMC has positive sectional curvature in high dimensions, in certain settings. We then state the main concentration inequality from [12] (§3). Finally, we show how this concentration inequality can be applied to quantify running times of HMC for the multivariate Gaussian in 100 dimensions (§4). 2 Sectional Curvature of Hamiltonian Monte Carlo 2.1 Riemannian Manifolds We now introduce some basic differential and Riemannian geometry that is useful in describing HMC; we will leave the more subtle points about curvature of manifolds and probability measures for §2.3. This apparatus will allow us to interpret solutions to Hamiltonian equations as geodesic flows on Riemannian manifolds. We sketch this approach out briefly here, avoiding generality and precision, but we invite the interested reader to consult [5] or a similar reference for a more thorough exposition. 2 Definition 2.1. Let X be a d-dimensional manifold, and let x ∈X be a point. Then the tangent space TxX consists of all γ′(0), where γ : (−ε, ε) →X is a smooth curve and γ(0) = x. The tangent bundle TX of X is the manifold whose underlying set is the disjoint union F x∈X TxX. Remark 2.2. This definition does not tell us how to stitch TxX and TX into manifolds. The details of that construction can be found in any introductory book on differential geometry. It suffices to note that TxX is a vector space of dimension d, and TX is a manifold of dimension 2d. Definition 2.3. A Riemannian manifold is a pair (X, ⟨·, ·⟩), where X is a manifold and ⟨·, ·⟩is a smoothly varying positive definite bilinear form on the tangent space TxX, for each x ∈X. We call ⟨·, ·⟩the (Riemannian) metric. The Riemannian metric allows one to measure distances between two points on X. We define the length of a curve γ : [a, b] →X to be L(γ) = Z b a ⟨γ′(t), γ′(t)⟩dt, and the distance ρ(x, y) to be ρ(x, y) = inf γ(0)=x γ(1)=y L(γ). A geodesic on a Riemannian manifold is a curve γ : [a, b] →X that locally minimizes distance, in the sense that if eγ : [a, b] →X is another path with eγ(a) = γ(a) and eγ(b) = γ(b) with eγ(t) and γ(t) sufficiently close together for each t ∈[a, b], then L(γ) ≤L(eγ). Example. On Rd with the standard metric, geodesics are exactly the line segments, since the shortest path between two points is along a straight line. In this article, we are primarily concerned with the case of X diffeomorphic to Rd. However, it will be essential to think in terms of Riemannian manifolds, for our metric on X will vary from the standard metric. In §2.3, we will see how to choose a metric, the Jacobi metric, that is tailored to a non-uniform probability distribution π on X. 2.2 Hamiltonian Monte Carlo In order to resolve some of the issues with the standard versions of MCMC related to slow mixing times, we draw inspiration from ideas in physics. We mimic the movement of a body under potential and kinetic energy changes to avoid diffusive behavior. The stationary probability will be linked to the potential energy. The reader is invited to read [15] for an elegant survey of the subject. The setup is as follows: let X be a manifold, and let π be a target distribution on X. As with the Metropolis-Hastings algorithm, we start at some point q0 ∈X. However, we use an analogue of the laws of physics to tell us where to go for future steps. To simplify our exposition, we assume that X = Rd. This is not strictly necessary, but all distributions we consider will be on Rd. In what follows, we let (qn, pn) be the position and momentum after n steps of the walk. To run Hamiltonian Monte Carlo, we must first choose functions V : X →R and K : TX →R, and we let H(q, p) = V (q) + K(q, p). We start at a point q0 ∈X. Now, supposing we have qn, the position at step n, we sample pn from a N(0, Id) distribution. We solve the differential equations dq dt = ∂H ∂p , dp dt = −∂H ∂q (2.1) with initial conditions p(0) = pn and q(0) = qn, and we let qn+1 = q(1). In order to make the stationary distribution of the qn’s be π, we choose V and K following Neal in [15]; we take V (q) = −log π(q) + C, K(p) = D 2 ∥p∥2, (2.2) where C and D > 0 are convenient constants. Note that V only depends on q and K only depends on p. V is larger when π is smaller, and so trajectories are able to move more quickly starting from lower density regions than out of higher density regions. 3 2.3 Curvature Not all probability distributions can be efficiently sampled. In particular, high-dimensional distributions such as the uniform distribution on the cube [0, 1]d are especially susceptible to sampling difficulties due to the curse of dimensionality, where in some cases it is necessary to take exponentially many (in the dimension of the space) sample points in order to obtain a satisfactory estimate. (See [13] for a discussion of the problems with integration on high-dimensional boxes and some ideas for tackling them when we have additional information about the function.) However, numerical integration on high-dimensional spheres is not as difficult. The reason is that the sphere exhibits concentration of measure, so that the bulk of the surface area of the sphere lies in a small ribbon around the equator (see [14, §III.I.6]). As a result, we can obtain a good estimate of an integral on a high-dimensional sphere by taking many sample points around the equator, and only a few sample points far from the equator. Indeed, a polynomial number (in the dimension and the error bound) of points will suffice. The difference between the cube and sphere, in this instance, is that the sphere has positive curvature, whereas the cube has zero curvature. Spaces of positive curvature are amenable to efficient numerical integration. However, it is not just a space that can have positive (or otherwise) curvature. As we shall see, we can associate a notion of curvature to a Markov chain, an idea introduced by Ollivier [16] and Joulin [11] following work of Sturm [20, 21]. In this case as well, we will be able to perform numerical integration, using Hamiltonian Monte Carlo, in the case of stationary distributions of Markov chains with positive curvature. Furthermore, in §3, we will be able to provide error bounds for the integrals in question. In order to make the geometry and the probability measure interdependent, we will deform our space to take the probability distribution into account, in a manner reminiscent of the inverse transform method mentioned in the introduction. Formally, this amounts to putting a suitable Riemannian metric on our state space X. From now on, we shall assume that X is a manifold; in fact, it will generally suffice to let it be Rd. Nonetheless, even in the case of Rd, the extra Riemannian metric is important since it is not the standard Euclidean one. Given a probability distribution π on Rd, we now define a metric on Rd that is tailored to π and the Hamiltonian it induces (see §2.2). This construction is originally due to Jacobi, but our treatment follows Pin in [18]. Definition 2.4. Let (X, ⟨·, ·⟩) be a Riemannian manifold, and let π be a probability distribution on X. Let V be the potential energy function associated to π by (2.2). For h ∈R, we define the Jacobi metric to be gh(·, ·) = 2(h −V )⟨·, ·⟩. Remark 2.5. (X, gh) is not necessarily a Riemannian manifold, since gh will not be positive definite if h −V is ever nonpositive. We could remedy this situation by restricting to the subset of X on which h −V > 0. However, this will not be problematical for us, as we will always select values of h for which h −V > 0. The reason for using the Jacobi metric is the following result of Jacobi, following Maupertuis: Theorem 2.6 (Jacobi-Maupertuis Principle, [10]). Trajectories q(t) of the Hamiltonian equations 2.1 with total energy h are geodesics of X with the Jacobi metric gh. The most convenient way for us to think about the Jacobi metric on X is as a distortion of space to suit the probability measure. In order to do this, we make regions of high density larger, and we make regions of low density smaller. However, the Jacobi metric does not completely override the old notion of distance and scale; the Jacobi metric provides a compromise between physical distance and density of the probability measure. As we run Hamiltonian Monte Carlo as described in §2.2, h changes at every step, as we let h = V (qn) + K(pn). That is, we actually vary the metric structure as we run the chain, or, alternatively, move between different Riemannian manifolds. In practice, however, we prefer to think of the chain as running on a single manifold, with a changing structure. 4 We will not give all the relevant definitions of curvature, only a few facts that provide some useful intuition. We will need the notion of sectional curvature in the plane spanned by u and v. Let X be a ddimensional Riemannian manifold, and x, y ∈X two distinct points. Let v ∈TxX, v′ ∈TyX be two tangent vector at x and y that are related to each other by parallel transport along the geodesic in the direction of u. Let δ be the length of the geodesic between x and y, and ε the length of v (or v′). Let ρ be the length of the geodesic between the two endpoints starting at x shooting in direction εv, and y in direction εv′. Then the sectional curvature Secx(u, v) at point x is given by ρ = δ  1 −ε2 2 Secx(u, v) + O(ε3 + ε2δ)  as (ε, δ) →0. See Figure 3 in our long paper [9] for a pictorial representation. We let Inf Sec denote the infimum of Secx(u, v), where x runs over X and u, v run over all pairs of linearly independent tangent vectors at x. Remark 2.7. In practice, it may not be easy to compute Inf Sec precisely. As a result, we can approximate it by running a suitable Markov chain on the collection of pairs of linearly independent tangent vectors of X; say we reach states (x1, u1, v1), (x2, u2, v2), . . . , (xt, ut, vt). Then we can approximate Inf Sec by the empirical infimum of the sectional curvatures inf1≤i≤t Secxi(ui, vi). This approach has computational benefits, but also theoretical benefits: it allows us to ignore low sectional curvatures that are unlikely to arise in practice. Note that Sec depends on the metric. There is a formula, due to Pin [18], connecting the sectional curvature of a Riemannian manifold equipped with some reference metric, with that of the Jacobi metric. We write down an expression for the sectional curvature in the special case where the reference metric on X is the standard Euclidean metric and u and v are orthonormal tangent vectors at a point x ∈X: Secx(u, v) = 1 8(h −V )3  2(h −V ) h ⟨(Hess V )u, u⟩+ ⟨(Hess V )v, v⟩ i + 3 h ∥grad V ∥2 cos2(α) + ∥grad V ∥2 cos2(β) i −∥grad V ∥2 . (2.3) Here, α is defined as the angle between grad V and u, and β as the angle between grad V and v, in the standard Euclidean metric. There is also a notion of curvature, known as coarse Ricci curvature for Markov chains [16]. (There is also a notion of Ricci curvature for Riemannian manifolds, but we do not use it in this article.) If P is the transition kernel for a Markov chain on a metric space (X, ρ), let Px denote the transition probabilities starting from state x. We define the coarse Ricci curvature κ(x, y) as the W1 Wasserstein distance between two probability measures by W1(Px, Py) = (1 −κ(x, y))ρ(x, y). We write κ for infx,y∈X κ(x, y). We sometimes write κ for an empirical infimum, as in Remark 2.7. 3 Concentration Inequality for General MCMC We now state Joulin and Ollivier’s [12] concentration inequalities for general MCMC. This will provide the link between geometry and MCMC that we will need for our concentration inequality for HMC. Definition 3.1. • The Lipschitz norm of a function f : (X, ρ) →R is ∥f∥Lip := sup x,y∈X |f(x) −f(y)| ρ(x, y) . If ∥f∥Lip ≤C, we say that f is C-Lipschitz. • The coarse diffusion constant of a Markov chain on a metric space (X, ρ) with kernel P at a state q ∈X is the quantity σ(q)2 := 1 2 ZZ X×X ρ(x, y)2 Pq(dx) Pq(dy). 5 • The local dimension nq is nq := inf f:X→R f 1-Lipschitz RR X×X ρ(x, y)2 Pq(dx) Pq(dy) RR X×X |f(x) −f(y)|2 Pq(dx) Pq(dy). • The eccentricity E(q) at a point q ∈X is defined to be E(q) = Z X ρ(x, y) π(dy). Theorem 3.2 ([12]). If f : X →R is a Lipschitz function, then |Eq bI −I| ≤(1 −κ)T0+1 κT E(q)∥f∥Lip. Theorem 3.3 ([12]). Let V 2(κ, T) = 1 κT  1 + T0 T  sup q∈X σ(x)2 nqκ . Then, assuming that the diameters of the Pq’s are unbounded, we have Pq(|bI −Eq bI| ≥r∥f∥Lip) ≤2e−r2/(16V 2(κ,T )). Joulin and Ollivier [12] work with metric state spaces that have positive curvature. In contrast, in the next section, we work with Euclidean state spaces. We show that HMC transforms Euclidean state space into a state space with positive curvature. In HMC, curvature does not originate from the state space but from the measure π. The measure π acts on the state space according to the rules of HMC; one can think of a distortion of the underlying state space, similar to the transform inverse sampling for one dimensional continuous distributions. 4 Concentration Inequality for HMC In this section, we apply Theorem 3.3 for sampling from multivariate Gaussian distributions using HMC. For a book-length introduction to sampling from multivariate Gaussians, see [6]. We begin with a theoretical discussion, and then we present some simulation results. As we shall see, these distributions have positive curvature in high dimensions. Lemma 4.1. Let C be a universal constant and π be the d-dimensional multivariate Gaussian N(0, Σ), where Σ is a (d×d) covariance matrix, all of whose eigenvalues lie in the range [1/C, C]. We denote by Λ = Σ−1 the precision matrix. Let q be distributed according to π, and p according to a Gaussian N(0, Id). Further, h = V (q) + K(q, p) is the sum of the potential and the kinetic energy. The Euclidean state space X is equipped with the Jacobi metric gh. Pick two orthonormal tangent vectors u, v in the tangent space TqX at point q. Then the sectional curvature Sec from expression (2.3) is a random variable bounded from below with probability P(d2 Sec ≥K1) ≥1 −K2e−K3 √ d. K1, K2, and K3 are positive constants that depend on C. We note that the terms in (2.3) involving cosines can be left out since they are always positive and small. The other three terms can be written as three quadratic forms in standard Gaussian random vectors. We then calculate tail inequalities for all these terms using Chernoff-type bounds. We also work out the constants K1, K2, and K3 explicitly. For a detailed proof see our long paper [9]. There is a close connection between κ and Sec of X equipped with the Jacobi metric: for Gaussians with assumptions as in Lemma 4.1, we have κ ≥Sec 6d . as d →∞. We give the derivation in our long paper [9]. Now we can insert κ into Theorem 3.3 and compute our concentration inequality for HMC. For details on how to calculate the coarse diffusion constant σ(q)2, the local dimension nq, and the eccentricity E(q), see our long paper [9]. 6 −1.5 −1.0 −0.5 0.0 Number of dimensions 14 18 22 26 30 34 38 42 46 50 Sectional curvatures in higher dimensions minimum sample mean Histogram of sectional curvatures (d = 10) Frequency −3 −2 −1 0 1 2 3 4 0 20000 40000 60000 80000 expectation E(Sec) sample mean Histogram of sectional curvatures (d = 100) Frequency 0.00005 0.00015 0.00025 0.00035 0 20000 40000 60000 expectation E(Sec) sample mean Frequency Histogram of sectional curvatures (d = 1000) 8.0e−07 1.0e−06 1.2e−06 1.4e−06 0 50000 150000 250000 expectation E(Sec) sample mean Figure 1: Top left: Minimum and sample average of sectional curvatures for 14- to 50-dimensional multivariate Gaussian π with identity covariance. For each dimension we run a HMC random walk with T = 104 steps. The other three plots: HMC after T = 104 steps for multivariate Gaussian π with identity covariance in d = 10, 100, 1000 dimensions. At each step we compute the sectional curvature for d uniformly sampled orthonormal 2-frames in Rd. Remark 4.2. The coarse curvature κ only depends on π. However, in practice we compute κ empirically by running several steps of the chain as discussed in Remark 2.7, making κ depend on x and T0. Thus, we typically assume T0 to be known in advance in some other way. Example (Distribution of sectional curvature). We run a HMC Markov chain to sample a multivariate Gaussian π. Figure 1 shows how the minimum and sample mean of sectional curvatures during the HMC random walk tend closer with dimensionality, and around dimension 30 we cannot distinguish them visually anymore. The minimum sectional curvatures are stable with small fluctuations. The actual sample distributions are shown in three separate plots (Figure 1) for 10, 100 and 1000 dimensions. These plots suggest that the sample distributions of sectional curvatures tend to a Gaussian distribution with smaller variances as dimensionality increases. Example (Running time estimate). Now we give a concentration inequality simulation for sampling from a 100-dimensional multivariate Gaussian with with Gaussian decay between the absolute distance squared of the variable indices π ∼N(0, exp(−|i −j|2)) and the following parameters 7 G G G G G G G G GG G G G G GG G G GG GG GG G G G G G G G 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 G G G G G GG 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 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 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 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 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 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 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 G G G G G G G G G G G G G G GG G GG G GG G GG 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 GG G G G G G G G G G G GG 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 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 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 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 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 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 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 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 GG G G G G G 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 G G GG G G G G G G G GG G 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 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 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 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 GGG 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 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 G G G G G G G G G G G G G G G GG 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 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 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 GG G GG 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 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 GG 0 200 400 600 800 1000 −0.06 −0.04 −0.02 0.00 0.02 0.04 0.06 Simulations Sample mean of coordinate 1 HMC sample means error bound 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 10 12 14 16 18 20 22 0.0 0.5 1.0 1.5 2.0 Running time log(T0+T) Concentration Concentration inequality Figure 2: (Covariance structure with weak dependencies) Left: Sample means for 1000 simulations for the first coordinate of the 100 dimensional multivariate Gaussian. The red lines indicate the error bound r. Right: Concentration inequality with increasing burn-in and running time. Error bound r = 0.05 Starting point q0 = 0 Markov chain kernel P ∼N(0, I100) Coarse Ricci curvature κ = 0.0024 Coarse diffusion constant σ2(q) = 100 Local dimension nq = 100 Lipschitz norm ∥f∥Lip = 0.1 Eccentricity E(0) = 99.75 For calculations of these parameters see our long paper [9]. In Figure 2 on the left, we show 1000 simulations of this HMC chain and for each simulations we plot the sample mean approximation to the integral. The red lines indicated the requested error bound at r = 0.05. From these simulation results, we would expect the right burn-in and running time to be around T + T0 = e10. In Figure 2 on the right, we see our theoretical concentration inequality as a function of burn-in and running time T + T0 (in logarithmic scale). The probability of making an error above our defined error bound r = 0.05 is close to zero at burn-in time T0 = 0 and running time T = e19. The discrepancy between the predicted theoretical results and the actual simulations suggest there might be hope for improvements in future work. 5 Conclusion Lemma 2.3 states a probabilistic lower bound. So in rare occasions, we will still observe curvatures below this bound or in very rare occasions even negative curvatures. Even if we had less conservative bounds on the number of simulations steps T0 + T, we could still not completely exclude “bad” curvatures. For our approach to work, we need to make the explicit assumption that rare “bad” curvatures have no serious impact on bounds for T0 + T. Intuitively, as HMC can take big steps around the state space towards the gradient of distribution π, it should be able to recover quickly from “bad” places. We are now working on quantifying this recovery behavior of HMC more carefully. For a full mathematical development with proofs and more examples on the multivariate t distribution and in computational anatomy see our long paper [9]. Acknowledgments The authors would like to thank Sourav Chatterjee, Otis Chodosh, Persi Diaconis, Emanuel Milman, Veniamin Morgenshtern, Richard Montgomery, Yann Ollivier, Xavier Pennec, Mehrdad Shahshahani, and Aaron Smith for their insight and helpful discussions. This work was supported by a postdoctoral fellowship from the Swiss National Science Foundation and NIH grant R01-GM086884. 8 References [1] St´ephanie Allassonni`ere, J´er´emie Bigot, Joan Alexis Glaun`es, Florian Maire, and Fr´ed´eric J. P. Richard. Statistical models for deformable templates in image and shape analysis. Ann. Math. Blaise Pascal, 20(1):1–35, 2013. [2] St´ephanie Allassonni`ere, Estelle Kuhn, and Alain Trouv´e. Construction of Bayesian deformable models via a stochastic approximation algorithm: a convergence study. Bernoulli, 16(3):641–678, 2010. [3] Alexandros Beskos, Natesh Pillai, Gareth Roberts, Jesus-Maria Sanz-Serna, and Andrew Stuart. Optimal tuning of the hybrid Monte Carlo algorithm. Bernoulli, 19(5A):1501–1534, 2013. [4] Colin John Cotter, Simon L. Cotter, and Franc¸ois-Xavier Vialard. Bayesian data assimilation in shape registration. Inverse Problems, 29(4):045011, 21, 2013. [5] Manfredo Perdig˜ao do Carmo. Riemannian geometry. Mathematics: Theory & Applications. Birkh¨auser Boston, Inc., Boston, MA, 1992. Translated from the second Portuguese edition by Francis Flaherty. [6] Alan Genz and Frank Bretz. Computation of multivariate normal and t probabilities, volume 195 of Lecture Notes in Statistics. Springer, Dordrecht, 2009. [7] Mark Girolami and Ben Calderhead. Riemann manifold Langevin and Hamiltonian Monte Carlo methods. J. R. Stat. Soc. Ser. B Stat. Methodol., 73(2):123–214, 2011. With discussion and a reply by the authors. [8] Ulf Grenander and Michael I. Miller. Computational anatomy: an emerging discipline. Quart. Appl. Math., 56(4):617–694, 1998. Current and future challenges in the applications of mathematics (Providence, RI, 1997). [9] Susan Holmes, Simon Rubinstein-Salzedo, and Christof Seiler. Curvature and concentration of Hamiltonian Monte Carlo in high dimensions. preprint arXiv:1407.1114, 2014. [10] Carl Gustav Jacob Jacobi. Jacobi’s lectures on dynamics, volume 51 of Texts and Readings in Mathematics. Hindustan Book Agency, New Delhi, revised edition, 2009. [11] Ald´eric Joulin. Poisson-type deviation inequalities for curved continuous-time Markov chains. Bernoulli, 13(3):782–798, 2007. [12] Ald´eric Joulin and Yann Ollivier. Curvature, concentration and error estimates for Markov chain Monte Carlo. Ann. Probab., 38(6):2418–2442, 2010. [13] Frances Y. Kuo and Ian H. Sloan. Lifting the curse of dimensionality. Notices Amer. Math. Soc., 52(11):1320–1329, 2005. [14] Paul L´evy. Lec¸ons d’analyse fonctionnelle. Paris, 1922. [15] Radford M. Neal. MCMC using Hamiltonian dynamics. In Handbook of Markov chain Monte Carlo, Chapman & Hall/CRC Handb. Mod. Stat. Methods, pages 113–162. CRC Press, Boca Raton, FL, 2011. [16] Yann Ollivier. Ricci curvature of Markov chains on metric spaces. J. Funct. Anal., 256(3):810– 864, 2009. [17] Marco Pettini. Geometry and topology in Hamiltonian dynamics and statistical mechanics, volume 33 of Interdisciplinary Applied Mathematics. Springer, New York, 2007. With a foreword by E. G. D. Cohen. [18] Ong Chong Pin. Curvature and mechanics. Advances in Math., 15:269–311, 1975. [19] Andrew M. Stuart. Inverse problems: a Bayesian perspective. Acta Numer., 19:451–559, 2010. [20] Karl-Theodor Sturm. On the geometry of metric measure spaces. I. Acta Math., 196(1):65– 131, 2006. [21] Karl-Theodor Sturm. On the geometry of metric measure spaces. II. Acta Math., 196(1):133– 177, 2006. [22] Koen Van Leemput. Encoding probabilistic brain atlases using Bayesian inference. IEEE Transactions on Medical Imaging, 28(6):822–837, June 2009. [23] Miaomiao Zhang, Nikhil Singh, and P. Thomas Fletcher. Bayesian estimation of regularization and atlas building in diffeomorphic image registration. In IPMI 2013, LNCS, pages 37–48, Berlin, Heidelberg, 2013. Springer-Verlag. 9
2014
313
5,418
Inferring sparse representations of continuous signals with continuous orthogonal matching pursuit Karin C. Knudson Department of Mathematics The University of Texas at Austin kknudson@math.utexas.edu Jacob L. Yates Department of Neuroscience The University of Texas at Austin jlyates@utexas.edu Alexander C. Huk Center for Perceptual Systems Departments of Psychology & Neuroscience The University of Texas at Austin huk@utexas.edu Jonathan W. Pillow Princeton Neuroscience Institute and Department of Psychology Princeton University pillow@princeton.edu Abstract Many signals, such as spike trains recorded in multi-channel electrophysiological recordings, may be represented as the sparse sum of translated and scaled copies of waveforms whose timing and amplitudes are of interest. From the aggregate signal, one may seek to estimate the identities, amplitudes, and translations of the waveforms that compose the signal. Here we present a fast method for recovering these identities, amplitudes, and translations. The method involves greedily selecting component waveforms and then refining estimates of their amplitudes and translations, moving iteratively between these steps in a process analogous to the well-known Orthogonal Matching Pursuit (OMP) algorithm [11]. Our approach for modeling translations borrows from Continuous Basis Pursuit (CBP) [4], which we extend in several ways: by selecting a subspace that optimally captures translated copies of the waveforms, replacing the convex optimization problem with a greedy approach, and moving to the Fourier domain to more precisely estimate time shifts. We test the resulting method, which we call Continuous Orthogonal Matching Pursuit (COMP), on simulated and neural data, where it shows gains over CBP in both speed and accuracy. 1 Introduction It is often the case that an observed signal is a linear combination of some other target signals that one wishes to resolve from each other and from background noise. For example, the voltage trace from an electrode (or array of electrodes) used to measure neural activity in vivo may be recording from a population of neurons, each of which produces many instances of its own stereotyped action potential waveform. One would like to decompose an analog voltage trace into a list of the timings and amplitudes of action potentials (spikes) for each neuron. Motivated in part by the spike-sorting problem, we consider the case where we are given a signal that is the sum of known waveforms whose timing and amplitude we seek to recover. Specifically, we suppose our signal can be modeled as: y(t) = Nf X n=1 J X j=1 an,jfn(t −τn,j), (1) 1 where the waveforms fn are known, and we seek to estimate positive amplitudes an,j and event times τn,j. Signals of this form have been studied extensively [12, 9, 4, 3]. This a difficult problem in part because of the nonlinear dependence of y on τ. Moreover, in most applications we do not have access to y(t) for arbitrary t, but rather have a vector of sampled (noisy) measurements on a grid of discrete time points. One way to simplify the problem is to discretize τ, considering only a finite set of possible time shift τn,j ∈{∆, 2∆..., N∆∆} and approximating the signal as y ≈ Nf X n=1 J X j=1 an,jfn(t −in,j∆), in,j ∈1, ..., N∆ (2) Once discretized in this way, the problem is one of sparse recovery: we seek to represent the observed signal with a sparse linear combination of elements of a finite dictionary {fn,j(t) := fn(t −j∆), n ∈1, ..., Nf , j ∈1, ..., N∆}. Framing the problem as sparse recovery, one can bring tools from compressed sensing to bear. However, the discretization introduces several new difficulties. First, we can only approximate the translation τ by values on a discrete grid. Secondly, choosing small ∆allows us to more closely approximate τ, but demands more computation, and such finely spaced dictionary elements yield a highly coherent dictionary, while sparse recovery algorithms generally have guarantees for low-coherence dictionaries. A previously introduced algorithm that uses techniques of sparse recovery and returns accurate and continuous valued estimates of a and τ is Continuous Basis Pursuit (CBP) [4], which we describe below. CBP proceeds (roughly speaking) by augmenting the discrete dictionary fn,j(t) with other carefully chosen basis elements, and then solving a convex optimization problem inspired by basis pursuit denoising. We extend ideas introduced in CBP to present a new method for recovering the desired time shifts τ and amplitudes a that leverage the speed and tractability of solving the discretized problem while still ultimately producing continuous valued estimates of τ, and partially circumventing the problem of too much coherence. Basis pursuit denoising and other convex optimization or ℓ1-minimization based methods have been effective in the realm of sparse recovery and compressed sensing. However, greedy methods have also been used with great success. Our approach begins with the augmented bases used in CBP, but adds basis vectors greedily, drawing on the well known Orthogonal Matching Pursuit algorithm [11]. In the regimes considered, our greedy approach is faster and more accurate than CBP. Broadly speaking, our approach has three parts. First, we augment the discretized basis in one of several ways. We draw on [4] for two of these choices, but also present another choice of basis that is in some sense optimal. Second, we greedily select candidate time bins of size ∆in which we suspect an event has occurred. Finally, we move from this rough, discrete-valued estimate of timing τ to continuous-valued estimates of τ and a. We iterate the second and third steps, greedily adding candidate time bins and updating our estimates of τ and a until a stopping criterion is reached. The structure of the paper is as follows. In Section 2 we describe the method of Continuous Basis Pursuit (CBP), which our method builds upon. In Section 3 we develop our method, which we call Continuous Orthogonal Matching Pursuit (COMP). In Section 4 we present the performance of our method on simulated and neural data. 2 Continuous basis pursuit Continuous Basis Pursuit (CBP) [4, 3, 5] is a method for recovering the time shifts and amplitudes of waveforms present in a signal of the form (1). A key element of CBP is augmenting or replacing the set {fn,j(t)} with certain additional dictionary elements that are chosen to smoothly interpolate the one dimensional manifold traced out by fn,j(t −τ) as τ varies in (−∆/2, ∆/2). The benefit of a dictionary that is expanded in this way is twofold. First, it increases the ability of the dictionary to represent shifted copies of the waveform fn(t −τ) without introducing as much correlation as would be introduced by simply using a finer discretization (decreasing ∆), which is an advantage because dictionaries with smaller coherence are generally better suited for sparse recovery techniques. Second, one can move from recovered coefficients in this augmented dictionary to estimates an,j and continuous-valued estimates of τn,j. 2 In general, there are three ingredients for CBP: basis elements, an interpolator with corresponding mapping function Φ, and a convex constraint set, C. There are K basis elements {gn,j,k(t) = gn,k(t−j∆)}k=K k=1 , for each waveform and width-∆time bin, which together can be used to linearly interpolate fn,j(t −τ), |τ| < ∆/2. The function Φ maps from amplitude a and time shift τ to Ktuples of coefficients Φ(a, τ) = (c(1) n,j, ..., c(K) n,j ), so afn,j(t −τ) ≈PK k=1 c(k) n,jgn,j,k(t). The convex constraint set C is for K-tuples of coefficients of {gn,j,k}k=K k=1 and corresponds to the requirement that a > 0 and |τ| < ∆/2. If the constraint region corresponding to these requirements is not convex (e.g. in the polar basis discussed below), its convex relaxation is used. As a concrete example, let us first consider (as discussed in [4]) the dictionary augmented with shifted copies of each waveform’s derivative : {f ′ n,j(t) := f ′ n(t−j∆)}. Assuming fn is sufficiently smooth, we have from the Taylor expansion that for small τ, afn,j(t−τ) ≈afn,j(t)−aτf ′ n,j(t). If we recover a representation of y as c1fn,j(t)+c2f ′ n,j(t), then we can estimate the amplitude a of the waveform present in y as c1, the time shift τ as −c2/c1. Hence, we estimate y ≈c1fn,j(t+c2/c1) = c1fn(t −j∆+ c2/c1). Note that the estimate of the time shift τ varies continuously with c1, c2. In contrast, using shifted copies of the waveforms only as a basis would not allow for a time shift estimate off of the grid {j∆}j=N∆ j=1 . Once a suitable dictionary is chosen, one must still recover coefficients (i.e. c1, c2 above). Motivated by the assumed sparsity of the signal (i.e. y is the sum of relatively few shifted copies of waveforms, so the coefficients of most dictionary elements will be zero), CBP draws on the basis pursuit denoising, which has been effective in the compressive sensing setting and elsewhere [10],[1]. Specifically, CBP (with a Taylor basis) recovers coefficients using: argminc Nf X n=1 (Fnc(1) n + F′ nc(2) n ) −y 2 2 + λ Nf X n=1 c(1) n 1 s.t. c(1) n,i ≥0 , |c(2) n,i| ≤∆ 2 c(1) i,n ∀n, i (3) Here we denote by F the matrix with columns {fn,j(t)} and F′ the matrix with columns {f ′ n,j(t)}. The ℓ1 penalty encourages sparsity, pushing most of the estimated amplitudes to zero, with higher λ encouraging greater sparsity. Then, for each (n, j) such that c(1) n,j ̸= 0, one estimates that there is a waveform in the shape of fn with amplitude ˆa = c(1) n,j and time shift j∆−ˆτ = j∆−c(2) n,j/c(1) n,j present in the signal. The inequality constraints in the optimization problem ensure first that we only recover positive amplitudes ˆa, and second that estimates ˆτ satisfy |ˆτ| < ∆/2. Requiring ˆτ to fall in this range keeps the estimated τ in the time bin represented by fn,j and also in the regime where they Taylor approximation to fn,j(t−τ) is accurate. Note that (3) is a convex optimization problem. Better results in [4] are obtained for a second order Taylor interpolation and the best results come from a polar interpolator, which represents each manifold of time-shifted waveforms fn,j(t − τ), |τ| ≤∆/2 as an arc of the circle that is uniquely defined to pass through fn,j(t), fn,j(t −∆/2), and fn,j(t+∆/2). Letting the radius of the arc be r, and its angle be 2θ one represents points on this arc by linear combinations of functions w, u, v: f(t−τ) ≈w(t)+r cos( 2τ ∆θ)u(t)+r sin( 2τ ∆θ)v(t). The Taylor and polar bases consist of shifted copies of elements chosen in order to linearly interpolate the curve in function space defined by fn(t −τ) as τ varies from −∆/2 to ∆/2. Let Gn,k be the matrix whose columns are gn,j,k(t) for j ∈1, ..., N∆. With choices of basis elements, interpolator, and corresponding convex constraint set C in place, one proceeds to estimate coefficients in the chosen basis by solving: argminc y − Nf X n=1 K X k=1 Gn,kc(k) n 2 2 + λ∥ Nf X n=1 c(1) n ∥1 subject to (c(1) n,j, ..., c(K) n,j ) ∈C ∀(n, j) (4) One then maps back from each nonzero K-tuple of recovered coefficients c(1) n,j, ..., c(K) n,j to corresponding ˆan,j, ˆτn,j that represent the amplitude and timing of the nth waveform present in the jth time bin. This can be done by inverting Φ, if possible, or estimating (ˆan,j, ˆτn,j) = argmina,τ∥Φ(a, τ) −(c(1) n,j, ..., c(K) n,j )∥2 2. 3 Table 1: Basis choices (see also [4], Table 1.) Interpolator Basis Vectors Φ(a, τ) C Taylor {fn,j(t)}, {f ′ n,j(t)}, (a, −aτ, a τ 2 2 ) c(1), c(3) > 0, |c(2)| < c(1) ∆ 2 , (K=3) {f ′′ n,j(t)} |c(3)| < c(1) ∆2 8 Polar {wn,j}, {un,j}, (a, ar cos( 2τ ∆θ), c(1) ≥0, p (c(2))2 + (c(3))2 ≤rc(1) {vn,j} ar sin( 2τ ∆θ)) rc(1) cos(θ) ≤c(2) ≤rc(1) SVD {u1 n,j}...{uK n,j}. (See Section 3.1) (See Section 3.1) 3 Continuous Orthogonal Matching Pursuit We now present our method for recovery, which makes use of the idea of augmented bases presented above, but differs from CBP in several important ways. First, we introduce a different choice of basis that we find enables more accurate estimates. Second, we make use of a greedy method that iterates between choosing basis vectors and estimating time shifts and amplitudes, rather than proceeding via a single convex optimization problem as CBP does. Lastly, we introduce an alternative to the step of mapping back from recovered coefficients via Φ that notably improves the accuracy of the recovered time estimates. Greedy methods such as Orthogonal Matching Pursuit (OMP) [11], Subspace Pursuit [2], and Compressive Sampling Matching Pursuit (CoSaMP) [8] have proven to be fast and effective in the realm of compressed sensing. Since the number of iterations of these greedy methods tend to go as the sparsity (when the algorithms succeed), they tend to be extremely fast when for very sparse signals. Moreover, our the greedy method eliminates the need to choose a regularization constant λ, a choice that can vastly alter the effectiveness of CBP. (We still need to choose K and ∆.) Our method is most closely analogous to OMP, but recovers continuous time estimates, so we call it Continuous Orthogonal Matching Pursuit (COMP). However, the steps below could be adapted in a straightforward way to create analogs of other greedy methods. 3.1 Choice of finite basis We build upon [4], choosing as our basis N∆shifted copies of a set of K basis vectors for each waveform in such away that these K basis vectors can effectively linearly interpolate fn(t −τ) for |τ| < ∆/2. In our method, as in Continuous Basis Pursuit, these basis vectors allow us to represent continuous time shifts instead of discrete time shifts, and expand the descriptive power of our dictionary without introducing undue amounts of coherence. While previous work introduced Taylor and polar bases, we obtain the best recovery from a different basis, which we describe now. The basis comes from a singular value decomposition of a matrix whose columns correspond to discrete points on the curve in function space traced out by fn,j(t −τ) as we vary τ for |τ| < ∆/2. Within one time bin of size ∆, consider discretizing further into Nδ = ∆/δ time bins of size δ ≪∆. Let Fδ be the matrix with columns that are these (slightly) shifted copies of the waveform, so that the ith column of Fδ is fn,j(t −iδ + ∆/2) for a discrete vector of time points t. Each column of this matrix is a discrete point on the curve traced out by fn,j(t −τ) as τ varies. In choosing a basis, we seek the best choice of K vectors to use to linearly interpolate this curve. We might instead seek to solve the related problem of finding the best K vectors to represent these finely spaced points on the curve, in which case a clear choice for these K vectors is the first K left singular vectors of Fδ. This choice is optimal in the sense that the singular value decomposition yields the best rank-K approximation to a matrix. If Fδ = UΣVT is the singular value decomposition, and uk, vk are the columns of U and V respectively, then ∥Fδ −PK k=1 ukΣk,k(vk)T ∥≤∥F −A∥for any rank-K matrix A and any unitarily invariant norm ∥· ∥. 4 In order to use this SVD basis with CBP or COMP, one must specify a convex constraint set for the coefficients of this basis. Since afn,j(t−iδ) = PK k=1 aukΣk,kvk i a reasonable and simply enforced constraint set would be to assume that the recovered coefficients c(k) corresponding to each basis vector uk, when divided by c(1) to account for scaling, be between mini Σk,kvk i and maxi Σk,kvk i . A simple way to recover a and τ would to choose τ = iδ and a, i to minimize PK k=1(c(k)−aΣk,kvk i )2. In figure 3.1, we compare the error between shifted copies of a sample waveform f(t −τ) for |τ| < 0.5 and the best (least-squares) approximation of that waveform as a linear combination of K = 3 vectors from the Taylor, polar, and SVD bases. The structure of the error as a function of the time shift τ reflects the structure of these bases. The Taylor approximation is chosen to be exactly accurate at τ = 0 while the polar basis is chosen to be precisely accurate at τ = 0, ∆/2, −∆/2. The SVD basis gives the lowest mean error across time shifts. 5 0 5 0.5 0 0.5 Original Waveform Approximation Error Taylor: Polar: SVD: 0.027 0.027 0.014 Basis Vectors Taylor Polar SVD 5 0 5 0.2 0 0.2 5 0 5 1 0 1 5 0 5 2 0 2 0.5 0 0.5 0.02 0.04 0.06 0.08 time shift l2 error Taylor Polar SVD f(t) t t t t Figure 1: Using sample waveform f(t) ∝t exp(−t2) (left panel), we compare the error introduced by approximating f(t−τ) for varying τ with a linear combination of K = 3 basis vectors, from the Taylor, polar or SVD bases. Basis vectors are shown in the middle three panels, and error in the far right panel. The SVD basis introduces the least error on average over the shift τ. The average errors for the Taylor, polar, and SVD bases are 0.026, 0.027, and 0.014 respectively. 3.2 Greedy recovery Having chosen our basis, we then greedily recover the time bins in which an occurrence of each waveform appears to be present. We would like to build up a set of pairs (n, j) corresponding to an instance of the nth waveform in the jth time bin. (In our third step, we will refine the estimate within the chosen bins.) Our greedy method is motivated by Orthogonal Matching Pursuit (OMP), which is used to recover a sparse solution x from measurements y = Ax. In OMP [11], one greedily adds a single dictionary element to an estimated support set S at each iteration, and then projects orthogonally to adjust the coefficients of all chosen dictionary elements. After initializing with S = ∅, x = 0, one iterates the following until a stopping criterion is met: r = y −Ax j = argmaxj{|⟨aj, r⟩| s.t. j ∈{1, ...J}\S} S = S ∪{j} x = argminz{||y −Az||2 s.t. zi = 0 ∀i /∈S} If we knew the sparsity of the signal, we could use that as our stopping condition. Normally we do not know the sparsity a priori; we stop when changes in the residual become sufficiently small. We adjust this method to choose at each step not a single additional element but rather a set of K associated basis vectors. S is again initialized to be empty, but at each step we add a timebin/waveform pair (n, j), which is associated with K basis vectors. In this way, we are adding K vectors at each step, instead of one as in OMP. We greedily add the next index (n, j) according to: (n, j) = argminm,i ( min cm,i{∥ k X i=1 c(k) m,ig(k) m,i −r∥2 2 s.t. cm,i ∈C} , (m, i) ∈Sc ) (5) 5 Here {g(k) m,i} are the chosen basis vectors (Taylor, polar, or SVD), and C is the corresponding constraint set, as in Section 2. In comparison with the greedy step in OMP, choosing j as in (5) is more costly, because we need to perform a constrained optimization over a K dimensional space for each n, j. Fortunately, it is not necessary to repeat the optimization for each of the Nf · N∆possible indices each time we add an index. Assuming waves are localized in time, we need only update the results of the constrained optimization locally. When we update the residual r by subtracting the newly identified waveform n in the jth bin, the residual only changes in the bins at or near the jth bin, so we need only update the quantity mincn,j′ {∥Pk i=1 c(k) n,j′g(k) n,j′ −r∥2 2 s.t. cn,j′ ∈C } for j′ neighboring j. 3.3 Estimating time shifts Having greedily added a new waveform/timebin index pair (n, j), we next define our update step, which will correspond to the orthogonal projection in OMP. We present two alternatives, one of which most closely mirrors the corresponding step in OMP, the other of which works within the Fourier domain to obtain more accurate recovery. To most closely follow the steps of OMP, at each iteration after updating S we update coefficients c according to: argminc X (n,j)∈S K X k=1 c(k) n,jg(k) n,j −y 2 2 subject to cn,j ∈C ∀(n, j) ∈S (6) We alternate between the greedily updating S via (5), and updating c as in (6), at each iteration finding the new residual r = P (n,j)∈S PK k=1 c(k) n,jg(k) n,j−y ) until the ℓ2 stopping criterion is reached. Then, one maps back from {cn,j}(n,j)∈S to {a(n,j), τ(n,j)}(n,j)∈S as described in Section 2. Alternatively we may replace the orthogonal projection step with a more accurate recovery of spike timings that involves working in the Fourier domain. We use the property of the Fourier transform with respect to translation that: (f(t −τ))∧= e2πiτ ˆf. This allows us to estimate a, τ directly via: argmina,τ∥( X n,j∈S an,je2πiωτn,j ˆfn,j(ω)) −ˆy(ω)∥2 subject to |τn,j| < ∆/2 ∀(n, j) ∈S (7) This is a nonlinear and non-convex constrained optimization problem. However, it can be solved reasonably quickly using, for example, trust region methods. The search space is dramatically reduced because τ has only |S| entries, each constrained to be small in absolute value. By searching directly for a, τ as in (7) we sacrifice convexity, but with the benefit of eliminating from this step error of interpolation introduced as we map back from c to a, τ using Φ−1 or a least squares estimation. It is easy and often helpful to add inequality constraints to a as well, for example requiring a to be in some interval around 1, and we do impose this in our spike-sorting simulations and analysis in Section 4. Such a requirement effectively imposes a uniform prior on a over the chosen interval. It would be an interesting future project to explore imposing other priors on a. 4 Results We test COMP and CBP for each choice of basis on simulated and neural data. Here, COMP denotes the greedy method that includes direct estimation of a and τ during the update set as in (7). The convex optimization for CBP is implemented using the cvx package for MATLAB [7], [6]. 4.1 Simulated data We simulate a signal y as the sum of time-shifted copies of two sample waveforms f1(t) ∝ t exp(−t2) and f2(t) ∝e−t4/16 −e−t2 (Figure 2a). There are s1 = s2 = 5 shifted copies of f1 and f2, respectively. The time shifts are independently generated for each of the two waveforms using a Poisson process (truncated after 5 spikes), and independent Gaussian noise of variance σ2 is 6 5 0 5 0.5 0 0.5 t 5 0 5 0.5 0 0.5 t CBP-SVD COMP-SVD 0 .05 .1 .2 .4 0 0.5 1 1.5 2 2.5 Noise ( ) (Misses + False Positives)/s CBP Taylor CBP Polar CBP SVD COMP Taylor COMP Polar COMP SVD 0 .05 .1 .2 .4 0 0.1 0.2 0.3 0.4 0.5 Average Hit Error Noise ( ) 0 20 40 60 80 100 1 0.5 0 0.5 1 0 20 40 60 80 100 1 0.5 0 0.5 1 0 20 40 60 80 100 0 0.5 1 1.5 0 20 40 60 80 100 0 0.5 1 1.5 True COMP SVD 0 20 40 60 80 100 0 0.5 1 1.5 0 20 40 60 80 100 0 0.5 1 1.5 True CBP SVD waveform 1 t t t waveform 2 waveform 1 waveform 1 waveform 2 waveform 2 (a) (b) (c) (d) (e) (f) Figure 2: (a) Waveforms present in the signal. (b) A noiseless (top) and noisy (bottom) signal with σ = .2. (c) Recovery using CBP. (d) Recovery using COMP (with a, τ updated as in (7)). (e) For each recovery method over different values of the standard deviation of the noise σ, misses plus false positives, divided by the total number of events present, s = s1 + s2. (f) Average distance between the true and estimated spike for each hit. added at each time point. Figures 2b,c show an example noise-free signal (σ = 0), and noisy signal (σ = .2) on which each recovery method will be run. We run CBP with the Taylor and polar bases, but also with our SVD basis, and COMP with all three bases. Since COMP here imposes a lower bound on a, we also impose a thresholding step after recovery with CBP, discarding any recovered waveforms with amplitude less than .3. We find the thresholding generally improved the performance of the CBP algorithm by pruning false positives. Throughout, we use K = 3, since the polar basis requires 3 basis vectors per bin. We categorize hits, false positive and misses based on whether a time shift estimate is within a threshold of ϵ = 1 of the true value. The “average hit error” of Figure 2h, 3b is the average distance between the true and estimated event time for each estimate that is categorized as a hit. Results are averaged over 20 trials. We compare CBP and COMP over different parameter regimes, varying the noise (σ) and the bin size (∆). Figures 2g and 3a show misses plus false positives for each method, normalized by the total number of events present. Figures 2f and 3b show average distance between the true and estimated spike for each estimate categorized as a hit. The best performance by both measures across nearly all parameter regimes considered is achieved by COMP using the SVD basis. COMP is more robust to noise (Figure 2g), and also to increases in bin width ∆. Since both algorithms are faster for higher ∆, robustness with respect to ∆is an advantage. We also note a significant increase in CBP’s robustness to noise when we implement it with our SVD basis rather than with the Taylor or polar basis (Figure 2e). A significant advantage of COMP over CBP is its speed. In Figure 3c we compare the speed of COMP (solid) and CBP (dashed) algorithms for each basis. COMP yields vast gains in speed. The comparison is especially dramatic for small ∆, where results are most accurate across methods. 4.2 Neural data We now present recovery of spike times and identities from neural data. Recordings were made using glass-coated tungsten electrodes in the lateral intraparietal sulcus (LIP) of a macaque monkey performing a motion discrimination task. In addition to demonstrating the applicability of COMP to sorting spikes in neural data, this section also shows the resistance of COMP to a certain kind of error that recovery via CBP can systematically commit, and which is relevant to neural data. 7 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 Bin Width ( ) (Misses + False Positives)/s 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 Bin Width ( ) (Misses + False Positives)/s 0.5 1 1.5 2 2.5 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Average Hit Error Bin Width ( ) (a) (b) 0.5 1 1.5 2 2.5 0 100 200 300 400 500 Bin Width ( ) Computing Time CBP Taylor CBP Polar CBP SVD COMP Taylor COMP Polar COMP SVD (c) Figure 3: (a) Misses plus false positives, divided by the total number of events present, s = s1 + s2 over different values of bin width ∆. (b) Average distance between the true and estimated spike for each hit for each recovery method. (c) Run time for COMP (solid) and CBP (dashed) for each basis. 0 0.5 1 1.5 2 0.5 0.4 0.3 0.2 0.1 0 0.1 time (ms) Neuron 1 Neuron 2 (a) (b) (c) 0 10 20 30 40 50 60 70 80 90 100 0 0.5 1 1.5 Neuron 1 0 10 20 30 40 50 60 70 80 90 100 0 0.5 1 1.5 time (ms) Neuron 2 0 20 40 60 80 100 0.5 0 0.5 time (ms) 70 70.5 71 71.5 72 72.5 73 0.2 0.1 0 0.1 time (ms) Waveforms Recovered Spikes Voltage Trace COMP-SVD CBP-SVD Figure 4: (a) Two neural waveforms; each is close to as scaled copy of the other (b) Recovery of spikes via COMP (magenta) and CBP (cyan) using the SVD basis. CBP tends to recover smallamplitude instances of waveform one where COMP recovers large amplitude instances of waveform two (c) Top: recovered traces. Lower panel: zooming in on an area of disagreement between COMP and CBP. The large-ampltude copy of waveform two more closely matches the trace In the data, the waveform of one neuron resembles a scaled copy of another (Figure 4a).The similarity causes problems for CBP or any other ℓ1 minimization based method that penalizes large amplitudes. When the second waveform is present with an amplitude of one, CBP is likely to incorrectly add a low-amplitude copy of the first waveform (to reduce the amplitude penalty), instead of correctly choosing the larger copy of the second waveform; the amplitude penalty for choosing the correct waveform can outweigh the higher ℓ2 error caused by including the incorrect waveform. This misassignment is exactly what we observe (Figure 4b). We see that CBP tends to report smallamplitude copies of waveform one where COMP reports large-amplitude copies of waveform two. Although we lack ground truth, the closer match of the recovered signal to data (Figure 4c) indicates that the waveform identities and amplitudes identified via COMP better explain the observed signal. 5 Discussion We have presented a new greedy method called Continuous Orthogonal Matching Pursuit (COMP) for identifying the timings and amplitudes for waveforms from a signal that has the form of a (noisy) sum of shifted and scaled copies of several known waveforms. We draw upon the method of Continuous Basis Pursuit, and extend it in several ways. We leverage the success of Orthogonal Matching Pursuit in the realm of sparse recovery, use a different basis derived from a singular value decomposition, and also introduce a move to the Fourier domain to fine-tune the recovered time shifts. Our SVD basis can also be used with CBP and in our simulations it increased performance of CBP as compared to previously used bases. In our simulations COMP obtains increased accuracy as well as greatly increased speed over CBP across nearly all regimes tested. Our results suggest that greedy methods of the type introduced here may be quite promising for, among other applications, spike-sorting during the processing of neural data. Acknowledgments This work was supported by the McKnight Foundation (JP), NSF CAREER Award IIS-1150186 (JP), and grants from the NIH (NEI grant EY017366 and NIMH grant MH099611 to AH & JP). 8 References [1] Scott Shaobing Chen, David L Donoho, and Michael A Saunders. Atomic decomposition by basis pursuit. SIAM journal on scientific computing, 20(1):33–61, 1998. [2] Wei Dai and Olgica Milenkovic. Subspace pursuit for compressive sensing signal reconstruction. Information Theory, IEEE Transactions on, 55(5):2230–2249, 2009. [3] Chaitanya Ekanadham, Daniel Tranchina, and Eero P Simoncelli. A blind deconvolution method for neural spike identification. In Proceedings of the 25th Annual Conference on Neural Information Processing Systems (NIPS11), volume 23, 2011. [4] Chaitanya Ekanadham, Daniel Tranchina, and Eero P Simoncelli. Recovery of sparse translation-invariant signals with continuous basis pursuit. Signal Processing, IEEE Transactions on, 59(10):4735–4744, 2011. [5] D. Ekanadham, C.vand Tranchina and E. P. Simoncelli. A unified framework and method for automatic neural spike identification. Journal of Neuroscience Methods, 222:47–55, 2014. [6] M. Grant and S. Boyd. Graph implementations for nonsmooth convex programs. In V. Blondel, S. Boyd, and H. Kimura, editors, Recent Advances in Learning and Control, Lecture Notes in Control and Information Sciences, pages 95–110. Springer-Verlag Limited, 2008. http: //stanford.edu/˜boyd/graph_dcp.html. [7] CVX Research Inc. CVX: Matlab software for disciplined convex programming, version 2.0. http://cvxr.com/cvx, August 2012. [8] Deanna Needell and Joel A Tropp. Cosamp: Iterative signal recovery from incomplete and inaccurate samples. Applied and Computational Harmonic Analysis, 26(3):301–321, 2009. [9] Jonathan W Pillow, Jonathon Shlens, EJ Chichilnisky, and Eero P Simoncelli. A model-based spike sorting algorithm for removing correlation artifacts in multi-neuron recordings. PloS one, 8(5):e62123, 2013. [10] Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pages 267–288, 1996. [11] Joel A Tropp and Anna C Gilbert. Signal recovery from random measurements via orthogonal matching pursuit. Information Theory, IEEE Transactions on, 53(12):4655–4666, 2007. [12] Martin Vetterli, Pina Marziliano, and Thierry Blu. Sampling signals with finite rate of innovation. Signal Processing, IEEE Transactions on, 50(6):1417–1428, 2002. 9
2014
314
5,419
Zeta Hull Pursuits: Learning Nonconvex Data Hulls Yuanjun Xiong† Wei Liu‡ Deli Zhao♯ Xiaoou Tang† †Information Engineering Department, The Chinese University of Hong Kong, Hong Kong ‡IBM T. J. Watson Research Center, Yorktown Heights, New York, USA ♯Advanced Algorithm Research Group, HTC, Beijing, China {yjxiong,xtang}@ie.cuhk.edu.hk weiliu@us.ibm.com deli zhao@htc.com Abstract Selecting a small informative subset from a given dataset, also called column sampling, has drawn much attention in machine learning. For incorporating structured data information into column sampling, research efforts were devoted to the cases where data points are fitted with clusters, simplices, or general convex hulls. This paper aims to study nonconvex hull learning which has rarely been investigated in the literature. In order to learn data-adaptive nonconvex hulls, a novel approach is proposed based on a graph-theoretic measure that leverages graph cycles to characterize the structural complexities of input data points. Employing this measure, we present a greedy algorithmic framework, dubbed Zeta Hulls, to perform structured column sampling. The process of pursuing a Zeta hull involves the computation of matrix inverse. To accelerate the matrix inversion computation and reduce its space complexity as well, we exploit a low-rank approximation to the graph adjacency matrix by using an efficient anchor graph technique. Extensive experimental results show that data representation learned by Zeta Hulls can achieve state-of-the-art accuracy in text and image classification tasks. 1 Introduction In the era of big data, a natural idea is to select a small subset of m samples Ce = {xe1, . . . , xem} from a whole set of n data points X = {x1, . . . , xn} such that the selected points Ce can capture the underlying properties or structures of X. Then machine learning and data mining algorithms can be carried out with Ce instead of X, thereby leading to significant reductions in computational and space complexities. Let us write the matrix forms of Ce and X as C = [xe1, . . . , xem] ∈Rd×m and X = [x1, . . . , xn] ∈Rd×n, respectively. Here d is the dimensions of input data points. In other words, C is a column subset selection of X. The task of selecting C from X is also called by column sampling in the literature, and maintains importance in a variety of fields besides machine learning, such as signal processing, geoscience and remote sensing, and applied mathematics. This paper concentrates on solving the column sampling problem by means of graph-theoretic methods. Existing methods in column sampling fall into two main categories according to their objectives: 1) approximate the data matrix X, and 2) discover the underlying data structures. For machine learning methods using kernel or similar “N-Body” techniques, the Nystr¨om matrix approximation is usually applied to approximate large matrices. Such circumstances include fast training of nonlinear kernel support vector machines (SVM) in the dual form [30], spectral clustering [8], manifold learning [25], etc. Minimizing a relative approximation error is typically harnessed as the objective of column sampling, by which the most intuitive solution is to perform uniform sampling [30]. Other non-uniform sampling schemes choose columns via various criteria, such as probabilistic samplings according to diagonal elements of a kernel matrix [7], reconstruction errors [15], determinant measurements [1], cluster centroids [33], and statistical leverage scores [21]. On the other hand, column sampling 1 may be cast into a combinatorial optimization problem, which can be tackled by using greedy strategies in polynomial time [4] and boosted by using advanced sampling strategies to further reduce the relative approximation error [14]. From another perspective, we are aware that data points may form some interesting structures. Understanding these structures has been proven beneficial to approximate or represent data inputs [11]. One of the most famous algorithms for dimensionality reduction, Non-negative Matrix Factorization (NMF) [16], learns a low-dimensional convex hull from data points through a convex relaxation [3]. This idea was extended to signal separation by pursuing a convex hull with a maximized volume [27] to enclose input data points. Assuming that vertices are equally distant, the problem of fitting a simplex with a maximized volume to data reduces to a simple greedy column selection procedure [26]. The simplex fitting approach demonstrated its success in face recognition tasks [32]. Parallel research in geoscience and remote sensing is also active, where the vertices of a convex hull are coined as endmembers or extreme points, leading to a classic “N-Finder” algorithm [31]. The above approaches tried to learn data structures that are usually characterized by convexity. Hence, they may fail to reveal the intrinsic data structures when the distributions of data points are diverse, e.g., data being on manifolds or concave structures. Probabilistic models like Determinantal Point Process (DPP) [13] measure data densities, so they are likely to overcome the convexity issue. However, few previous work accessed structural information of possibly nonconvex data for column sampling/subset selection tasks. This paper aims to address the issue of learning nonconvex structures of data in the case where the data distributions can be arbitrary. More specifically, we learn a nonconvex hull to encapsulate the data structure. The on-hull points tightly enclose the dataset but do not need to form a convex set. Thus, nonconvex hulls can be more adaptive to capture practically complex data structures. Akin to convex hull learning, our proposed approach also extracts extreme points from an input dataset. To complete this task, we start with exploring the property of graph cycles in a neighborhood graph built over the input data points. Using cycle-based measures to characterize data structures has been proven successful in clustering data of multiple types of distributions [34]. To induce a measure of structural complexities stemming from graph cycles, we introduce the Zeta Function which applies the integration of graph cycles to model the linkage properties of the neighborhood graph. The key advantage of the Zeta function is uniting both global and local connection properties of the graph. As such, we are able to learn a hull which encompasses almost all input data points but is not necessary to be convex. With structural complexities captured in the form of the Zeta function, we present a leave-one-out strategy to find the extreme points. The basic idea is that removing the on-hull points only has weak impact on structural complexities of the graph. The decision of removal will be based on extremeness of a data point. Our model, dubbed Zeta Hulls, is derived by computing and analyzing the extremeness of data points. The greedy pursuit of the Zeta Hull model requires the computation of the inversion of a matrix obtained from the graph affinity matrix, which is computationally prohibitive for massive-scale data. To accelerate such a matrix manipulation, we employ the Anchor Graph [18] technique in the sense that the original graph can be approximated with respect to the anchors originating from a randomly sampled data subset. Our model is testified through extensive experiments on toy data and real-world text and image datasets. Experimental results show that in terms of unsupervised data representation learning, the Zeta Hull based methods outperform the state-of-the-art methods used in convex hull learning, clustering, matrix factorization, and dictionary learning. 2 Nonconvex Hull Learning To elaborate on our approach, we first introduce and define the point extremeness. It measures the degree of a data point being prone to lie on or near a nonconvex hull by virtue of a neighborhood graph drawn from an input dataset. As an intuitive criterion, the data point with strong connections in the graph should have the low point extremeness. To obtain the extremeness measure, we need to explore the underlying structure of the graph, where graph cycles are employed. 2.1 Zeta Function and Structural Complexity We model graph cycles by means of a sum-product rule and then integrate them using a Zeta function. There are many variants of original Riemann Zeta Function, one of which is specialized in 2 (a) Original Graph (b) Remaining Graph Figure 1: An illustration of pursuing on-hull points using the graph measure. (a) shows a point set with a k-nearest neighbor graph. Points in red are ones lying on the hull of the point set, e.g., the points we tend to select by the Zeta Hull Pursuit algorithm. (b) shows the remaining point set and the graph after removing the on-hull points together with their corresponding edges. We observe that the removal of the on-hull (i.e., “extreme”) points yields little impact on the structural complexity of the graph. weighted adjacency graphs. Applying the theoretical results of Zeta functions provides us a powerful tool for characterizing structural complexities of graphs. The numerical description of graph structures will play a critical role in column sampling/subset selection tasks. Formally, given a graph G(X, E) with n nodes being data points in X = {xi}n i=1, let the n × n matrix W denote the weighted adjacency (or affinity) matrix of the graph G built over the dataset X. Usually the graph affinities are calculated with a proper distance metric. To be generic, we assume that G is directed. Then an edge leaving from xi to xj is denoted as eij. A path of length ℓfrom xi to xj is defined as P(i, j, ℓ) = {ehktk}ℓ k=1 with h1 = i and tℓ= j. Note that the nodes in this path can be duplicate. A graph cycle, as a special case of paths of length ℓ, is also defined as γℓ= P(i, i, ℓ) (i = 1, . . . , n). The sum-product path affinity νℓfor all ℓ-length cycles can then be computed by νℓ=  γℓ∈κℓνγℓ=  γℓ∈κℓwtℓ−1h1 ℓ−1 k=1 whktk, where κℓdenotes the set of all possible cycles of length ℓand whktk denotes the (hk, tk)-entry of W, i.e., the affinity from node xhk to node xtk. The edge etℓ−1h1 is the last edge that closes the cycle. The computed compound affinity νℓprovides a measure for all cyclic connections of length ℓ. Then we integrate such affinities for the cycles of lengths being from one to infinity to derive the graph Zeta function as follows, ζz(G) = exp  ∞  ℓ=1 νℓ zℓ ℓ  , (1) where z is a constant. We only consider the situation where z is real-valued. The Zeta function in Eq. (1) has been proven to enjoy a closed form. Its convergence is also guaranteed when z < 1/ρ(W), where ρ(W) is the spectral radius of W. These lead to Theorem 1 [23]. Theorem 1. Let I be the identity matrix and ρ(W) be the spectral radius of the matrix W, respectively. If 0 < z < 1/ρ(W), then ζz(G) = 1/ det(I −zW). Note that W can be asymmetric, implying that λi can be complex. In this case, Theorem 1 still holds. Theorem 1 indicates that the graph Zeta function we formulate in Eq. (1) provides a closedform expression for describing the structural complexity of a graph. The next subsection will give the definition of the point extremeness by analyzing the structural complexity. 2.2 Zeta Hull Pursuits From now on, for simplicity we use ϵG = ζz(G) to represent the structural complexity of the original graph G. To measure the point extremeness numerically, we perform a leave-one-out strategy in the sense that each point in C is successively left out and the variation of ϵG is investigated. This is a natural way to pursue extreme points, because if a point xj lies on the hull it has few communications with the other points. After removing this point and its corresponding edges, the reductive structural complexity of the remaining graph G/xj, which we denote as ϵG/xj, will still be close to ϵG. Hence, the point extremeness εxj is modeled as the relative change of the structural complexity ϵG, that is εxj = ϵG ϵG/xj . Now we have the following theorem. Theorem 2. Given ϵG and ϵG/xj as in Theorem 1, the point extremeness measure εxj of point xj satisfies εxj = (I −zW)−1 (jj), i.e., the point extremeness measure of point xj is equal to the j-th diagonal entry of the matrix (I −zW)−1. 3 Algorithm 1 Zeta Hull Pursuits Input: A dataset X, the number m of data points to be selected, and free parameters z, λ and k. Output: The hull of sampled columns Ce := Cm+1. Initialize: construct W, C1 ←∅, X1 = X, c1 = 0, and W1 = W for i = 1 to m do εxj := (I −zWi)−1 (jj), for xj ∈Xi xei := arg minxj∈Xi(εxj + λ i e⊤ j Wci) Ci+1 := Ci ∪xei ci+1 := ci + eei Xi+1 := Ci/xei Wi+1 := Wi with the ei-th row and column removed end for According to previous analysis, the data point with a small εxj tends to be on the hull and therefore has a strong extremeness. To seek the on-hull points, we need to select a subset of m points Ce = {xe1, . . . , xem} from X such that they have the strongest point extremenesses. We formulate this goal into the following optimization problem: Ce = arg min C⊂X g(C) + λc⊤Wc, (2) where c is a selection vector with m nonzero elements cei = 1 (i = 1, . . . , m), and g(C) is the function which measures the impact on the structural complexity after removing the extracted points. In our case, g(C) = m i=1 εxci . The second term in Eq. (2) is a regularization term enforcing that the selected data points do not intersect with each other. It will enable the selection process to have a better representative capability. The parameter λ controls the extent of the regularization. Naively solving the combinatorial optimization problem in Eq. (2) requires exponential time. By adopting a greedy strategy, we can solve this optimization problem in an iterative manner and with a feasible time complexity. Specifically, in each iteration we extract one point from the current data set and add it to the subset of the selected points. Sticking to this greedy strategy, we will attain the desired m on-hull points after m iterations. In the i-th iteration, we extract the point xei according to the criterion xei = arg min xj∈Xi−1 εxj + λ i e⊤ j Wci−1, (3) where ej is the j-th standard basis vector, and ci−1 is the selection vector according to i−1 selected points before the i-th iteration. We name our algorithm Zeta Hull Pursuits in order to emphasize that we use the Zeta function to pursue the nonconvex data hull. Algorithm 1 summarizes the Zeta Hull Pursuits algorithm. 3 Zeta Hull Pursuits via Anchors Algorithm 1 is applicable to small to medium-scale data X due to its cubical time complexity and quadratic space complexity with respect to the data size |X|. Here we propose a scalable algorithm facilitated by a reasonable prior to tackle the nonconvex hull learning problem efficiently. The idea is to build a low-rank approximation to the graph adjacency matrix W with a small number of sampled data points, namely anchor points. We resort to the Anchor Graph technique [18], which has been successfully applied to handle large-scale hashing[20] and semi-supervised learning problems. 3.1 Anchor Graphs The anchor graph framework is an elegant way to approximate neighborhood graphs. It first chooses a subset of l anchor points U = {uj}l j=1 from X. Then for each data point in X, its s nearest anchors in U are sought, thereby forming an s-nearest anchor graph. The anchor graph theory assumes that the original graph affinity matrix W can be reconstructed from the anchor graph with a small number of anchors (l ≪n). Anchor points can be selected by random sampling or a rough clustering process. Many algorithms are available to embed a data point to its s nearest anchor points, as suggested in [18]. Here we adopt the simplest approach to build the anchor embedding matrix ˆH; say, ˆhij = exp  −d2 ij/σ2 , uj ∈{s nearest anchors of xi} 0, otherwise , where dij is the distance from data 4 Algorithm 2 Anchor-based Zeta Hull Pursuits Input: A dataset X, the number m of data points to be sampled, the number l of anchors, the number s of nearest anchors, and a free parameter z. Output: The hull of sampled columns Ce := Cm+1. Initialize: construct H, X1 = X, C1 = ∅, and H1 = H for i = 1 to m do perform SVD to obtain Hi := UΣVT εxj := z l k=1 λ2 j 1−zλ2 k (Ujk)2, for xj ∈Xi xei := arg minxj∈Xi(εxj +  xt∈Ci λ i hjht ⊤) Ci+1 := Ci ∪xei Xi+1 := Xi/xei Hi+1 := Hi with the ei-th row removed end for point xi to anchor uj, and σ is a parameter controlling the bandwidth of the exponential function. The matrix ˆH is then normalized so that its every row sums to one. In doing so, we can approximate the affinity matrix of the original graph as ˆ W = ˆHΛ−1 ˆH⊤, where Λ is a diagonal matrix whose i-th diagonal element is equal to the sum of the i-th column of ˆH. As a result, all matrix manipulations upon the original graph affinity matrix W can be approximated by substituting the anchor graph affinity matrix ˆ W for W. 3.2 Extremeness Computation via Anchors Note that the computation of the point extremeness for εxj depends on the diagonal elements of (I −zW)−1. Using the anchor graph technique, we can write (I −zW)−1 = (I −zHH⊤)−1, where H = ˆHΛ−1 2 . Thus we have the following theorem that enables an efficient computation of εxj. The proof is detailed in the supplementary material. Theorem 3. Let the singular vector decomposition of H be H = UΣV⊤, where Σ = diag(λ1, . . . , λl). If H⊤H is not singular, then ε−1 xj = 1 + z l k=1 λ2 k 1−zλ2 k (Ujk)2, where U = HVΣ−1 and Ujk denotes the (i, j)-th entry of U. Theorem 3 reveals that the major computation of εxj will reduce to the eigendecomposition of a much smaller matrix H⊤H, which results in a direct acceleration of the Zeta hull pursuit process. At the same time, the second term of Eq. (3) encountered in the i-th iteration can be estimated by e⊤ j Wci = 1 i  xt∈Ci hjht ⊤, where hj denotes the j-th row of H and ci−1 is the selection vector of the extracted point set before the i-th iteration. These lead to the Anchor-based Zeta Hull Pursuits algorithm shown in Algorithm 2. 3.3 Downdating SVD In Algorithm 2, the singular value decomposition dominates the total time cost. We notice that reusing information in previous iterations can save the computation time. The removal of one row from H is equivalent to a rank-one modification to the original matrix. Downdating SVD [10] was proposed to handle this operation. Given the diagonal singular value matrix Σi and the point xei chosen in the i-th iteration, the singular value matrix Σi+1 for the next iteration can be calculated by the eigendecomposition of an l × l matrix D derived from Σi, where D = (I − 1 1+μheih⊤ ei)Σi, and μ2 + ∥hei∥2 2 = 1. The decomposition of D can be efficiently performed in O(l2) time [10]. Then the computation of Ui+1 is achieved by a multiplication of Ui with an l × l matrix produced by the decomposition operation on D, which permits a natural parallelism. Consequently, we can further accelerate Algorithm 2 by using a parallel computing scheme. 3.4 Complexity Analysis We now analyze the complexities of Algorithms 1 and 2. For Algorithm 1, the most time-consuming step is to solve the matrix inverse of n × n size, which costs a time complexity of O(n3). The overall time complexity is thus O(mn3) for extracting m points. In the implementation we can use 5 (a) m = 20, ZHP (b) m = 40, ZHP (c) m = 80, ZHP (d) m = 200, ZHP (e) m = 20, A-ZHP (f) m = 40, A-ZHP (g) m = 80, A-ZHP (h) m = 200, A-ZHP (i) m = 40, Leverage Score (j) m = 40, Simplex (k) m = 40, CUR (l) m = 40, K-medoids Figure 2: Zeta hull pursuits on the two-moon toy dataset. We select m data points from the dataset with various methods. In the sub-figures, blue dots are data points. The selected samples are surrounded with red circles. The caption of each sub-figure describes the number of selected points m and the method used to select those data points. First two rows shows the results of our algorithms with different m. The third row illustrates the comparisons with other methods when m = 40. For the leverage score approach, we follow the steps in [21]. the sparse matrix computation to reduce the constant factor [5]. For Algorithm 2, the most timeconsuming step is to perform SVD over H, so the overall time complexity is O(mnl2). Leveraging downdating SVD, we only need to calculate the full SVD of H once in O(nl2) time and iteratively update the decomposition in O(l2) time per iteration. The matrix multiplication operation then dominates the total time cost. Also, it can be parallelized using a multi-core CPU or a modern GPU, resulting in a very small constant factor in the time complexity. Since l is usually less than 10% of n, Algorithm 2 is orders of magnitude faster than Algorithm 1. For cases where l needs to be relatively large (20% of n for example), the computational cost will not show a considerable increase since H is usually a very sparse matrix. 4 Experiments The Zeta Hull model aims at learning the structures of dataset. We evaluate how well our model achieves this goal by performing classification experiments. For simplicity, we abbreviate our algorithms as follows: the original Zeta Hull Pursuit algorithm (Algorithm 1), ZHP and its anchor version (Algorithm 2), A-ZHP. To compare with the state-of-the-art, we choose some renowned methods: K-medoids, CUR matrix factorization (CUR) [29], simplex volume maximization (Simplex) [26], sparse dictionary learning (DictLearn) [22] and convex non-negative matrix factorization (C-NMF) [6]. Basically, we use the extracted data points to learn a representation for each data point in an unsupervised manner. Classification is done by feeding the representation into a classifier. The representation will be built in two ways: 1) the sparse coding [22] and 2) the locality simplex coding [26]. To differentiate our algorithms from the original anchor graph framework, we conduct a set of experiments using the left singular vectors of the anchor embedding matrix H as the representation. In these experiments, anchors used in the anchor graph technique are randomly selected from the training set. To compare with existing low-dimension embedding approaches, we run the Large-Scale Manifold method [24] using the same number of landmarks as that of extracted points. 4.1 Toy Dataset First we illustrate our algorithms on a toy dataset. The dataset, commonly known as ”the two moons”, consists of 2000 data points on the 2D plane which are manifold-structured and comprise nonconvex distributions. This experiment on the two moons provides illustrative results of our algorithms in the presence of nonconvexity. We select different numbers of column subsets m = {20, 40, 80, 200} and compare with various other methods. A visualization of the results is shown in Figure 2. We can see that our algorithms can extract the nonconvex hull of the data cloud more accurately. 4.2 Text and Image Datasets For the classification experiments in this section, we derive the two types of data representations (the sparse coding and the local simplex coding) from the points/columns extracted by compared meth6 Table 1: Classification error rates in percentage (%) on texts (TDT2 and Newsgroups) and handwritten number datasets (MNIST). The numbers in bold font highlight best results under the settings. In this table, “SC” refers to the results using the sparse coding to form the representation, while “LSC” refers to the results using local simplex coding. The cells with “-” indicate that the ZHP method is too expensive to be performed under the associated settings. The “Anchor Graph” refers to the additional experiments using the original anchor graph framework [18]. Methods TDT2 Newsgroups MNIST m = 500 m = 1000 m = 500 m = 1000 m = 500 m = 2000 SC LSC SC LSC SC LSC SC LSC SC LSC SC LSC ZHP 2.31 1.97 1.53 0.48 A-ZHP 2.52 2.68 2.08 0.96 11.79 10.77 7.1 6.58 3.45 3.07 1.43 1.19 Simplex [26] 3.79 1.73 1.77 1.51 13.55 10.41 8.16 8.04 5.79 5.79 2.27 1.51 DictLearn [22] 3.73 5.62 1.18 2.57 9.51 10.76 6.72 9.63 3.16 3.16 1.36 2.11 C-NMF [6] 4.83 3.46 2.07 2.31 11.68 11.83 7.72 7.42 5.07 5.27 3.01 3.04 CUR [29] 6.82 3.73 2.37 1.52 15.32 11.44 12.38 9.47 10.13 10.13 3.79 5.27 K-medoids [12] 9.14 7.87 3.73 4.69 19.73 12.02 19.67 10.04 9.28 9.28 2.72 2.31 Anchor Graph [18] 5.81 2.68 12.32 8.76 3.17 2.33 Table 2: Recognition error rates in percentage (%) on object and face datasets. We select L samples for each class in the training set for training or forming the gallery. The numbers in bold font highlight best results under the settings. In this table, “SC” refers to the results using the sparse coding to form the representation, while “LSC” refers to the results using local simplex coding. The “Raw Feature” refers to the experiments conducted on the raw features vectors. The face recognition process is described in Sec. (4.2). Methods Caltech101 d = 21504, L = 30 Caltech101 d = 5120, L = 30 MultiPIE d = 2000, L = 30 m = 500 m = 1000 m = 500 m = 1000 m = 500 m = 2000 SC LSC SC LSC SC LSC SC LSC SC LSC SC LSC A-ZHP 25.77 26.82 23.13 25.81 29.61 28.95 25.62 26.59 20.8 14.2 19.6 11.3 Simplex [26] 29.83 26.16 26.83 25.18 32.43 29.66 30.62 27.47 19.9 15.8 17.7 13.7 DictLearn [22] 26.95 29.73 26.73 29.51 29.15 31.83 28.93 29.67 19.6 20.8 18.5 19.7 C-NMF [6] 30.66 27.83 28.72 27.62 32.57 31.13 31.15 28.73 20.4 17.5 19.9 14.8 CUR [21] 29.74 28.77 26.16 26.81 31.69 32.57 30.72 31.13 21.3 21.9 20.7 21.6 K-medoids [12] 27.82 27.64 26.09 25.73 29.85 29.63 28.97 28.28 29.7 19.8 25.4 17.7 Anchor Graph [18] 26.32 25.15 30.53 28.14 17.6 14.4 Large Manifold [24] 28.71 27.92 32.67 30.19 31.4 30.1 Raw Feature [28] 26.7 31.18 27.6 ods. By measuring the performance of applying these representations to solving the classification tasks, we can evaluate the representative power of the compared point/column selection methods. The sparse coding is widely used for obtaining the representation for classification. Here a standard ℓ1-regularized projection algorithm (LASSO) [22] is adopted to learn the sparse representation from the extracted data points. LASSO will deliver a sparse coefficient vector, which is applied as the representation of the data point. We use “SC” to indicate the related results in Table 1 and Table 2. The local simplex coding reconstructs one data point as a convex combination of a set of nearest exemplar points, which form local simplexes [26]. Imposing this convex reconstruction constraint leads to non-negative combination coefficients. The sparse coefficients vector will be used as data representation. “LSC” indicates the related results in Table 1 and Table 2. The classification pipeline is as follows. After extracting m points/columns from the training set, all data points will be represented with these selected points using the two approaches above. Then we feed the representations into a linear SVM for the training and testing. The better classification accuracy will reveal the stronger representative power of the column selection algorithm. In all experiments, the parameter z is fixed at 0.05 to guarantee the convergence of the Zeta function. We find that final results are robust to z once the convergence is guaranteed. For the A-ZHP algorithm, the parameter s is fixed at 10 and the number of anchor points l is set as 10% of the training set size. The bandwidth parameter σ of the exponential function is tuned on the training set to obtain a reasonable anchor embedding. The classification of text contents relies on the informative representation of the plain words or sentences. Two text datasets are adopted for classification, i.e. the TDT2 dataset and the Newsgroups dataset [2]. In experiments, a subset of TDT2 is used (TDT2-30). It has 9394 samples from 30 classes. Each feature vector is of 36771 dimensions and normalized into unit length. The training set contains 6000 samples randomly selected from the dataset and rest of the samples are used for 7 testing. The parameter m is set to be 500 and 1000 on this dataset. The Newsgroups dataset contains 18846 samples from 20 classes. The training set contains 11314, while the testing set has 7532. The two sets are separated in advance [2] and ordered in time sequence to be more challenging for classifiers. The parameter m is set to be 500 and 1000 on this dataset. The classification results are reported in Table 1. For object and face recognition tasks we conduct experiments under three classic scenarios, the hand-written digits classification, the image recognition, and the human face recognition. Related experimental results are reported in Table 1 and Table 2. The MNIST dataset serves as a standard benchmark for machine learning algorithms. It contains 10 classes of images corresponding to hand-written numbers from 0 to 9. The training set has 60000 images and the testing set has 10000 images. Each sample is a 784-dimensional vector. The Caltech101 dataset [17] is a widely used benchmark for object recognition systems. It consists of images from 102 classes of objects (101 object classes and one background class). We randomly select 30 labeled images from every class for training the classifier and 3000 images for testing. The recognition rates averaged over all classes are reported. Every image is processed into a feature vector of 21504 dimensions by the method in [28]. We also conduct experiment on a feature subset of the top 5000 dimensions (Caltech101-5k). In this experiment, m is set to be 500 and 1000. On-hull points are extracted on the training set. The MultiPIE human face dataset is a widely applied benchmark for face recognition [9]. We follow a standard gallery-probe protocol of face recognition. The testing set is divided into the gallery set and the probe set. The identity predication of a probe image comes from its nearest neighbor of Euclidean distance in the gallery. We randomly select 30, 000 images of 200 subjects as the training set for learning the data representation. Then we pick out 3000 images of the other 100 subjects (L = 30) to form the gallery set and 6000 images as the probes. The head poses of all these faces are between ±15 degrees. Each face image is processed into a vector of 5000 dimensions using the local binary pattern descriptor and PCA. We vary the parameter m from 500 to 2000 to evaluate the influence of number of sampled points. Discussion. For the experiments on these high-dimensional datasets, the methods based on the Zeta Hull model outperform most compared methods and also show promising performance improvements over raw data representation. When the number of extracted points grows, the resulting classification accuracy increases. This corroborates that the Zeta Hull model can effectively capture intrinsic structures of given datasets. More importantly, the discriminative information is preserved through learning these Zeta hulls. The representation yielded by the Zeta Hull model is sparse and of manageable dimensionality (500-2000), which substantially eases the workload of classifier training. This property is also favorable for tackling other large-scale learning problems. Due to the graph-theoretic measure that unifies the local and global connection properties of a graph, the Zeta Hull model leads to better data representation compared against existing graph-based embedding and manifold learning methods. For the comparison with the Large-Scale Manifold method [24] on the MultiPIE dataset, we find that even using 10K landmarks, its accuracy is still inferior to our methods relying on the Zeta Hull model. We also notice that noise may also affect the quality of Zeta hulls. This difficulty can be circumvented by running a number of well-established outlier removal methods such as [19]. 5 Conclusion In this paper, we proposed a geometric model, dubbed Zeta Hulls, for column sampling through learning nonconvex hulls of input data. The Zeta Hull model was built upon a novel graph-theoretic measure which quantifies the point extremeness to unify local and global connection properties of individual data point in an adjacency graph. By means of the Zeta function defined on the graph, the point extremeness measure amounts to the diagonal elements of a matrix related to the graph adjacency matrix. We also reduced the time and space complexities for computing a Zeta hull by incorporating an efficient anchor graph technique. A synthetic experiment first showed that the Zeta Hull model can detect appropriate hulls for non-convexly distributed data. The extensive real-world experiments conducted on benchmark text and image datasets further demonstrated the superiority of the Zeta Hull model over competing methods including convex hull learning, clustering, matrix factorization, and dictionary learning. Acknowledgement This research is partially supported by project #MMT-8115038 of the Shun Hing Institute of Advanced Engineering, The Chinese University of Hong Kong. 8 References [1] M.-A. Belabbas and P. J. Wolfe. Spectral methods in machine learning and new strategies for very large datasets. PNAS, 106(2):369–374, 2009. [2] D. Cai, X. Wang, and X. He. Probabilistic dyadic data analysis with local and global consistency. In Proc. ICML, 2009. [3] M. Chu and M. Lin. Low dimensional polytope approximation and its application to nonnegative matrix factorization. SIAM Journal of Computing, pages 1131–1155, 2008. [4] A. Das and D. Kempe. Submodular meets spectral: greedy algorithms for subset selection, sparse approximation and dictionary selection. In Proc. ICML, 2011. [5] T. Davis. SPARSEINV: a MATLAB toolbox for computing the sparse inverse subset using the Takahashi equations, 2011. [6] C. Ding, T. Li, and M. Jordan. Convex and semi-nonnegative matrix factorizations. TPAMI, 32(1):45–55, 2010. [7] P. Drineas and M. Mahoney. On the Nystr¨om method for approximating a gram matrix for improved kernel-based learning. JMLR, 6:2153–2175, 2005. [8] C. Fowlkes, S. Belongie, F. Chung, and J. Malik. Spectral grouping using the Nystr¨om method. TPAMI, 26:214–225, 2004. [9] R. Gross, I. Matthews, J. Cohn, T. Kanade, and S. Baker. Multi-pie. In Proc. Automatic Face Gesture Recognition, pages 1–8, Sept 2008. [10] M. Gu and S. C. Eisenstat. Downdating the singular value decomposition. SIAM Journal on Matrix Analysis and Applications, 16(3):793–810, 1995. [11] T. Hastie, R. Tibshirani, and J. J. H. Friedman. The elements of statistical learning, volume 1. Springer New York, 2001. [12] L. Kaufman and P. J. Rousseeuw. Finding groups in data: an introduction to cluster analysis, volume 344. John Wiley & Sons, 2009. [13] A. Kulesza and B. Taskar. Determinantal point processes for machine learning. Foundations and Trends in Machine Learning, 5(2–3), 2012. [14] S. Kumar, M. Mohri, and A. Talwalkar. Ensemble Nystr¨om method. In NIPS 23, 2009. [15] S. Kumar, M. Mohri, and A. Talwalkar. Sampling methods for the Nystr¨om method. JMLR, 13(1):981– 1006, 2012. [16] D. D. Lee and H. S. Seung. Learning the parts of objects by non-negative matrix factorization. Nature, 401(6755):788–791, 1999. [17] F. Li, B. Fergus, and P. Perona. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. CVIU, 106(1):59–70, 2007. [18] W. Liu, J. He, and S.-F. Chang. Large graph construction for scalable semi-supervised learning. In Proc. ICML, 2010. [19] W. Liu, G. Hua, and J. Smith. Unsupervised one-class learning for automatic outlier removal. In Proc. CVPR, 2014. [20] W. Liu, J. Wang, S. Kumar, and S.-F. Chang. Hashing with graphs. In Proc. ICML, 2011. [21] M. W. Mahoney and P. Drineas. Cur matrix decompositions for improved data analysis. PNAS, 106(3):697–702, 2009. [22] J. Mairal, F. Bach, J. Ponce, and G. Sapiro. Online learning for matrix factorization and sparse coding. JMLR, 11:19–60, 2010. [23] S. Savchenko. The Zeta-function and gibbs measures. Russian Mathematical Surveys, 48(1):189–190, 1993. [24] A. Talwalkar, S. Kumar, M. Mohri, and H. Rowley. Large-scale SVD and manifold learning. JMLR, 14(1):3129–3152, 2013. [25] A. Talwalkar, S. Kumar, and H. Rowley. Large-scale manifold learning. In Proc. CVPR, 2008. [26] C. Thurau, K. Kersting, and C. Bauckhage. Yes we can: simplex volume maximization for descriptive web-scale matrix factorization. In Proc. CIKM, 2010. [27] F. Wang, C. Chi, T. Chan, and Y. Wang. Nonnegative least correlated component analysis for separation of dependent sources by volume maximization. TPAMI, 32:875–888, 2010. [28] J. Wang, J. Yang, K. Yu, F. Lv, T. Huang, and Y. Gong. Locality-constrained linear coding for image classification. In Proc. CVPR, 2010. [29] S. Wang and Z. Zhang. A scalable cur matrix decomposition algorithm: lower time complexity and tighter bound. In NIPS 26, 2012. [30] C. Williams and M. Seeger. Using the Nystr¨om method to speed up kernel machines. In NIPS 14, 2000. [31] M. E. Winter. N-finder: an algorithm for fast autonomous spectral end-member determination in hyperspectral data. In SPIE’s International Symposium on Optical Science, Engineering, and Instrumentation. International Society for Optics and Photonics, 1999. [32] Y. Xiong, W. Liu, D. Zhao, and X. Tang. Face recognition via archetype hull ranking. In Proc. ICCV, 2013. [33] K. Zhang and J. Kwok. Density weighted Nystr¨om method for computing large kernel eigensystems. Neural Computation, 21:121–146, 2009. [34] D. Zhao and X. Tang. Cyclizing clusters via Zeta function of a graph. In NIPS 22, 2008. 9
2014
315
5,420
Near-Optimal-Sample Estimators for Spherical Gaussian Mixtures Jayadev Acharya∗ MIT jayadev@mit.edu Ashkan Jafarpour, Alon Orlitsky, Ananda Theertha Suresh UC San Diego {ashkan, alon, asuresh}@ucsd.edu Abstract Many important distributions are high dimensional, and often they can be modeled as Gaussian mixtures. We derive the first sample-efficient polynomial-time estimator for high-dimensional spherical Gaussian mixtures. Based on intuitive spectral reasoning, it approximates mixtures of k spherical Gaussians in d-dimensions to within ℓ1 distance ϵ using O(dk9(log2 d)/ϵ4) samples and Ok,ϵ(d3 log5 d) computation time. Conversely, we show that any estimator requires Ω(dk/ϵ2) samples, hence the algorithm’s sample complexity is nearly optimal in the dimension. The implied time-complexity factor Ok,ϵ is exponential in k, but much smaller than previously known. We also construct a simple estimator for one-dimensional Gaussian mixtures that uses ̃ O(k/ϵ2) samples and ̃ O((k/ϵ)3k+1) computation time. 1 Introduction 1.1 Background Meaningful information often resides in high-dimensional spaces: voice signals are expressed in many frequency bands, credit ratings are influenced by multiple parameters, and document topics are manifested in the prevalence of numerous words. Some applications, such as topic modeling and genomic analysis consider data in over 1000 dimensions [31, 14]. Typically, information can be generated by different types of sources: voice is spoken by men or women, credit parameters correspond to wealthy or poor individuals, and documents address topics such as sports or politics. In such cases the overall data follow a mixture distribution [26, 27]. Mixtures of high-dimensional distributions are therefore central to the understanding and processing of many natural phenomena. Methods for recovering the mixture components from the data have consequently been extensively studied by statisticians, engineers, and computer scientists. Initially, heuristic methods such as expectation-maximization were developed [25, 21]. Over the past decade, rigorous algorithms were derived to recover mixtures of d-dimensional spherical Gaussians [10, 18, 4, 8, 29] and general Gaussians [9, 2, 5, 19, 22, 3]. Many of these algorithms consider mixtures where the ℓ1 distance between the mixture components is 2 −od(1), namely approaches the maximum of 2 as d increases. They identify the distribution components in time and samples that grow polynomially in d. Recently, [5, 19, 22] showed that the parameters of any k-component d-dimensional Gaussian mixture can be recovered in time and samples that grow as a high-degree polynomial in d and exponentially in k. A different approach that avoids the large component-distance requirement and the high time and sample complexity, considers a slightly relaxed notion of approximation, sometimes called PAC learning [20], or proper learning, that does not approximate each mixture component, but instead ∗Author was a student at UC San Diego at the time of this work 1 derives a mixture distribution that is close to the original one. Specifically, given a distance bound ϵ > 0, error probability δ > 0, and samples from the underlying mixture f, where we use boldface letters for d-dimensional objects, PAC learning seeks a mixture estimate ˆf with at most k components such that D(f,ˆf) ≤ϵ with probability ≥1 −δ, where D(⋅,⋅) is some given distance measure, for example ℓ1 distance or KL divergence. An important and extensively studied special case of Gaussian mixtures is mixture of sphericalGaussians [10, 18, 4, 8, 29], where for each component the d coordinates are distributed independently with the same variance, though possibly with different means. Note that different components can have different variances. Due to their simple structure, spherical-Gaussian mixtures are easier to analyze and under a minimum-separation assumption have provably-practical algorithms for clustering and parameter estimation. We consider spherical-Gaussian mixtures as they are important on their own and form a natural first step towards learning general Gaussian mixtures. 1.2 Sample complexity Reducing the number of samples required for learning is of great practical significance. For example, in topic modeling every sample is a whole document, in credit analysis every sample is a person’s credit history, and in genetics, every sample is a human DNA. Hence samples can be very scarce and obtaining them can be very costly. By contrast, current CPUs run at several Giga Hertz, hence samples are typically much more scarce of a resource than time. For one-dimensional distributions, the need for sample-efficient algorithms has been broadly recognized. The sample complexity of many problems is known quite accurately, often to within a constant factor. For example, for discrete distributions over {1,...,s}, an approach was proposed in [23] and its modifications were used in [28] to estimate the probability multiset using Θ(s/log s) samples. Learning one-dimensional m-modal distributions over {1,...,s} requires Θ(mlog(s/m)/ϵ3) samples [11]. Similarly, one-dimensional mixtures of k structured distributions (log-concave, monotone hazard rate, and unimodal) over {1,...,s} can be learned with O(k/ϵ4), O(k log(s/ϵ)/ϵ4), and O(k log(s)/ϵ4) samples, respectively, and these bounds are tight up to a factor of ϵ [6]. Unlike the 1-dimensional case, in high dimensions, sample complexity bounds are quite weak. For example, to learn a mixture of k = 2 spherical Gaussians, existing estimators use O(d12) samples, and this number increases exponentially with k [16]. We close this gap by constructing estimators with near-linear sample complexity. 1.3 Previous and new results Our main contribution is PAC learning d-dimensional spherical Gaussian mixtures with near-linear samples. In the process of deriving these results we also prove results for learning one-dimensional Gaussians and for finding which distribution in a class is closest to the one generating samples. d-dimensional Gaussian mixtures Several papers considered PAC learning of discrete- and Gaussian-product mixtures. [17] considered mixtures of two d-dimensional Bernoulli products where all probabilities are bounded away from 0. They showed that this class is PAC learnable in ̃ O(d2/ϵ4) time and samples, where the ̃ O notation hides logarithmic factors. [15] eliminated the probability constraints and generalized the results from binary to arbitrary discrete alphabets and from 2 to k mixture components, showing that these mixtures are PAC learnable in ̃ O((d/ϵ)2k2(k+1)) time. Although they did not explicitly mention sample complexity, their algorithm uses ̃ O((d/ϵ)4(k+1)) samples. [16] generalized these results to Gaussian products and showed that mixtures of k Gaussians, where the difference between the means is bounded by B times the standard deviation, are PAC learnable in ̃ O((dB/ϵ)2k2(k+1)) time, and can be shown to use ̃ O((dB/ϵ)4(k+1)) samples. These algorithms consider the KL divergence between the distribution and its estimate, but it can be shown that the ℓ1 distance would result in similar complexities. It can also be shown that these algorithms or their simple modifications have similar time and sample complexities for spherical Gaussians as well. Our main contribution for this problem is to provide an algorithm that PAC learns mixtures of spherical-Gaussians in ℓ1 distance with number of samples nearly-linear, and running time polyno2 mial in the dimension d. Specifically, in Theorem 11 we show that mixtures of k spherical-Gaussian distributions can be learned using n = O (dk9 ϵ4 log2 d δ ) = Ok,ϵ (dlog2 d δ ) samples and in time O(n2dlog n + d(k7 ϵ3 log2 d δ ) k2 2 ) = ̃ Ok,ϵ(d3). Recall that for similar problems, previous algorithms used ̃ O((d/ϵ)4(k+1)) samples. Furthermore, recent algorithms typically construct the covariance matrix [29, 16], hence require ≥nd2 time. In that sense, for small k, the time complexity we derive is comparable to the best such algorithms one can hope for. Additionally, the exponential dependence on k in the time complexity is d( k7 ϵ3 log2 d δ )k2/2, significantly lower than the dO(k3) dependence in previous results. Conversely, Theorem 2 shows that any algorithm for PAC learning a mixture of k spherical Gaussians requires Ω(dk/ϵ2) samples, hence our algorithms are nearly sample optimal in the dimension. In addition, their time complexity significantly improves on previously known ones. One-dimensional Gaussian mixtures To prove the above results we derive two simpler results that are interesting on their own. We construct a simple estimator that learns mixtures of k one-dimensional Gaussians using ̃ O(kϵ−2) samples and in time ̃ O((k/ϵ)3k+1). We note that independently and concurrently with this work [12] showed that mixtures of two one-dimensional Gaussians can be learnt with ̃ O(ϵ−2) samples and in time O(ϵ−5). Combining with some of the techniques in this paper, they extend their algorithm to mixtures of k Gaussians, and reduce the exponent to 3k −1. Let d(f,F) be the smallest ℓ1 distance between a distribution f and any distribution in a collection F. The popular SCHEFFE estimator [13] takes a surprisingly small O(log ∣F∣) independent samples from an unknown distribution f and time O(∣F∣2) to find a distribution in F whose distance from f is at most a constant factor larger than d(f,F). In Lemma 1, we reduce the time complexity of the Scheffe algorithm from O(∣F∣2) to ̃ O(∣F∣), helping us reduce the running time of our algorithms. A detailed analysis of several such estimators are provided in [1] and here we outline a proof for one particular estimator for completeness. 1.4 The approach and technical contributions Given the above, our goal is to construct a small class of distributions such that one of them is ϵ-close to the underlying distribution. Consider for example mixtures of k components in one dimension with means and variances bounded by B. Take the collection of all mixtures derived by quantizing the means and variances of all components to ϵm accuracy, and quantizing the weights to ϵw accuracy. It can be shown that if ϵm,ϵw ≤ϵ/k2 then one of these candidate mixtures would be O(ϵ)-close to any mixture, and hence to the underlying one. There are at most (B/ϵm)2k ⋅(1/ϵw)k = (B/ϵ) ̃ O(k) candidates and running SCHEFFE on these mixtures would lead to an estimate. However, this approach requires a bound on the means and variances. We remove this requirement on the bound, by selecting the quantizations based on samples and we describe it in Section 3. In d dimensions, consider spherical Gaussians with the same variance and means bounded by B. Again, take the collection of all distributions derived by quantizing the means of all components in all coordinates to ϵm accuracy, and quantizing the weights to ϵw accuracy. It can be shown that for d-dimensional Gaussian to get distance ϵ from the underlying distribution, it suffices to take ϵm,ϵw ≤ϵ2/poly(dk). There are at most (B/ϵm)dk ⋅(1/ϵw)k = 2 ̃ Oϵ(dk) possible combinations of the k mean vectors and weights. Hence SCHEFFE implies an exponential-time algorithm with sample complexity ̃ O(dk). To reduce the dependence on d, one can approximate the span of the k mean vectors. This reduces the problem from d to k dimensions, allowing us to consider a distribution collection of size 2O(k2), with SCHEFFE sample complexity of just O(k2). [15, 16] constructs the sample correlation matrix and uses k of its columns to approximate the span of mean vectors. This 3 approach requires the k columns of the sample correlation matrix to be very close to the actual correlation matrix, requiring a lot more samples. We derive a spectral algorithm that approximates the span of the k mean vectors using the top k eigenvectors of the sample covariance matrix. Since we use the entire covariance matrix instead of just k columns, a weaker concentration suffices and the sample complexity can be reduced. Using recent tools from non-asymptotic random matrix theory [30], we show that the span of the means can be approximated with ̃ O(d) samples. This result allows us to address most “reasonable” distributions, but still there are some “corner cases” that need to be analyzed separately. To address them, we modify some known clustering algorithms such as single-linkage, and spectral projections. While the basic algorithms were known before, our contribution here, which takes a fair bit of effort and space, is to show that judicious modifications of the algorithms and rigorous statistical analysis yield polynomial time algorithms with near-linear sample complexity. We provide a simple and practical spectral algorithm that estimates all such mixtures in Ok,ϵ(dlog2 d) samples. The paper is organized as follows. In Section 2, we introduce notations, describe results on the Scheffe estimator, and state a lower bound. In Sections 3 and 4, we present the algorithms for onedimensional and d-dimensional Gaussian mixtures respectively. Due to space constraints, most of the technical details and proofs are given in the appendix. 2 Preliminaries 2.1 Notation For arbitrary product distributions p1,...,pk over a d dimensional space let pj,i be the distribution of pj over coordinate i, and let µj,i and σj,i be the mean and variance of pj,i respectively. Let f = (w1,...,wk,p1,...,pk) be the mixture of these distributions with mixing weights w1,...,wk. We denote estimates of a quantity x by ˆx. It can be empirical mean or a more complex estimate. ∣∣⋅∣∣ denotes the spectral norm of a matrix and ∣∣⋅∣∣2 is the ℓ2 norm of a vector. We use D(⋅,⋅) to denote the ℓ1 distance between two distributions. 2.2 Selection from a pool of distributions Many algorithms for learning mixtures over the domain X first obtain a small collection F of mixtures and then perform Maximum Likelihood test using the samples to output a distribution [15, 17]. Our algorithm also obtains a set of distributions containing at least one that is close to the underlying in ℓ1 distance. The estimation problem now reduces to the following. Given a class F of distributions and samples from an unknown distribution f, find a distribution in F that is close to f. Let D(f,F) def= minfi∈F D(f,fi). The well-known Scheffe’s method [13] uses O(ϵ−2 log ∣F∣) samples from the underlying distribution f, and in time O(ϵ−2∣F∣2T log ∣F∣) outputs a distribution in F with ℓ1 distance of at most 9.1 ⋅ max(D(f,F),ϵ) from f, where T is the time required to compute the probability of an x ∈X by a distribution in F. A naive application of this algorithm requires time quadratic in the number of distributions in F. We propose a variant of this, that works in near linear time. More precisely, Lemma 1 (Appendix B). Let ϵ > 0. For some constant c, given c ϵ2 log( ∣F∣ δ ) independent samples from a distribution f, with probability ≥1−δ, the output ˆf of MODIFIED SCHEFFE satisfies D(ˆf,f) ≤ 1000 ⋅max(D(f,F),ϵ). Furthermore, the algorithm runs in time O( ∣F∣T log(∣F∣/δ) ϵ2 ). Several such estimators have been proposed in the past [11, 12]. A detailed analysis of the estimator presented here was studied in [1]. We outline a proof in Appendix B for completeness. Note that the constant 1000 in the above lemma has not been optimized. For our problem of estimating k component mixtures in d-dimensions, T = O(dk) and ∣F∣= ̃ Ok,ϵ(d2). 2.3 Lower bound Using Fano’s inequality, we show an information theoretic lower bound of Ω(dk/ϵ2) samples to learn k-component d-dimensional spherical Gaussian mixtures for any algorithm. More precisely, 4 Theorem 2 (Appendix C). Any algorithm that learns all k-component d-dimensional spherical Gaussian mixtures to ℓ1 distance ϵ with probability ≥1/2 requires Ω(dk/ϵ2) samples. 3 Mixtures in one dimension Over the past decade estimation of one dimensional distributions has gained significant attention [24, 28, 11, 6, 12, 7]. We provide a simple estimator for learning one dimensional Gaussian mixtures using the MODIFIED SCHEFFE estimator. Formally, given samples from f, a mixture of Gaussian distributions pi def= N(µi,σ2 i ) with weights w1,w2,...wk, our goal is to find a mixture ˆf = ( ˆw1, ˆw2,... ˆwk, ˆp1, ˆp2,... ˆpk) such that D(f, ˆf) ≤ϵ. We make no assumption on the weights, means or the variances of the components. While we do not use the one dimensional algorithm in the d-dimensional setting, it provides insight to the usage of the MODIFIED SCHEFFE estimator and may be of independent interest. As stated in Section 1.4, our quantizations are based on samples and is an immediate consequence of the following observation for samples from a Gaussian distribution. Lemma 3 (Appendix D.1). Given n independent samples x1,...,xn from N(µ,σ2), with probability ≥1 −δ there are two samples xj,xk such that ∣xj −µ∣≤σ 7 log 2/δ 2n and ∣xj −xk −σ∣≤2σ 7 log 2/δ 2n . The above lemma states that given samples from a Gaussian distribution, there would be a sample close to the mean and there would be two samples that are about a standard deviation apart. Hence, if we consider the set of all Gaussians N(xj,(xj −xk)2) ∶1 ≤j,k ≤n, then that set would contain a Gaussian close to the underlying one. The same holds for mixtures and for a Gaussian mixture and we can create the set of candidate mixtures as follows. Lemma 4 (Appendix D.2). Given n ≥120k log(4k/δ) ϵ samples from a mixture f of k Gaussians. Let S = {N(xj,(xj −xk)2) ∶1 ≤j,k ≤n} and W = {0, ϵ 2k, 2ϵ 2k ...,1} be a set of weights. Let F def= {( ˆw1, ˆw2,..., ˆwk, ˆp1, ˆp2,... ˆpk) ∶ˆpi ∈S, ∀1 ≤i ≤k−1, ˆwi ∈W, ˆwk = 1−( ˆw1+... ˆwk−1) ≥0} be a set of n2k(2k/ϵ)k−1 ≤n3k−1 candidate distributions. There exists ˆf ∈F such that D(f, ˆf) ≤ϵ. Running the MODIFIED SCHEFFE algorithm on the above set of candidates F yields a mixture that is close to the underlying one. By Lemma 1 and the above lemma we obtain Corollary 5 (Appendix D.3). Let n ≥c ⋅k ϵ2 log k ϵδ for some constant c. There is an algorithm that runs in time O (( k log(k/ϵδ) ϵ ) 3k−1 k2 log(k/ϵδ) ϵ2 ), and returns a mixture ˆf such that D(f, ˆf) ≤1000ϵ with probability ≥1 −2δ. [12] considered the one dimensional Gaussian mixture problem for two component mixtures. While the process of identifying the candidate means is same for both the papers, the process of identifying the variances and proof techniques are different. 4 Mixtures in d dimensions Algorithm LEARN k-SPHERE learns mixtures of k spherical Gaussians using near-linear samples. For clarity and simplicity of proofs, we first prove the result when all components have the same variance σ2, i.e., pi = N(µi,σ2Id) for 1 ≤i ≤k. A modification of this algorithm works for components with different variances. The core ideas are same and we discuss the changes in Section 4.3. The algorithm starts out by estimating σ2 and we discuss this step later. We estimate the means in three steps, a coarse single-linkage clustering, recursive spectral clustering and search over span of means. We now discuss the necessity of these steps. 4.1 Estimating the span of means A simple modification of the one dimensional algorithm can be used to learn mixtures in d dimensions, however, the number of candidate mixtures would be exponential in d, the number of dimensions. As stated in Section 1.4, given the span of the mean vectors µi, we can grid the k dimensional span to the required accuracy ϵg and use MODIFIED SCHEFFE, to obtain a polynomial 5 time algorithm. One of the natural and well-used methods to estimate the span of mean vectors is using the correlation matrix [29]. Consider the correlation-type matrix, S = 1 n n ∑ i=1 X(i)X(i)t −σ2Id. For a sample X from a particular component j, E[XXt] = σ2Id + µjµj t, and the expected fraction of samples from pj is wj. Hence E[S] = k ∑ j=1 wjµjµj t. Therefore, as n →∞, S converges to ∑k j=1 wjµjµj t, and its top k eigenvectors span the means. While the above intuition is well understood, the number of samples necessary for convergence is not well studied. We wish ̃ O(d) samples to be sufficient for the convergence irrespective of the values of the means. However this is not true when the means are far apart. In the following example we demonstrate that the convergence of averages can depend on their separation. Example 6. Consider the special case, d = 1, k = 2, σ2 = 1, w1 = w2 = 1/2, and mean differences ∣µ1 −µ2∣= L ≫1. Given this prior information, one can estimate the average of the mixture, that yields (µ1 + µ2)/2. Solving equations obtained by µ1 + µ2 and µ1 −µ2 = L yields µ1 and µ2. The variance of the mixture is 1 + L2/4 > L2/4. With additional Chernoff type bounds, one can show that given n samples the error in estimating the average is ∣µ1 + µ2 −ˆµ1 −ˆµ2∣≈Θ(L/√n). Hence, estimating the means to high precision requires n ≥L2, i.e., the higher separation, the more samples are necessary if we use the sample mean. A similar phenomenon happens in the convergence of the correlation matrices, where the variances of quantities of interest increase with separation. In other words, for the span to be accurate the number of samples necessary increases with the separation. To overcome this, a natural idea is to cluster the Gaussians such that the component means in the same cluster are close and then estimate the span of means, and apply SCHEFFE on the span within each cluster. For clustering, we use another spectral algorithm. Even though spectral clustering algorithms are studied in [29, 2], they assume that the weights are strictly bounded away from 0, which does not hold here. We use a simple recursive clustering algorithm that takes a cluster C with average µ(C). If there is a component in the cluster such that √wi ∣∣µi −µ(C)∣∣2 is Ω(log(n/δ)σ), then the algorithm divides the cluster into two nonempty clusters without any mis-clustering. For technical reasons similar to the above example, we first use a coarse clustering algorithm that ensures that the mean separation of any two components within each cluster is ̃ O(d1/4σ). Our algorithm thus comprises of (i) variance estimation (ii) a coarse clustering ensuring that means are within ̃ O(d1/4σ) of each other in each cluster (iii) a recursive spectral clustering that reduces the mean separation to O( √ k3 log(n/δ)σ) (iv) estimating the span of mean within each cluster, and (v) quantizing the means and running MODIFIED SCHFEE on the resulting candidate mixtures. 4.2 Sketch of correctness We now describe the steps stating the performance of each step of Algorithm LEARN k-SPHERE. To simplify the bounds and expressions, we assume that d > 1000 and δ ≥min(2n2e−d/10,1/3). For smaller values of δ, we run the algorithm with error 1/3 and repeat it O(log 1 δ ) times to choose a set of candidate mixtures Fδ. By the Chernoff-bound with error ≤δ, Fδ contains a mixture ϵ-close to f. Finally, we run MODIFIED SCHEFFE on Fδ to obtain a mixture that is close to f. By the union bound and Lemma 1, the error of the new algorithm is ≤2δ. Variance estimation: Let ˆσ be the variance estimate from step 1. If X(1) and X(2) are two samples from the components i and j respectively, then X(1)−X(2) is distributed N(µi−µj,2σ2Id). Hence for large d, ∣∣X(1) −X(2)∣∣2 2 concentrates around 2dσ2 + ∣∣µi −µj∣∣ 2 2. By the pigeon-hole principle, given k + 1 samples, two of them are from the same component. Therefore, the minimum pairwise 6 distance between k + 1 samples is close to 2dσ2. This is made precise in the next lemma which states that ˆσ2 is a good estimate of the variance. Lemma 7 (Appendix E.1). Given n samples from the k-component mixture, with probability 1−2δ, ∣ˆσ2 −σ2∣≤2.5σ2√ log(n2/δ)/d. Coarse single-linkage clustering: The second step is a single-linkage routine that clusters mixture components with far means. Single-linkage is a simple clustering scheme that starts out with each data point as a cluster, and at each step merges the two nearest clusters to form a larger cluster. The algorithm stops when the distance between clusters is larger than a pre-specified threshold. Suppose the samples are generated by a one-dimensional mixture of k components that are far, then with high probability, when the algorithm generates k clusters all the samples within a cluster are generated by a single component. More precisely, if ∀i,j ∈[k], ∣µi −µj∣= Ω(σ log n), then all the n samples concentrate around their respective means and the separation between any two samples from different components would be larger than the largest separation between any two samples from the same component. Hence for a suitable value of threshold, single-linkage correctly identifies the clusters. For d-dimensional Gaussian mixtures a similar property holds, with minimum separation Ω((dlog n δ )1/4σ). More precisely, Lemma 8 (Appendix E.2). After Step 2 of LEARN k-SPHERE, with probability ≥1−2δ, all samples from each component will be in the same cluster and the maximum distance between two components within each cluster is ≤10kσ(dlog n2 δ ) 1/4. Algorithm LEARN k-SPHERE Input: n samples x(1),x(2),...,x(n) from f and ϵ. 1. Sample variance: ˆσ2 = mina≠b∶a,b∈[k+1] ∣∣x(a) −x(b)∣∣2 2 /2d. 2. Coarse single-linkage clustering: Start with each sample as a cluster, • While ∃two clusters with squared-distance ≤2dˆσ2 + 23ˆσ2√ dlog(n2/δ), merge them. 3. Recursive spectral-clustering: While there is a cluster C with ∣C∣≥nϵ/5k and spectral norm of its sample covariance matrix ≥12k2ˆσ2 log n3/δ, • Use nϵ/8k2 of the samples to find the largest eigenvector and discard these samples. • Project the remaining samples on the largest eigenvector. • Perform single-linkage in the projected space (as before) till the distance between clusters is > 3ˆσ √ log(n2k/δ) creating new clusters. 4. Exhaustive search: Let ϵg = ϵ/(16k3/2), L = 200 √ k4ϵ−1 log n2 δ , L′ = 32k √ log n2/δ ϵ , and G = {−L,...,−ϵg,0,ϵg,2ϵg,...L}. Let W = {0,ϵ/(4k),2ϵ/(4k),...1} and Σ def= {σ2 ∶ σ2 = ˆσ2(1 + iϵ/d √ 128dk2),∀−L′ < i ≤L′}. • For each cluster C find its top k −1 eigenvectors u1,...uk−1. Let Span(C) = {ˆµ(C) + ∑k−1 i=1 giˆσui ∶gi ∈G}. • Let Span = ∪C∶∣C∣≥nϵ 5k Span(C). • For all w′ i ∈W, σ′2 ∈Σ, ˆµi ∈Span, add {(w′ 1,...,w′ k−1,1 −∑k−1 i=1 w′ i,N(ˆµ1,σ′2),...,N(ˆµk,σ′2)} to F. 5. Run MODIFIED SCHEFFE on F and output the resulting distribution. Recursive spectral-clustering: The clusters formed at the beginning of this step consist of components with mean separation O(σd1/4 log n δ ). We now recursively zoom into the clusters formed and show that it is possible to cluster the components with much smaller mean separation. Note that since the matrix is symmetric, the largest magnitude of the eigenvalue is the same as the spectral norm. We first find the largest eigenvector of S(C) def= 1 ∣C∣( ∑ x∈C (x −ˆµ(C))(x −ˆµ(C))t) −ˆσ2Id, 7 which is the sample covariance matrix with its diagonal term reduced by ˆσ2. We then project our samples to this vector and if there are two components with means far apart, then using singlelinkage we divide the cluster into two. The following lemma shows that this step performs accurate clustering of components with well separated means. Lemma 9 (Appendix E.3). Let n ≥c ⋅dk4 ϵ log n3 δ . After recursive clustering, with probability ≥1 −4δ, the samples are divided into clusters such that for each component i within a cluster C, √wi ∣∣µi −µ(C)∣∣2 ≤25σ √ k3 log(n3/δ) . Furthermore, all the samples from one component remain in a single cluster. Exhaustive search and Scheffe: After step 3, all clusters have a small weighted radius √wi ∣∣µi −µ(C)∣∣2 ≤25σ √ k3 log n3 δ . It can be shown that the eigenvectors give an accurate estimate of the span of µi −µ(C) within each cluster. More precisely, Lemma 10 (Appendix E.4). Let n ≥c⋅dk9 ϵ4 log2 d δ for some constant c. After step 3, with probability ≥1 −7δ, if ∣C∣≥nϵ/5k, then the projection of [µi −µ(C)]/∣∣µi −µ(C)∣∣2 on the space orthogonal to the span of top k −1 eigenvectors has magnitude ≤ ϵσ 8 √ 2k√wi∣∣µi−µ(C)∣∣2. We now have accurate estimates of the spans of the cluster means and each cluster has components with close means. It is now possible to grid the set of possibilities in each cluster to obtain a set of distributions such that one of them is close to the underlying. There is a trade-off between a dense grid to obtain a good estimation and the computation time required. The final step takes the sparsest grid possible to ensure an error ≤ϵ. This is quantized below. Theorem 11 (Appendix E.5). Let n ≥c⋅dk9 ϵ4 log2 d δ for some constant c. Then Algorithm LEARN kSPHERE, with probability ≥1−9δ, outputs a distribution ˆf such that D(ˆf,f) ≤1000ϵ. Furthermore, the algorithm runs in time O(n2dlog n + d( k7 ϵ3 log2 d δ ) k2 2 ). Note that the run time is calculated based on an efficient implementation of single-linkage clustering and the exponential term is not optimized. 4.3 Mixtures with unequal variances We generalize the results to mixtures with components having different variances. Let pi = N(µi,σ2 i Id) be the ith component. The key differences between LEARN k-SPHERE and the algorithm for learning mixtures with unequal variances are: 1. In LEARN k-SPHERE, we first estimated the component variance σ and divided the samples into clusters such that within each cluster the means are separated by ̃ O(d1/4σ). We modify this step such that the samples are clustered such that within each cluster the components not only have mean separation O(d1/4σ), but variances are also a factor at most 1+ ̃ O(1/ √ d) apart. 2. Once the variances in each cluster are within a multiplicative factor of 1 + ̃ O(1/ √ d) of each other, it can be shown that the performance of the recursive spectral clustering step does not change more than constants. 3. After obtaining clusters with similar means and variances, the exhaustive search algorithm follows, though instead of having a single σ′ for all clusters, we can have a different σ′ for each cluster, which is estimated using the average pair wise distance between samples in the cluster. The changes in the recursive clustering step and the exhaustive search step are easy to see and we omit them. The coarse clustering step requires additional tools and we describe them in Appendix F. 5 Acknowledgements We thank Sanjoy Dasgupta, Todd Kemp, and Krishnamurthy Vishwanathan for helpful discussions. 8 References [1] J. Acharya, A. Jafarpour, A. Orlitksy, and A. T. Suresh. Sorting with adversarial comparators and application to density estimation. In ISIT, 2014. [2] D. Achlioptas and F. McSherry. On spectral learning of mixtures of distributions. In COLT, 2005. [3] J. Anderson, M. Belkin, N. Goyal, L. Rademacher, and J. R. Voss. The more, the merrier: the blessing of dimensionality for learning large gaussian mixtures. In COLT, 2014. [4] M. Azizyan, A. Singh, and L. A. Wasserman. Minimax theory for high-dimensional gaussian mixtures with sparse mean separation. In NIPS, 2013. [5] M. Belkin and K. Sinha. Polynomial learning of distribution families. In FOCS, 2010. [6] S. O. Chan, I. Diakonikolas, R. A. Servedio, and X. Sun. Learning mixtures of structured distributions over discrete domains. In SODA, 2013. [7] S. O. Chan, I. Diakonikolas, R. A. Servedio, and X. Sun. Efficient density estimation via piecewise polynomial approximation. In STOC, 2014. [8] K. Chaudhuri, S. Dasgupta, and A. Vattani. Learning mixtures of gaussians using the k-means algorithm. CoRR, abs/0912.0086, 2009. [9] S. Dasgupta. Learning mixtures of gaussians. In FOCS, 1999. [10] S. Dasgupta and L. J. Schulman. A two-round variant of EM for gaussian mixtures. In UAI, 2000. [11] C. Daskalakis, I. Diakonikolas, and R. A. Servedio. Learning k-modal distributions via testing. In SODA, 2012. [12] C. Daskalakis and G. Kamath. Faster and sample near-optimal algorithms for proper learning mixtures of gaussians. In COLT, 2014. [13] L. Devroye and G. Lugosi. Combinatorial methods in density estimation. Springer, 2001. [14] I. S. Dhillon, Y. Guan, and J. Kogan. Iterative clustering of high dimensional text data augmented by local search. In ICDM, 2002. [15] J. Feldman, R. O’Donnell, and R. A. Servedio. Learning mixtures of product distributions over discrete domains. In FOCS, 2005. [16] J. Feldman, R. A. Servedio, and R. O’Donnell. PAC learning axis-aligned mixtures of gaussians with no separation assumption. In COLT, 2006. [17] Y. Freund and Y. Mansour. Estimating a mixture of two product distributions. In COLT, 1999. [18] D. Hsu and S. M. Kakade. Learning mixtures of spherical gaussians: moment methods and spectral decompositions. In ITCS, 2013. [19] A. T. Kalai, A. Moitra, and G. Valiant. Efficiently learning mixtures of two gaussians. In STOC, 2010. [20] M. J. Kearns, Y. Mansour, D. Ron, R. Rubinfeld, R. E. Schapire, and L. Sellie. On the learnability of discrete distributions. In STOC, 1994. [21] J. Ma, L. Xu, and M. I. Jordan. Asymptotic convergence rate of the em algorithm for gaussian mixtures. Neural Computation, 12(12), 2001. [22] A. Moitra and G. Valiant. Settling the polynomial learnability of mixtures of gaussians. In FOCS, 2010. [23] A. Orlitsky, N. P. Santhanam, K. Viswanathan, and J. Zhang. On modeling profiles instead of values. In UAI, 2004. [24] L. Paninski. Variational minimax estimation of discrete distributions under kl loss. In NIPS, 2004. [25] R. A. Redner and H. F. Walker. Mixture densities, maximum likelihood and the em algorithm. SIAM Review, 26(2), 1984. [26] D. A. Reynolds and R. C. Rose. Robust text-independent speaker identification using gaussian mixture speaker models. IEEE Transactions on Speech and Audio Processing, 3(1):72–83, 1995. [27] D. M. Titterington, A. F. Smith, and U. E. Makov. Statistical analysis of finite mixture distributions. Wiley New York, 1985. [28] G. Valiant and P. Valiant. Estimating the unseen: an n/log(n)-sample estimator for entropy and support size, shown optimal via new clts. In STOC, 2011. [29] S. Vempala and G. Wang. A spectral algorithm for learning mixtures of distributions. In FOCS, 2002. [30] R. Vershynin. Introduction to the non-asymptotic analysis of random matrices. CoRR, abs/1011.3027, 2010. [31] E. P. Xing, M. I. Jordan, and R. M. Karp. Feature selection for high-dimensional genomic microarray data. In ICML, 2001. [32] B. Yu. Assouad, Fano, and Le Cam. In Festschrift for Lucien Le Cam. Springer New York, 1997. 9
2014
316
5,421
Provable Tensor Factorization with Missing Data Prateek Jain Microsoft Research Bangalore, India prajain@microsoft.com Sewoong Oh Dept. of Industrial and Enterprise Systems Engineering University of Illinois at Urbana-Champaign Urbana, IL 61801 swoh@illinois.edu Abstract We study the problem of low-rank tensor factorization in the presence of missing data. We ask the following question: how many sampled entries do we need, to efficiently and exactly reconstruct a tensor with a low-rank orthogonal decomposition? We propose a novel alternating minimization based method which iteratively refines estimates of the singular vectors. We show that under certain standard assumptions, our method can recover a three-mode n × n × n dimensional rank-r tensor exactly from O(n3/2r5 log4 n) randomly sampled entries. In the process of proving this result, we solve two challenging sub-problems for tensors with missing data. First, in analyzing the initialization step, we prove a generalization of a celebrated result by Szemer´edie et al. on the spectrum of random graphs. We show that this initialization step alone is sufficient to achieve the root mean squared error on the parameters bounded by C(r2n3/2(log n)4/|Ω|) from |Ω| observed entries for some constant C independent of n and r. Next, we prove global convergence of alternating minimization with this good initialization. Simulations suggest that the dependence of the sample size on the dimensionality n is indeed tight. 1 Introduction Several real-world applications routinely encounter multi-way data with structure which can be modeled as low-rank tensors. Moreover, in several settings, many of the entries of the tensor are missing, which motivated us to study the problem of low-rank tensor factorization with missing entries. For example, when recording electrical activities of the brain, the electroencephalography (EEG) signal can be represented as a three-way array (temporal, spectral, and spatial axis). Oftentimes signals are lost due to mechanical failure or loose connection. Given numerous motivating applications, several methods have been proposed for this tensor completion problem. However, with the exception of 2-way tensors (i.e., matrices), the existing methods for higher-order tensors do not have theoretical guarantees and typically suffer from the curse of local minima. In general, finding a factorization of a tensor is an NP-hard problem, even when all the entries are available. However, it was recently discovered that by restricting attention to a sub-class of tensors such as low-CP rank orthogonal tensors [1] or low-CP rank incoherent1 tensors [2], one can efficiently find a provably approximate factorization. In particular, exact recovery of the factorization is possible for a tensor with a low-rank orthogonal CP decomposition [1]. We ask the question of recovering such a CP-decomposition when only a small number of entries are revealed, and show that exact reconstruction is possible even when we do not observe any entry in most of the fibers. Problem formulation. We study tensors that have an orthonormal CANDECOMP/PARAFAC (CP) tensor decomposition with a small number of components. Moreover, for simplicity of notation and 1The notion of incoherence we assume in (2) can be thought of as incoherence between the fibers and the standard basis vectors. 1 exposition, we only consider symmetric third order tensors. We would like to stress that our techniques generalizes easily to handle non-symmetric tensors as well as higher-order tensors. Formally, we assume that the true tensor T has the the following form: T = r X ℓ=1 σℓ(uℓ⊗uℓ⊗uℓ) ∈Rn×n×n , (1) with r ≪n, uℓ∈Rn with ∥uℓ∥= 1, and uℓ’s are orthogonal to each other. We let U ∈Rn×r be a tall-orthogonal matrix where uℓ’s is the ℓ-th column of U and Ui ⊥Uj for i ̸= j. We use ⊗to denote the standard outer product such that the (i, j, k)-th element of T is given by: Tijk = P a σaUiaUjaUka. We further assume that the ui’s are unstructured, which is formalized by the notion of incoherence commonly assumed in matrix completion problems. The incoherence of a symmetric tensor with orthogonal decomposition is µ(T) ≡ max i∈[n],ℓ∈[r] √n |Uiℓ| , (2) where [n] = {1, . . . , n} is the set of the first n integers. Tensor completion becomes increasingly difficult for tensors with larger µ(T), because the ‘mass’ of the tensor can be concentrated on a few entries that might not be revealed. Out of n3 entries of T, a subset Ω⊆[n] × [n] × [n] is revealed. We use PΩ(·) to denote the projection of a matrix onto the revealed set such that PΩ(T)ijk =  Tijk if (i, j, k) ∈Ω, 0 otherwise . We want to recover T exactly using the given entries (PΩ(T)). We assume that each (i, j, k) for all i ≤j ≤k is included in Ωwith a fixed probability p (since T is symmetric, we include all permutations of (i, j, k)). This is equivalent to fixing the total number of samples |Ω| and selecting Ω uniformly at random over all n3 |Ω|  choices. The goal is to ensure exact recovery with high probability and for |Ω| that is sub-linear in the number of entries (n3). Notations. For a tensor T ∈Rn×n×n, we define a linear mapping using U ∈Rn×m as T[U, U, U] ∈Rm×m×m such that T[U, U, U]ijk = P a,b,c TabcUaiUbjUck. The spectral norm of a tensor is ∥T∥2 = max∥x∥=1 T[x, x, x]. The Hilbert-Schmidt norm (Frobenius norm for matrices) of a tensor is ∥T∥F = (P i,j,k T 2 ijk)1/2. The Euclidean norm of a vector is ∥u∥2 = (P i u2 i )1/2. We use C, C′ to denote any positive numerical constants and the actual value might change from line to line. 1.1 Algorithm Ideally, one would like to minimize the rank of a tensor that explains all the sampled entries. minimize b T rank( bT) (3) subject to Tijk = bTijk for all (i, j, k) ∈Ω. However, even computing the rank of a tensor is NP-hard in general, where the rank is defined as the minimum r for which CP-decomposition exists [3]. Instead, we fix the rank of bT by explicitly modeling bT as bT = P ℓ∈[r] σℓ(uℓ⊗uℓ⊗uℓ), and solve the following problem: minimize b T ,rank( b T )=r PΩ(T) −PΩ bT  2 F = minimize {σℓ,uℓ}ℓ∈[r] PΩ(T) −PΩ X ℓ∈[r] σℓ(uℓ⊗uℓ⊗uℓ)  2 F(4) Recently, [4, 5] showed that an alternating minimization technique can recover a matrix with missing entries exactly. We generalize and modify the algorithm for the case of higher order tensors and study it rigorously for tensor completion. However, due to special structure in higher-order tensors, our algorithm as well as analysis is significantly different than the matrix case (see Section 2.2 for more details). To perform the minimization, we repeat the outer-loop getting refined estimates for all r components. In the inner-loop, we loop over each component and solve for uq while fixing the others {uℓ}ℓ̸=q. 2 More precisely, we set bT = ut+1 q ⊗uq ⊗uq + P ℓ̸=q σℓuℓ⊗uℓ⊗uℓin (4) and then find optimal ut+1 q by minimizing the least squares objective given by (4). That is, each inner iteration is a simple least squares problem over the known entries, hence can be implemented efficiently and is also embarrassingly parallel. Algorithm 1 Alternating Minimization for Tensor Completion 1: Input: PΩ(T), Ω, r, τ, µ 2: Initialize with [(u0 1, σ1), (u0 2, , σ2), . . . , (u0 r, σr)] = RTPM(PΩ(T), r) (RTPM of [1]) 3: [u1, u2, . . . , ur] = Threshold([u0 1, u0 2, . . . , u0 r], µ) (Clipping scheme of [4]) 4: for all t = 1, 2, . . . , τ do 5: /*OUTER LOOP */ 6: for all q = 1, 2, . . . , r do 7: /*INNER LOOP*/ 8: ˆut+1 1 = arg minut+1 q ∥PΩ(T −ut+1 q ⊗uq ⊗uq −P ℓ̸=q σℓ· uℓ⊗uℓ⊗uℓ)∥2 F 9: σt+1 q = ∥ˆuq t+1∥2 10: ut+1 q = ˆut+1 1 /∥ˆut+1 q ∥2 11: end for 12: [u1, u2, . . . , ur] ←[ut+1 1 , ut+1 2 , . . . , ut+1 r ] 13: [σ1, σ2, . . . , σr] ←[σt+1 1 , σt+1 2 , . . . , σt+1 r ] 14: end for 15: Output: bT = P q∈[r] σq(uq ⊗uq ⊗uq) The main novelty in our approach is that we refine all r components iteratively as opposed to the sequential deflation technique used by the existing methods for tensor decomposition (for fully observed tensors). In sequential deflation methods, components {u1, u2, . . . , ur} are estimated sequentially and estimate of say u2 is not used to refine u1. In contrast, our algorithm iterates over all r estimates in the inner loop, so as to obtain refined estimates for all ui’s in the outer loop. We believe that such a technique could be applied to improve the error bounds of (fully observed) tensor decomposition methods as well. As our method is directly solving a non-convex problem, it can easily get stuck in local minima. The key reason our approach can overcome the curse of local minima is that we start with a provably good initial point which is only a small distance away from the optima. To obtain such an initial estimate, we compute a low-rank approximation of the observed tensor using Robust Tensor Power Method (RTPM) [1]. RTPM is a generalization of the widely used power method for computing leading singular vectors of a matrix and can approximate the largest singular vectors up to the spectral norm of the “error” tensor. Hence, the challenge is to show that the error tensor has small spectral norm (see Theorem 2.1). We perform a thresholding step similar to [4] (see Lemma A.4) after the RTPM step to ensure that the estimates we get are incoherent. Our analysis requires the sampled entries Ωto be independent of the current iterates ui, ∀i, which in general is not possible as ui’s are computed using Ω. To avoid this issue, we divide the given samples (Ω) into equal r · τ parts randomly where τ is the number of outer loops (see Algorithm 1). 1.2 Main Result Theorem 1.1. Consider any rank-r symmetric tensor T ∈Rn×n×n with an orthogonal CP decomposition in (1) satisfying µ-incoherence as defined in (2). For any positive ε > 0, there exists a positive numerical constant C such that if entries are revealed with probability p ≥ C µ6 r5 σ4 max (log n)4 log(r∥T∥F /ε) σ4 min n3/2 , where σmax ≜maxℓσℓand σmin ≜minℓσℓ, then the following holds with probability at least 1 −n−5 log2(4√r ∥T∥F /ε): • the problem (3) has a unique optimal solution; and • log2( 4√r ∥T ∥F ε ) iterations of Algorithm 1 produces an estimate bT s.t. ∥T −bT∥F ≤ε . 3 The above result can be generalized to k-mode tensors in a straightforward manner, where exact recovery is guaranteed if, p ≥C µ6 r5 σ2k−2 max (log n)4 log(r∥T ∥F /ε) σ4 min nk/2 . However, for simplicity of notations and to emphasize key points of our proof, we only focus on 3-mode tensors in Section 2.3. We provide a proof of Theorem 1.1 in Section 2. For an incoherent, well-conditioned, and low-rank tensor with µ = O(1) and σmin = Θ(σmax), alternating minimization requires O(r5n3/2(log n)4) samples to get within an arbitrarily small normalized error. This is a vanishing fraction of the total number of entries n3. Each step in the alternating minimization requires O(r|Ω|) operations, hence the alternating minimization only requires O(r|Ω| log(r∥T∥F /ε)) operations. The initialization step requires O(rc|Ω|) operations for some positive numerical constant c as proved in [1]. When r ≪n, the computational complexity scales linearly in the sample size up to a logarithmic factor. A fiber in a third order tensor is an n-dimensional vector defined by fixing two of the axes and indexing over remaining one axis. The above theorem implies that among n2 fibers of the form {T[I, ej, ek]}j,k∈[n], exact recovery is possible even if only O(n3/2(log n)4) fibers have non-zero samples, that is most of the fibers are not sampled at all. This should be compared to the matrix completion setting where all fibers are required to have at least one sample. However, unlike matrices, the fundamental limit of higher order tensor completion is not known. Building on the percolation of Erd¨os-Ren´yi graphs and the coupon-collectors problem, it is known that matrix completion has multiple rank-r solutions when the sample size is less than Cµrn log n [6], hence exact recovery is impossible. But, such arguments do not generalize directly to higher order; see Section 2.5 for more discussion. Interestingly, simulations in Section 1.3 suggests that for r = O(√n), the sample complexity scales as (r1/2n3/2 log n). That is, assuming the sample complexity provided by simulations is correct, our result achieves optimal dependence on n (up to log factors). However, the dependency on r is sub-optimal (see Section 2.5 for a discussion). 1.3 Empirical Results Theorem 1.1 guarantees exact recovery when p ≥Cr5(log n)4/n3/2. Numerical experiments show that the average recovery rate converges to a universal curve over α, where p∗= αr1/2 ln n/((1 − ρ)n3/2) in Figure 1. Our bound is tight in its dependency n up to a poly-logarithmic factor, but is loose in its dependency in the rank r. Further, it is able to recover the original matrix exactly even when the factors are not strictly orthogonal. We generate orthogonal matrices U = [u1, . . . , ur] ∈Rn×r uniformly at random with n = 50 and r = 3 unless specified otherwise. For a rank-r tensor T = Pr i=1 ui ⊗ui ⊗ui, we randomly reveal each entry with probability p. A tensor is exactly recovered if the normalized root mean squared error, RMSE = ∥T −ˆT∥F /∥T∥F , is less than 10−72. Varying n and r, we plot the recovery rate averaged over 100 instances as a function of α. The degrees of freedom in representing a symmetric tensor is Ω(rn). Hence for large, r we need number of samples scaling as r. Hence, the current dependence of p∗= O(√r) can only hold for r = O(n). For not strictly orthogonal factors, the algorithm is robust. A more robust approach for finding an initial guess could improve the performance significantly, especially for non-orthogonal tensors. 0 0.2 0.4 0.6 0.8 1 0 1 2 3 4 5 6 7 8 9 n=50 n=100 n=200 α 0 0.2 0.4 0.6 0.8 1 0 1 2 3 4 5 6 7 8 9 r=2 r=3 r=4 r=5 α 0 0.2 0.4 0.6 0.8 1 0 1 2 3 4 5 6 7 8 9 10 = 0 = 0.2 = 0.3 = 0.4 ρρρρ α Figure 1: Average recovery rate converges to a universal curve over α when p = αr1/2 ln n/((1 − ρ)n3/2), where ρ = maxi̸=j∈[r]⟨ui, uj⟩and r = O(√n). 2A MATLAB implementation of Algorithm 1 used to run the experiments is available at http://web.engr.illinois.edu/∼swoh/software/optspace . 4 1.4 Related Work Tensor decomposition and completion: The CP model proposed in [7, 8, 9] is a multidimensional generalization of singular value decomposition of matrices. Computing the CP decomposition involves two steps: first apply a whitening operator to the tensor to get a lower dimensional tensor with orthogonal CP decomposition. Such a whitening operator only exists when r ≤n. Then, apply known power-method techniques for exact orthogonal CP decomposition [1]. We use this algorithm as well as the analysis for the initial step of our algorithm. For motivation and examples of orthogonal CP models we refer to [10, 1]. Recently, many heuristics for tensor completion have been developed such as the weighted least squares [11], Gauss-Newton [12], alternating least-squares [13, 14], trace norm minimization [15]. However, no theoretical guarantees are known for these approaches. In a different context, [16] shows that minimizing a weighted trace norm of flattened tensor provides exact recovery using O(rn3/2) samples, but each observation needs to be a dense random projection of the tensor as opposed to observing just a single entry, which is the case in the tensor completion problem. In [17], an adaptive sampling method with an estimation algorithm was proposed that provably recovers a kmode rank-r tensor with O(nrk−0.5µk−1k log(r)). However, the estimation algorithm as wells the analysis crucially relies on adaptive sampling and does not generalize to random samples. Relation to matrix completion: Matrix completion has been studied extensively in the last decade since the seminal paper [18]. Since then, provable approaches have been developed, such as, nuclear norm minimization [18, 19], OptSpace [20, 21], and Alternating Minimization [4]. However, several aspects of tensor factorization makes it challenging to adopt matrix completion approaches directly. First, there is no natural convex surrogate of the tensor rank function and developing such a function is in fact a topic of active research [22, 16]. Next, even when all entries are revealed, tensor decomposition methods such as simultaneous power iteration are known to get stuck at local extrema, making it challenging to apply matrix decomposition methods directly. Third, for the initialization step, the best low-rank approximation of a matrix is unique and finding it is trivial. However, for tensors, finding the best low-rank approximation is notoriously difficult. On the other hand, some aspects of tensor decomposition makes it possible to prove stronger results. Matrix completion aims to recover the underlying matrix only, since the factors are not uniquely defined due to invariance under rotations. However, for orthogonal CP models, we can hope to recover the individual singular vectors ui’s exactly. In fact, Theorem 1.1 shows that our method indeed recovers the individual singular vectors exactly. Spectral analysis of tensors and hypergraphs: Theorem 2.1 and Lemma 2.2 should be compared to copious line of work on spectral analysis of matrices [23, 20], with an important motivation of developing fast algorithms for low-rank matrix approximations. We prove an analogous guarantee for higher order tensors and provide a fast algorithm for low-rank tensor approximation. Theorem 2.1 is also a generalization of the celebrated result of Friedman-Kahn-Szemer´edi [24] and FeigeOfek [25] on the second eigenvalue of random graphs. We provide an upper bound the largest second eigenvalue of a random hypergraph, where each edge includes three nodes and each of the n 3  edges is selected with probability p. 2 Analysis of the Alternating Minimization Algorithm In this section, we provide a proof of Theorem 1.1 and the proof sketches of the required main technical theorems. We refer to the Appendix for formal proofs of the technical theorems and lemmas. There are two key components: a) the analysis of the initialization step (Section 2.1); and b) the convergence of alternating minimization given a sufficiently accurate initialization (Section 2.2). We use these two analyses to prove Theorem 1.1 in Section 2.3. 2.1 Initialization Analysis We first show that (1/p)PΩ(T) is close to T in spectral norm, and use it bound the error of robust power method applied directly to PΩ(T). The normalization by (1/p) compensates for the fact that many entries are missing. For a proof of this theorem, we refer to Appendix A. 5 Theorem 2.1 (Initialization). For p = α/n3/2 satisfying α ≥log n, there exists a positive constant C > 0 such that, with probability at least 1 −n−5, 1 Tmax n3/2 p∥PΩ(T) −p T∥2 ≤ C (log n)2 √α , (5) where Tmax ≡maxi,j,k Tijk, and ∥T∥2 ≡max∥u∥=1 T[u, u, u] is the spectral norm. Notice that Tmax is the maximum entry in the tensor T and the factor 1/(Tmaxn3/2p) corresponds to normalization with the worst case spectral norm of p T, since ∥pT∥2 ≤Tmaxn3/2p and the maximum is achieved by T = Tmax(1⊗1⊗1). The following theorem guarantees that O(n3/2(log n)2) samples are sufficient to ensure that we get arbitrarily small error. A formal proof is provided in the Appendix. Together with an analysis of robust tensor power method [1, Theorem 5.1], the next error bound follows from directly substituting (5) and using the fact that for incoherent tensors Tmax ≤ σmaxµ(T)3r/n3/2. Notice that the estimates can be computed efficiently, requiring only O(log r + log log α) iterations, each iteration requiring O(αn3/2) operations. This is close to the time required to read the |Ω| ≃αn3/2 samples. One caveat is that we need to run robust power method poly(r log n) times, each with fresh random initializations. Lemma 2.2. For a µ-incoherent tensor with orthogonal decomposition T = Pr ℓ=1 σ∗ ℓ(u∗ ℓ⊗ u∗ ℓ⊗u∗ ℓ) ∈Rn×n×n, there exists positive numerical constants C, C′ such that when α ≥ C(σmax/σmin)2r5µ6(log n)4, running C′(log r + log log α) iterations of the robust tensor power method applied to PΩ(T) achieves ∥u∗ ℓ−u0 ℓ∥2 ≤ C′ σ∗ max |σ∗ ℓ| µ3r(log n)2 √α , |σ∗ ℓ−σℓ| |σ∗ ℓ| ≤ C′ σ∗ max |σ∗ ℓ| µ3r(log n)2 √α , for all ℓ∈[r] with probability at least 1 −n−5, where σ∗ max = maxℓ∈[r] |σ∗ ℓ| and σ∗ min = minℓ∈[r] |σ∗ ℓ|. 2.2 Alternating Minimization Analysis We now provide convergence analysis for the alternating minimization part of Algorithm 1 to recover rank-r tensor T. Our analysis assumes that ∥ui −u∗ i ∥2 ≤cσmin/rσmax, ∀i where c is a small constant (dependent on r and the condition number of T). The above mentioned assumption can be satisfied using our initialization analysis and by assuming Ωis large-enough. At a high-level, our analysis shows that each step of Algorithm 1 ensures geometric decay of a distance function (specified below) which is “similar” to maxj ∥ut j −u∗ j∥2. Formally, let T = Pr ℓ=1 σ∗ ℓ· u∗ ℓ⊗u∗ ℓ⊗u∗ ℓ. WLOG, we can assume that that σ∗ ℓ≤1. Also, let [U, Σ] = {(uℓ, σℓ), 1 ≤ℓ≤r}, be the t-th step iterates of Algorithm 1. We assume that u∗ ℓ, ∀ℓare µ-incoherent and uℓ, ∀ℓare 2µ-incoherent. Define, ∆σ ℓ= |σℓ−σ∗ ℓ| σ∗ ℓ , uℓ= u∗ ℓ+ dℓ, (∆σ ℓ)t+1 = |σt+1 ℓ −σ∗ ℓ| σ∗ ℓ , and ut+1 ℓ = u∗ ℓ+ dt+1 ℓ . Now, define the following distance function: d∞([U, Σ], [U ∗, Σ∗]) ≡max ℓ (∥dℓ∥2 + ∆σ ℓ) . The next theorem shows that this distance function decreases geometrically with number of iterations of Algorithm 1. A proof of this theorem is provided in Appendix B.4. Theorem 2.3. If d∞([U, Σ], [U ∗, Σ∗]) ≤ 1 1600r σ∗ min σ∗max and ui is 2µ-incoherent for all 1 ≤i ≤r, then there exists a positive constant C such that for p ≥Cr2(σ∗ max)2µ3 log2 n (σ∗ min)2n3/2 we have w.p. ≥1 −1 n7 , d∞([U t+1, Σt+1], [U ∗, Σ∗]) ≤1 2d∞([U, Σ], [U ∗, Σ∗]), where [U t+1, Σt+1] = {(ut+1 ℓ , σt+1 ℓ ), 1 ≤ℓ≤r} are the (t + 1)-th step iterates of Algorithm 1. Moreover, each ut+1 ℓ is 2µ-incoherent for all ℓ. 6 1e-16 1e-14 1e-12 1e-10 1e-08 1e-06 0.0001 0.01 1 0 5 10 15 20 25 30 p=0.0025, fit error RMSE p=0.1, fit error RMSE iterations error Figure 2: Algorithm 1 exhibits linear convergence until machine precision. For the estimate bTt at the t-th iterations, the fit error ∥PΩ(T −bTt)∥F /∥PΩ(T)∥F closely tracks the normalized root mean squared error ∥T −bTt∥F /∥T∥F , suggesting that it serves as a good stopping criterion. Note that our number of samples depend on the number of iterations τ. But due to linear convergence, our sample complexity increases only by a factor of log(1/ϵ) where ϵ is the desired accuracy. Difference from Matrix AltMin: Here, we would like to highlight differences between our analysis and analysis of the alternating minimization method for matrix completion (matrix AltMin) [4, 5]. In the matrix case, the singular vectors u∗ i ’s need not be unique. Hence, the analysis is required to guarantee a decay in the subspace distance dist(U, U ∗); typically, principal angle based subspace distance is used for analysis. In contrast, orthonormal u∗ i ’s uniquely define the tensor and hence one can obtain distance bounds ∥ui −u∗ i ∥2 for each component ui individually. On the other other hand, an iteration of the matrix AltMin iterates over all the vectors ui, 1 ≤i ≤r, where r is the rank of the current iterate and hence don’t have to consider the error in estimation of the fixed components U[r]\q = {uℓ, ∀ℓ̸= q}, which is a challenge for the analysis of Algorithm 1 and requires careful decomposition and bounds of the error terms. 2.3 Proof of Theorem 1.1 Let T = Pr q=1 σ∗ q(u∗ q ⊗u∗ q ⊗u∗ q). Denote the initial estimates U 0 = [u0 1, . . . , u0 r] and σ0 = [σ0 1, . . . , σ0 r] to be the output of robust tensor power method at step 5 of Algorithm 1. With a choice of p ≥C(σ∗ max)4µ6r4(log n)4/(σ∗ min)4n3/2 as per our assumption, Lemma 2.2 ensures that we have ∥u0 q −u∗ q∥≤σ∗ min/(4800 rσmax) and |σ0 q −σ∗ q| ≤|σ∗ q|σ∗ min/(4800 rσmax) with probability at least 1−n−5. This requires running robust tensor power method for (r log n)c random initializations for some positive constant c, each requiring O(|Ω|) operations ignoring logarithmic factors. To ensure that we have sufficiently incoherent initial iterate, we perform thresholding proposed in [4]. In particular, we threshold all the elements of u0 i (obtained from RTPM method, see Step 3 of Algorithm 1) that are larger (in magnitude) than µ/√n to be sign(uℓ(i))µ √n and then re-normalize to obtain ui. Using Lemma A.4, this procedure ensures that the obtained initial estimate ui satisfies the two criteria that is required by Theorem 2.3: a) ∥ui −u∗ i ∥2 ≤ 1 1600r · σ∗ min σ∗max , and b) ui is 2µ-incoherent. With this initialization, Theorem 2.3 tells us that O(log2(4r1/2∥T∥F /ε) iterations (each iteration requires O(r|Ω|) operations) is sufficient to achieve: ∥uq −u∗ q∥2 ≤ ε 4r1/2∥T∥F and |σq −σ∗ q| ≤ |σ∗ q|ε 4r1/2∥T∥F , for all q ∈[r] with probability at least 1−n−7 log2(4r1/2∥T∥F /ε). The desired bound follows from the next lemma with a choice of ˜ε = ε/4r1/2∥T∥F . For a proof we refer to Appendix B.6. Lemma 2.4. For an orthogonal rank-r tensor T = Pr q=1 σ∗ q(u∗ q ⊗u∗ q ⊗u∗ q) and any rank-r tensor bT = Pr q=1 σq(uq ⊗uq ⊗uq) satisfying ∥u −u∗∥2 ≤˜ε and |σ −σ∗| ≤|σ∗|˜ε for all q ∈[r] and for all positive ˜ε > 0, we have ∥T −bT∥F ≤4 r1/2 ∥T∥F ˜ε. 7 2.4 Fundamental limit and random hypergraphs For matrices, it is known that exact matrix completion is impossible if the underlying graph is disconnected. For Erd¨os-Ren´yi graphs, when sample size is less than Cµrn log n, no algorithm can recover the original matrix [6]. However, for tensor completion and random hyper graphs, such a simple connection does not exist. It is not known how the properties of the hyper graph is related to recovery. In this spirit, a rank-one third-order tensor completion has been studied in a specific context of MAX-3LIN problems. Consider a series of linear equations over n binary variables x = [x1 . . . xn] ∈{±1}n. An instance of a 3LIN problem consists of a set of linear equations on GF(2), where each equation involve exactly three variables, e.g. x1 ⊕x2 ⊕x3 = +1 , x2 ⊕x3 ⊕x4 = −1 , x3 ⊕x4 ⊕x5 = +1 (6) We use −1 to denote true (or 1 in GF(2)) and +1 to denote false (or 0 in GF(2)). Then the exclusiveor operation denoted by ⊕is the integer multiplication. the MAX-3LIN problem is to find a solution x that satisfies as many number of equations as possible. This is an NP-hard problem in general, and hence random instances of the problem with a planted solution has been studied [26]. Algorithm 1 provides a provable guarantee for MAX-3LIN with random assignments. Corollary 2.5. For random MAX-3LIN problem with a planted solution, under the hypotheses of Theorem 1.1, Algorithm 1 finds the correct solution with high probability. Notice that this tensor has incoherence one and rank one. This implies exact reconstruction for P ≥C(log n)4/n3/2. This significantly improves over a message-passing approach to MAX-3LIN in [26], which is guaranteed to find the planted solution for p ≥C(log log n)2/(n log n). It was suggested that a new notion of connectivity called propagation connectivity is a sufficient condition for the solution of random MAX-3LIN problem with a planted solution to be unique [26, Proposition 2]. Precisely, it is claimed that if the hypergraph corresponding to an instance of MAX-3LIN is propagation connected, then the optimal solution for MAX-3LIN is unique and there is an efficient algorithm that finds it. However, the example in 6 is propagation connected but there is no unique solution: both [1, 1, 1, −1, −1] and [1, −1, −1, 1, −1] satisfy the equations. Hence, propagation connectivity is not a sufficient condition for uniqueness of the MAX-3LIN solution. 2.5 Open Problems and Future Directions Tensor completion for non-orthogonal decomposition. Numerical simulations suggests that nonorthogonal CP models can be recovered exactly (without the usual whitening step). It would be interesting to analyze our algorithm under non-orthogonal CP model. However, we would like to point here that even with fully observed tensor, exact factorization is known only for orthonormal tensors. Now, given that our method guarantees not only completion but also tensor factorization (which is essential for large scale applications), our method would require a similar condition. Optimal dependence on r. The numerical results suggest the threshold sample size scaling as √r. This is surprising since the degrees of freedom in describing a CP model scales linearly in r, implying that the √r scaling only holds for r = O(√n). In comparison, for matrix completion the threshold scales as r. It is important to understand why this change in dependence in r happens for higher order tensors, and identify how it depends on k for k-th order tensor completion. Mis-specified r and µ. The algorithm requires the knowledge of the rank r and the incoherence µ. The algorithm is not sensitive to the knowledge of µ. In fact, all the numerical experiments are run without specifying the incoherence, and without the clipping step. An interesting direction is to understand the price of mis-specified rank and to estimate the true rank from data. References [1] Anandkumar Anima, Ge Rong, Hsu Daniel, M. Kakade Sham, and Matus Telgarsky. Tensor decompositions for learning latent variable models. CoRR, abs/1210.7559, 2012. [2] A. Anandkumar, R. Ge, and M. Janzamin. Guaranteed non-orthogonal tensor decomposition via alternating rank-1 updates. arXiv preprint arXiv:1402.5180, 2014. [3] V. De Silva and L.-H. Lim. Tensor rank and the ill-posedness of the best low-rank approximation problem. SIAM Journal on Matrix Analysis and Applications, 30(3):1084–1127, 2008. 8 [4] P. Jain, P. Netrapalli, and S. Sanghavi. Low-rank matrix completion using alternating minimization. In STOC, pages 665–674, 2013. [5] M. Hardt. On the provable convergence of alternating minimization for matrix completion. arXiv preprint arXiv:1312.0925, 2013. [6] E. J. Cand`es and T. Tao. The power of convex relaxation: Near-optimal matrix completion. Information Theory, IEEE Transactions on, 56(5):2053–2080, 2010. [7] F. L. Hitchcock. The expression of a tensor or a polyadic as a sum of products. 1927. [8] J Douglas Carroll and Jih-Jie Chang. Analysis of individual differences in multidimensional scaling via an n-way generalization of eckart-young decomposition. Psychometrika, 35(3):283–319, 1970. [9] Richard A Harshman. Foundations of the parafac procedure: models and conditions for an explanatory multimodal factor analysis. 1970. [10] T. Zhang and G. H. Golub. Rank-one approximation to high order tensors. SIAM Journal on Matrix Analysis and Applications, 23(2):534–550, 2001. [11] E. Acar, D. M. Dunlavy, T. G. Kolda, and M. Mørup. Scalable tensor factorizations for incomplete data. Chemometrics and Intelligent Laboratory Systems, 106(1):41–56, 2011. [12] G. Tomasi and R. Bro. Parafac and missing values. Chemometrics and Intelligent Laboratory Systems, 75(2):163–180, 2005. [13] Rasmus Bro. Multi-way analysis in the food industry: models, algorithms, and applications. PhD thesis, Københavns UniversitetKøbenhavns Universitet, 1998. [14] B Walczak and DL Massart. Dealing with missing data: Part i. Chemometrics and Intelligent Laboratory Systems, 58(1):15–27, 2001. [15] J. Liu, P. Musialski, P. Wonka, and J. Ye. Tensor completion for estimating missing values in visual data. Pattern Analysis and Machine Intelligence, IEEE Trans. on, 35(1):208–220, 2013. [16] C. Mu, B. Huang, J. Wright, and D. Goldfarb. Square deal: Lower bounds and improved relaxations for tensor recovery. arXiv preprint arXiv:1307.5870, 2013. [17] A. Krishnamurthy and A. Singh. Low-rank matrix and tensor completion via adaptive sampling. In Advances in Neural Information Processing Systems, pages 836–844, 2013. [18] E. J. Cand`es and B. Recht. Exact matrix completion via convex optimization. Foundations of Computational Mathematics, 9(6):717–772, 2009. [19] S. Negahban and M. J. Wainwright. Restricted strong convexity and (weighted) matrix completion: Optimal bounds with noise. Journal of Machine Learning Research, 2012. [20] R. H. Keshavan, A. Montanari, and S. Oh. Matrix completion from a few entries. Information Theory, IEEE Transactions on, 56(6):2980–2998, 2010. [21] R. H Keshavan, A. Montanari, and S. Oh. Matrix completion from noisy entries. Journal of Machine Learning Research, 11(2057-2078):1, 2010. [22] R. Tomioka and T. Suzuki. Convex tensor decomposition via structured schatten norm regularization. In NIPS, pages 1331–1339, 2013. [23] Y. Azar, A. Fiat, A. Karlin, F. McSherry, and J. Saia. Spectral analysis of data. In Proc. of the 33rd annual ACM symposium on Theory of computing, pages 619–626. ACM, 2001. [24] J. Friedman, J. Kahn, and E. Szemer´edi. On the second eigenvalue in random regular graphs. In Proceedings of the Twenty-First Annual ACM Symposium on Theory of Computing, pages 587–598, Seattle, Washington, USA, may 1989. ACM. [25] U. Feige and E. Ofek. Spectral techniques applied to sparse random graphs. Random Struct. Algorithms, 27(2):251–275, 2005. [26] R. Berke and M. Onsj¨o. Propagation connectivity of random hypergraphs. In Stochastic Algorithms: Foundations and Applications, pages 117–126. Springer, 2009. 9
2014
317
5,422
Learning Generative Models with Visual Attention Yichuan Tang, Nitish Srivastava, Ruslan Salakhutdinov Department of Computer Science University of Toronto Toronto, Ontario, Canada {tang,nitish,rsalakhu}@cs.toronto.edu Abstract Attention has long been proposed by psychologists to be important for efficiently dealing with the massive amounts of sensory stimulus in the neocortex. Inspired by the attention models in visual neuroscience and the need for object-centered data for generative models, we propose a deep-learning based generative framework using attention. The attentional mechanism propagates signals from the region of interest in a scene to an aligned canonical representation for generative modeling. By ignoring scene background clutter, the generative model can concentrate its resources on the object of interest. A convolutional neural net is employed to provide good initializations during posterior inference which uses Hamiltonian Monte Carlo. Upon learning images of faces, our model can robustly attend to the face region of novel test subjects. More importantly, our model can learn generative models of new faces from a novel dataset of large images where the face locations are not known. 1 Introduction Building rich generative models that are capable of extracting useful, high-level latent representations from high-dimensional sensory input lies at the core of solving many AI-related tasks, including object recognition, speech perception and language understanding. These models capture underlying structure in data by defining flexible probability distributions over high-dimensional data as part of a complex, partially observed system. Some of the successful generative models that are able to discover meaningful high-level latent representations include the Boltzmann Machine family of models: Restricted Boltzmann Machines, Deep Belief Nets [1], and Deep Boltzmann Machines [2]. Mixture models, such as Mixtures of Factor Analyzers [3] and Mixtures of Gaussians, have also been used for modeling natural image patches [4]. More recently, denoising auto-encoders have been proposed as a way to model the transition operator that has the same invariant distribution as the data generating distribution [5]. Generative models have an advantage over discriminative models when part of the images are occluded or missing. Occlusions are very common in realistic settings and have been largely ignored in recent literature on deep learning. In addition, prior knowledge can be easily incorporated in generative models in the forms of structured latent variables, such as lighting and deformable parts. However, the enormous amount of content in high-resolution images makes generative learning difficult [6, 7]. Therefore, generative models have found most success in learning to model small patches of natural images and objects: Zoran and Weiss [4] learned a mixture of Gaussians model over 8×8 image patches; Salakhutdinov and Hinton [2] used 64×64 centered and uncluttered stereo images of toy objects on a clear background; Tang et al. [8] used 24×24 images of centered and cropped faces. The fact that these models require curated training data limits their applicability on using the (virtually) unlimited unlabeled data. In this paper, we propose a framework to infer the region of interest in a big image for generative modeling. This will allow us to learn a generative model of faces on a very large dataset of (unlabeled) images containing faces. Our framework is able to dynamically route the relevant information to the generative model and can ignore the background clutter. The need to dynamically and selectively route information is also present in the biological brain. Plethora of evidence points to 1 the presence of attention in the visual cortex [9, 10]. Recently, in visual neuroscience, attention has been shown to exist not only in extrastriate areas, but also all the way down to V1 [11]. Attention as a form of routing was originally proposed by Anderson and Van Essen [12] and then extended by Olshausen et al. [13]. Dynamic routing has been hypothesized as providing a way for achieving shift and size invariance in the visual cortex [14, 15]. Tsotsos et al. [16] proposed a model combining search and attention called the Selective Tuning model. Larochelle and Hinton [17] proposed a way of using third-order Boltzmann Machines to combine information gathered from many foveal glimpses. Their model chooses where to look next to find locations that are most informative of the object class. Reichert et al. [18] proposed a hierarchical model to show that certain aspects of covert object-based attention can be modeled by Deep Boltzmann Machines. Several other related models attempt to learn where to look for objects [19, 20] and for video based tracking [21]. Inspired by Olshausen et al. [13], we use 2D similarity transformations to implement the scaling, rotation, and shift operation required for routing. Our main motivation is to enable the learning of generative models in big images where the location of the object of interest is unknown a-priori. 2 Gaussian Restricted Boltzmann Machines Before we describe our model, we briefly review the Gaussian Restricted Boltzmann Machine (GRBM) [22], as it will serve as the building block for our attention-based model. GRBMs are a type of Markov Random Field model that has a bipartite structure with real-valued visible variables v ∈RD connected to binary stochastic hidden variables h ∈{0, 1}H. The energy of the joint configuration {v, h} of the Gaussian RBM is defined as follows: EGRBM(v, h; Θ) = 1 2 X i (vi −bi)2 σ2 i − X j cjhj − X ij Wijvihj, (1) where Θ = {W, b, c, σ} are the model parameters. The marginal distribution over the visible vector v is P(v; Θ) = 1 Z(Θ) P h exp (−E(v, h; Θ)) and the corresponding conditional distributions take the following form: p(hj = 1|v) = 1/ 1 + exp(− X i Wijvi −cj)  , (2) p(vi|h) = N(vi; µi, σ2 i ), where µi = bi + σ2 i X j Wijhj. (3) Observe that conditioned on the states of the hidden variables (Eq. 3), each visible unit is modeled by a Gaussian distribution, whose mean is shifted by the weighted combination of the hidden unit activations. Unlike directed models, an RBM’s conditional distribution over hidden nodes is factorial and can be easily computed. We can also add a binary RBM on top of the learned GRBM by treating the inferred h as the “visible” layer together with a second hidden layer h2. This results in a 2-layer Gaussian Deep Belief Network (GDBN) [1] that is a more powerful model of v. Specifically, in a GDBN model, p(h1, h2) is modeled by the energy function of the 2nd-layer RBM, while p(v1|h1) is given by Eq. 3. Efficient inference can be performed using the greedy approach of [1] by treating each DBN layer as a separate RBM model. GDBNs have been applied to various tasks, including image classification, video action and speech recognition [6, 23, 24, 25]. 3 The Model Let I be a high resolution image of a scene, e.g. a 256×256 image. We want to use attention to propagate regions of interest from I up to a canonical representation. For example, in order to learn a model of faces, the canonical representation could be a 24×24 aligned and cropped frontal face image. Let v ∈RD represent this low resolution canonical image. In this work, we focus on a Deep Belief Network1 to model v. This is illustrated in the diagrams of Fig. 1. The left panel displays the model of Olshausen et.al. [13], whereas the right panel shows a graphical diagram of our proposed generative model with an attentional mechanism. Here, h1 and h2 represent the latent hidden variables of the DBN model, and 1Other generative models can also be used with our attention framework. 2 Olshausen et al. 93 Our model 2d similarity transformation Figure 1: Left: The Shifter Circuit, a well-known neuroscience model for visual attention [13]; Right: The proposed model uses 2D similarity transformations from geometry and a Gaussian DBN to model canonical face images. Associative memory corresponds to the DBN, object-centered frame correspond to the visible layer and the attentional mechanism is modeled by 2D similarity transformations. △x, △y, △θ, △s (position, rotation, and scale) are the parameters of the 2D similarity transformation. The 2D similarity transformation is used to rotate, scale, and translate the canonical image v onto the canvas that we denote by I. Let p = [x y]T be a pixel coordinate (e.g. [0, 0] or [0, 1]) of the canonical image v. Let {p} be the set of all coordinates of v. For example, if v is 24×24, then {p} ranges from [0, 0] to [23, 23]. Let the “gaze” variables u ∈R4 ≡[△x, △y, △θ, △s] be the parameter of the Similarity transformation. In order to simplify derivations and to make transformations be linear w.r.t. the transformation parameters, we can equivalently redefine u = [a, b, △x, △y], where a = s sin(θ) −1 and b = s cos(θ) (see [26] for details). We further define a function w := w(p, u) →p′ as the transformation function to warp points p to p′: p′ ≜ h x′ y′ i = h 1 + a −b b 1 + a ih x y i + h △x △y i . (4) We use the notation I({p}) to denote the bilinear interpolation of I at coordinates {p} with antialiasing. Let x(u) be the extracted low-resolution image at warped locations p′: x(u) ≜I(w({p}, u)). (5) Intuitively, x(u) is a patch extracted from I according to the shift, rotation and scale parameters of u, as shown in Fig. 1, right panel. It is this patch of data that we seek to model generatively. Note that the dimensionality of x(u) is equal to the cardinality of {p}, where {p} denotes the set of pixel coordinates of the canonical image v. Unlike standard generative learning tasks, the data x(u) is not static but changes with the latent variables u. Given v and u, we model the top-down generative process over2 x with a Gaussian distribution having a diagonal covariance matrix σ2I: p(x|v, u, I) ∝exp  −1 2 X i (xi(u) −vi)2 σ2 i  . (6) The fact that we do not seek to model the rest of the regions/pixels of I is by design. By using 2D similarity transformation to mimic attention, we can discard the complex background of the scene and let the generative model focus on the object of interest. The proposed generative model takes the following form: p(x, v, u|I) = p(x|v, u, I)p(v)p(u), (7) where for p(u) we use a flat prior that is constant for all u, and p(v) is defined by a 2-layer Gaussian Deep Belief Network. The conditional p(x|v, u, I) is given by a Gaussian distribution as in Eq. 6. To simplify the inference procedure, p(x|v, u, I) and the GDBN model of v, p(v), will share the same noise parameters σi. 2We will often omit dependence of x on u for clarity of presentation. 3 4 Inference While the generative equations in the last section are straightforward and intuitive, inference in these models is typically intractable due to the complicated energy landscape of the posterior. During inference, we wish to compute the distribution over the gaze variables u and canonical object v given the big image I. Unlike in standard RBMs and DBNs, there are no simplifying factorial assumptions about the conditional distribution of the latent variable u. Having a 2D similarity transformation is reminiscent of third-order Boltzmann machines with u performing top-down multiplicative gating of the connections between v and I. It is well known that inference in these higher-order models is rather complicated. One way to perform inference in our model is to resort to Gibbs sampling by computing the set of alternating conditional posteriors: The conditional distribution over the canonical image v takes the following form: p(v|u, h1, I) = N µ + x(u) 2 ; σ2 , (8) where µi = bi + σ2 i P j Wijh1 j is the top-down influence of the DBN. Note that if we know the gaze variable u and the first layer of hidden variables h1, then v is simply defined by a Gaussian distribution, where the mean is given by the average of the top-down influence and bottom-up information from x. The conditional distributions over h1 and h2 given v are given by the standard DBN inference equations [1]. The conditional posterior over the gaze variables u is given by: p(u|x, v) = p(x|u, v)p(u) p(x|v) , log p(u|x, v) ∝log p(x|u, v) + log p(u) = 1 2 X i (xi(u) −vi)2 σ2 i + const. (9) Using Bayes’ rule, the unnormalized log probability of p(u|x, v) is defined in Eq. 9. We stress that this equation is atypical in that the random variable of interest u actually affects the conditioning variable x (see Eq. 5) We can explore the gaze variables using Hamiltonian Monte Carlo (HMC) algorithm [27, 28]. Intuitively, conditioned on the canonical object v that our model has in “mind”, HMC searches over the entire image I to find a region x with a good match to v. If the goal is only to find the MAP estimate of p(u|x, v), then we may want to use second-order methods for optimizing u. This would be equivalent to the Lucas-Kanade framework in computer vision, developed for image alignment [29]. However, HMC has the advantage of being a proper MCMC sampler that satisfies detailed balance and fits nicely with our probabilistic framework. The HMC algorithm first specifies the Hamiltonian over the position variables u and auxiliary momentum variables r: H(u, r) = U(u) + K(r), where the potential function is defined by U(u) = 1 2 P i (xi(u)−vi)2 σ2 i and the kinetic energy function is given by K(r) = 1 2 P i r2 i . The dynamics of the system is defined by: ∂u ∂t = r, ∂r ∂t = −∂H ∂u (10) ∂H ∂u = (x(u) −v) σ2 ∂x(u) ∂u , (11) ∂x ∂u = ∂x ∂w({p}, u) ∂w({p}, u) ∂u = X i ∂xi ∂w(pi, u) ∂w(pi, u) ∂u . (12) Observe that Eq. 12 decomposes into sums over single coordinate positions pi = [x y]T. Let us denote p′ i = w(pi, u) to be the coordinate pi warped by u. For the first term on the RHS of Eq. 12, ∂xi ∂w(pi, u) = ∇I(p′ i), (dimension 1 by 2 ) (13) where ∇I(p′ i) denotes the sampling of the gradient images of I at the warped location pi. For the second term on the RHS of Eq. 12, we note that we can re-write Eq. 4 as: h x′ y′ i = h x −y 1 0 y x 0 1 i" a b △x △y # + h x y i , (14) 4 giving us ∂w(pi, u) ∂u = h x −y 1 0 y x 0 1 i . (15) HMC simulates the discretized system by performing leap-frog updates of u and r using Eq. 10. Additional hyperparameters that need to be specified include the step size ϵ, number of leap-frog steps, and the mass of the variables (see [28] for details). 4.1 Approximate Inference (a) Average A B (b) Figure 2: (a) HMC can easily get stuck at local optima. (b) Importance of modeling p(u|v, I). Best in color. HMC essentially performs gradient descent with momentum, therefore it is prone to getting stuck at local optimums. This is especially a problem for our task of finding the best transformation parameters. While the posterior over u should be unimodal near the optimum, many local minima exist away from the global optimum. For example, in Fig. 2(a), the big image I is enclosed by the blue box, and the canonical image v is enclosed by the green box. The current setting of u aligns together the wrong eyes. However, it is hard to move the green box to the left due to the local optima created by the dark intensities of the eye. Resampling the momentum variable every iteration in HMC does not help significantly because we are modeling real-valued images using a Gaussian distribution as the residual, leading to quadratic costs in the difference between x(u) and v (see Eq. 9). This makes the energy barriers between modes extremely high. To alleviate this problem we need to find good initializations of u. We use a Convolutional Network (ConvNet) to perform efficient approximate inference, resulting in good initial guesses. Specifically, given v, u and I, we predict the change in u that will lead to the maximum log p(u|x, v). In other words, instead of using the gradient field for updating u, we learn a ConvNet to output a better vector field in the space of u. We used a fairly standard ConvNet architecture and the standard stochastic gradient descent learning procedure. We note that standard feedforward face detectors seek to model p(u|I), while completely ignoring the canonical face v. In contrast, here we take v into account as well. The ConvNet is used to initialize u for the HMC algorithm. This is important in a proper generative model because conditioning on v is appealing when multiple faces are present in the scene. Fig. 2(b) is a hypothesized Euclidean space of v, where the black manifold represents canonical faces and the blue manifold represents cropped faces x(u). The blue manifold has a low intrinsic dimensionality of 4, spanned by u. At A and B, the blue comes close to black manifold. This means that there are at least two modes in the posterior over u. By conditioning on v, we can narrow the posterior to a single mode, depending on whom we want to focus our attention. We demonstrate this exact capability in Sec. 6.3. Fig. 3 demonstrates the iterative process of how approximate inference works in our model. Specifically, based on u, the ConvNet takes a window patch around x(u) (72×72) and v (24×24) as input, and predicts the output [△x, △y, △θ, △s]. In step 2, u is updated accordingly, followed by step 3 of alternating Gibbs updates of v and h, as discussed in Sec. 4. The process is repeated. For the details of the ConvNet see the supplementary materials. 5 Learning While inference in our framework localizes objects of interest and is akin to object detection, it is not the main objective. Our motivation is not to compete with state-of-the-art object detectors but rather propose a probabilistic generative framework capable of generative modeling of objects which are at unknown locations in big images. This is because labels are expensive to obtain and are often not available for images in an unconstrained environment. To learn generatively without labels we propose a simple Monte Carlo based ExpectationMaximization algorithm. This algorithm is an unbiased estimator of the maximum likelihood objec5 ConvNet ConvNet Step 1 Step 2 Step 3 Step 4 1 Gibbs step Figure 3: Inference process: u in step 1 is randomly initialized. The average v and the extracted x(u) form the input to a ConvNet for approximate inference, giving a new u. The new u is used to sample p(v|I, u, h). In step 3, one step of Gibbs sampling of the GDBN is performed. Step 4 repeats the approximate inference using the updated v and x(u). Inference steps 1 2 3 4 5 6 HMC V X Figure 4: Example of an inference step. v is 24×24, x is 72×72. Approximate inference quickly finds a good initialization for u, while HMC provides further adjustments. Intermediate inference steps on the right are subsampled from 10 actual iterations. tive. During the E-step, we use the Gibbs sampling algorithm developed in Sec. 4 to draw samples from the posterior over the latent gaze variables u, the canonical variables v, and the hidden variables h1, h2 of a Gaussian DBN model. During the M-step, we can update the weights of the Gaussian DBN by using the posterior samples as its training data. In addition, we can update the parameters of the ConvNet that performs approximate inference. Due to the fact that the first E-step requires a good inference algorithm, we need to pretrain the ConvNet using labeled gaze data as part of a bootstrap process. Obtaining training data for this initial phase is not a problem as we can jitter/rotate/scale to create data. In Sec. 6.2, we demonstrate the ability to learn a good generative model of face images from the CMU Multi-PIE dataset. 6 Experiments We used two face datasets in our experiments. The first dataset is a frontal face dataset, called the Caltech Faces from 1999, collected by Markus Weber. In this dataset, there are 450 faces of 27 unique individuals under different lighting conditions, expressions, and backgrounds. We downsampled the images from their native 896 by 692 by a factor of 2. The dataset also contains manually labeled eyes and mouth coordinates, which will serve as the gaze labels. We also used the CMU Multi-PIE dataset [30], which contains 337 subjects, captured under 15 viewpoints and 19 illumination conditions in four recording sessions for a total of more than 750,000 images. We demonstrate our model’s ability to perform approximate inference, to learn without labels, and to perform identity-based attention given an image with two people. 6.1 Approximate inference We first investigate the critical inference algorithm of p(u|v, I) on the Caltech Faces dataset. We run 4 steps of approximate inference detailed in Sec. 4.1 and diagrammed in Fig. 3, followed by three iterations of 20 leap-frog steps of HMC. Since we do not initially know the correct v, we initialize v to be the average face across all subjects. Fig. 4 shows the image of v and x during inference for a test subject. The initial gaze box is colored yellow on the left. Subsequent gaze updates progress from yellow to blue. Once ConvNet-based approximate inference gives a good initialization, starting from step 5, five iterations of 20 leap-frog steps of HMC are used to sample from the the posterior. Fig. 5 shows the quantitative results of Intersection over Union (IOU) of the ground truth face box and the inferred face box. The results show that inference is very robust to initialization and requires 6 0 20 40 60 80 100 0.5 0.6 0.7 0.8 0.9 1 1.1 Accuracy of Approximate Inference Initial Pixel Offset Accuracy Trials with IOU > 0.5 Average IOU (a) 0 5 10 15 0 0.2 0.4 0.6 0.8 1 Accuracy of Approximate Inference # of Inference Steps Accuracy Trials with IOU > 0.5 Average IOU (b) 0 20 40 60 80 100 −0.2 −0.1 0 0.1 0.2 0.3 Accuracy Improvements Initial Pixel Offset Accuracy Average IOU Improvements (c) Figure 5: (a) Accuracy as a function of gaze initialization (pixel offset). Blue curve is the percentage success of at least 50% IOU. Red curve is the average IOU. (b) Accuracy as a function of the number of approximate inference steps when initializing 50 pixels away. (c) Accuracy improvements of HMC as a function of gaze initializations. (a) DBN trained on Caltech (b) DBN updated with Multi-PIE Figure 6: Left: Samples from a 2-layer DBN trained on Caltech. Right: samples from an updated DBN after training on CMU Multi-PIE without labels. Samples highlighted in green are similar to faces from CMU. only a few steps of approximate inference to converge. HMC clearly improves model performance, resulting in an IOU increase of about 5% for localization. This is impressive given that none of the test subjects were part of the training and the background is different from backgrounds in the training set. Our method OpenCV NCC template IOU > 0.5 97% 97% 93% 78% # evaluations O(c) O(whs) O(whs) O(whs) Table 1: Face localization accuracy. w: image width; h: image height; s: image scales; c: number of inference steps used. We also compared our inference algorithm to the template matching in the task of face detection. We took the first 5 subjects as test subjects and the rest as training. We can localize with 97% accuracy (IOU > 0.5) using our inference algorithm3. In comparison, a near state-of-the-art face detection system from OpenCV 2.4.9 obtains the same 97% accuracy. It uses Haar Cascades, which is a form of AdaBoost4. Normalized Cross Correlation [31] obtained 93% accuracy, while Euclidean distance template matching achieved an accuracy of only 78%. However, note that our algorithm looks at a constant number of windows while the other baselines are all based on scanning windows. 6.2 Generative learning without labels nats No CMU training CMU w/o labels CMU w/ labels Caltech Train 617±0.4 627±0.5 569±0.6 Caltech Valid 512±1.1 503±1.8 494±1.7 CMU Train 96±0.8 499±0.1 594±0.5 CMU Valid 85±0.5 387±0.3 503±0.7 log ˆZ 454.6 687.8 694.2 Table 2: Variational lower-bound estimates on the log-density of the Gaussian DBNs (higher is better). The main advantage of our model is that it can learn on large images of faces without localization label information (no manual cropping required). To demonstrate, we use both the Caltech and the CMU faces dataset. For the CMU faces, a subset of 2526 frontal faces with ground truth labels are used. We split the Caltech dataset into a training and a validation set. For the CMU faces, we first took 10% of the images as training cases for the ConvNet for approximate inference. This is needed due to the completely different backgrounds of the Caltech and CMU datasets. The remaining 90% of the CMU faces are split into a training and validation set. We first trained a GDBN with 1024 h1 and 256 h2 hidden units on the Caltech training set. We also trained 3u is randomly initialized at ± 30 pixels, scale range from 0.5 to 1.5. 4OpenCV detection uses pretrained model from haarcascade_frontalface_default.xml, scaleFactor=1.1, minNeighbors=3 and minSize=30. 7 Figure 7: Left: Conditioned on different v will result in a different △u. Note that the initial u is exactly the same for two trials. Right: Additional examples. The only difference between the top and bottom panels is the conditioned v. Best viewed in color. a ConvNet for approximate inference using the Caltech training set and 10% of the CMU training images. Table 2 shows the estimates of the variational lower-bounds on the average log-density (higher is better) that the GDBN models assign to the ground-truth cropped face images from the training/test sets under different scenarios. In the left column, the model is only trained on Caltech faces. Thus it gives very low probabilities to the CMU faces. Indeed, GDBNs achieve a variational lower-bound of only 85 nats per test image. In the middle column, we use our approximate inference to estimate the location of the CMU training faces and further trained the GDBN on the newly localized faces. This gives a dramatic increase of the model performance on the CMU Validation set5, achieving a lowerbound of 387 nats per test image. The right column gives the best possible results if we can train with the CMU manual localization labels. In this case, GDBNs achieve a lower-bound of 503 nats. We used Annealed Importance Sampling (AIS) to estimate the partition function for the top-layer RBM. Details on estimating the variational lower bound are in the supplementary materials. Fig. 6(a) further shows samples drawn from the Caltech trained DBN, whereas Fig. 6(b) shows samples after training with the CMU dataset using estimated u. Observe that samples in Fig. 6(b) show a more diverse set of faces. We trained GDBNs using a greedy, layer-wise algorithm of [1]. For the top layer we use Fast Persistent Contrastive Divergence [32], which substantially improved generative performance of GDBNs (see supplementary material for more details). 6.3 Inference with ambiguity Our attentional mechanism can also be useful when multiple objects/faces are present in the scene. Indeed, the posterior p(u|x, v) is conditioned on v, which means that where to attend is a function of the canonical object v the model has in “mind” (see Fig. 2(b)). To explore this, we first synthetically generate a dataset by concatenating together two faces from the Caltech dataset. We then train approximate inference ConvNet as in Sec. 4.1 and test on the held-out subjects. Indeed, as predicted, Fig. 7 shows that depending on which canonical image is conditioned, the same exact gaze initialization leads to two very different gaze shifts. Note that this phenomenon is observed across different scales and location of the initial gaze. For example, in Fig. 7, right-bottom panel, the initialized yellow box is mostly on the female’s face to the left, but because the conditioned canonical face v is that of the right male, attention is shifted to the right. 7 Conclusion In this paper we have proposed a probabilistic graphical model framework for learning generative models using attention. Experiments on face modeling have shown that ConvNet based approximate inference combined with HMC sampling is sufficient to explore the complicated posterior distribution. More importantly, we can generatively learn objects of interest from novel big images. Future work will include experimenting with faces as well as other objects in a large scene. Currently the ConvNet approximate inference is trained in a supervised manner, but reinforcement learning could also be used instead. Acknowledgements The authors gratefully acknowledge the support and generosity from Samsung, Google, and ONR grant N00014-14-1-0232. 5We note that we still made use of labels coming from the 10% of CMU Multi-PIE training set in order to pretrain our ConvNet. "w/o labels" here means that no labels for the CMU Train/Valid images are given. 8 References [1] G. E. Hinton, S. Osindero, and Y. W. Teh. A fast learning algorithm for deep belief nets. Neural Computation, 18(7):1527–1554, 2006. [2] R. Salakhutdinov and G. Hinton. Deep Boltzmann machines. In AISTATS, 2009. [3] Geoffrey E. Hinton, Peter Dayan, and Michael Revow. Modeling the manifolds of images of handwritten digits. IEEE Transactions on Neural Networks, 8(1):65–74, 1997. [4] Daniel Zoran and Yair Weiss. From learning models of natural image patches to whole image restoration. In ICCV. IEEE, 2011. [5] Yoshua Bengio, Li Yao, Guillaume Alain, and Pascal Vincent. Generalized denoising auto-encoders as generative models. In Advances in Neural Information Processing Systems 26, 2013. [6] H. Lee, R. Grosse, R. Ranganath, and A. Y. Ng. Convolutional deep belief networks for scalable unsupervised learning of hierarchical representations. In ICML, pages 609–616, 2009. [7] Marc’Aurelio Ranzato, Joshua Susskind, Volodymyr Mnih, and Geoffrey Hinton. On Deep Generative Models with Applications to Recognition. In CVPR, 2011. [8] Yichuan Tang, Ruslan Salakhutdinov, and Geoffrey E. Hinton. Deep mixtures of factor analysers. In ICML. icml.cc / Omnipress, 2012. [9] M. I. Posner and C. D. Gilbert. Attention and primary visual cortex. Proc. of the National Academy of Sciences, 96(6), March 1999. [10] E. A. Buffalo, P. Fries, R. Landman, H. Liang, and R. Desimone. A backward progression of attentional effects in the ventral stream. PNAS, 107(1):361–365, Jan. 2010. [11] N Kanwisher and E Wojciulik. Visual attention: Insights from brain imaging. Nature Reviews Neuroscience, 1:91–100, 2000. [12] C. H. Anderson and D. C. Van Essen. Shifter circuits: A computational strategy for dynamic aspects of visual processing. National Academy of Sciences, 84:6297–6301, 1987. [13] B. A. Olshausen, C. H. Anderson, and D. C. Van Essen. A neurobiological model of visual attention and invariant pattern recognition based on dynamic routing of information. The Journal of neuroscience : the official journal of the Society for Neuroscience, 13(11):4700–4719, 1993. [14] Laurenz Wiskott. How does our visual system achieve shift and size invariance?, 2004. [15] S. Chikkerur, T. Serre, C. Tan, and T. Poggio. What and where: a Bayesian inference theory of attention. Vision Research, 50(22):2233–2247, October 2010. [16] J. K. Tsotsos, S. M. Culhane, W. Y. K. Wai, Y. H. Lai, N. Davis, and F. Nuflo. Modeling visual-attention via selective tuning. Artificial Intelligence, 78(1-2):507–545, October 1995. [17] Hugo Larochelle and Geoffrey E. Hinton. Learning to combine foveal glimpses with a third-order boltzmann machine. In NIPS, pages 1243–1251. Curran Associates, Inc., 2010. [18] D. P. Reichert, P. Seriès, and A. J. Storkey. A hierarchical generative model of recurrent object-based attention in the visual cortex. In ICANN (1), volume 6791, pages 18–25. Springer, 2011. [19] B. Alexe, N. Heess, Y. W. Teh, and V. Ferrari. Searching for objects driven by context. In NIPS 2012, December 2012. [20] Marc’Aurelio Ranzato. On learning where to look. arXiv, arXiv:1405.5488, 2014. [21] M. Denil, L. Bazzani, H. Larochelle, and N. de Freitas. Learning where to attend with deep architectures for image tracking. Neural Computation, 28:2151–2184, 2012. [22] G. E. Hinton and R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313:504–507, 2006. [23] A. Krizhevsky. Learning multiple layers of features from tiny images, 2009. [24] Graham W. Taylor, Rob Fergus, Yann LeCun, and Christoph Bregler. Convolutional learning of spatiotemporal features. In ECCV 2010. Springer, 2010. [25] A. Mohamed, G. Dahl, and G. Hinton. Acoustic modeling using deep belief networks. IEEE Transactions on Audio, Speech, and Language Processing, 2011. [26] Richard Szeliski. Computer Vision - Algorithms and Applications. Texts in Computer Science. Springer, 2011. [27] S. Duane, A. D. Kennedy, B. J Pendleton, and D. Roweth. Hybrid Monte Carlo. Physics Letters B, 195(2):216–222, 1987. [28] R. M. Neal. MCMC using Hamiltonian dynamics. in Handbook of Markov Chain Monte Carlo (eds S. Brooks, A. Gelman, G. Jones, XL Meng). Chapman and Hall/CRC Press, 2010. [29] Simon Baker and Iain Matthews. Lucas-kanade 20 years on: A unifying framework. International Journal of Computer Vision, 56:221–255, 2002. [30] Ralph Gross, Iain Matthews, Jeffrey F. Cohn, Takeo Kanade, and Simon Baker. Multi-pie. Image Vision Comput., 28(5):807–813, 2010. [31] J. P. Lewis. Fast normalized cross-correlation, 1995. [32] T. Tieleman and G. E. Hinton. Using fast weights to improve persistent contrastive divergence. In ICML, volume 382, page 130. ACM, 2009. [33] R. Salakhutdinov and I. Murray. On the quantitative analysis of deep belief networks. In Proceedings of the Intl. Conf. on Machine Learning, volume 25, 2008. 9
2014
318
5,423
Bandit Convex Optimization: Towards Tight Bounds Elad Hazan Technion—Israel Institute of Technology Haifa 32000, Israel ehazan@ie.technion.ac.il Kfir Y. Levy Technion—Israel Institute of Technology Haifa 32000, Israel kfiryl@tx.technion.ac.il Abstract Bandit Convex Optimization (BCO) is a fundamental framework for decision making under uncertainty, which generalizes many problems from the realm of online and statistical learning. While the special case of linear cost functions is well understood, a gap on the attainable regret for BCO with nonlinear losses remains an important open question. In this paper we take a step towards understanding the best attainable regret bounds for BCO: we give an efficient and near-optimal regret algorithm for BCO with strongly-convex and smooth loss functions. In contrast to previous works on BCO that use time invariant exploration schemes, our method employs an exploration scheme that shrinks with time. 1 Introduction The power of Online Convex Optimization (OCO) framework is in its ability to generalize many problems from the realm of online and statistical learning, and supply universal tools to solving them. Extensive investigation throughout the last decade has yield efficient algorithms with worst case guarantees. This has lead many practitioners to embrace the OCO framework in modeling and solving real world problems. One of the greatest challenges in OCO is finding tight bounds to the problem of Bandit Convex Optimization (BCO). In this “bandit” setting the learner observes the loss function only at the point that she has chosen. Hence, the learner has to balance between exploiting the information she has gathered and between exploring the new data. The seminal work of [5] elegantly resolves this “exploration-exploitation” dilemma by devising a combined explore-exploit gradient descent algorithm. They obtain a bound of O(T 3/4) on the expected regret for the general case of an adversary playing bounded and Lipschitz-continuous convex losses. In this paper we investigate the BCO setting assuming that the adversary is limited to inflicting strongly-convex and smooth losses and the player may choose points from a constrained decision set. In this setting we devise an efficient algorithm that achieves a regret of ˜O( √ T). This rate is the best possible up to logarithmic factors as implied by a recent work of [11], cleverly obtaining a lower bound of Ω( √ T) for the same setting. During our analysis, we develop a full-information algorithm that takes advantage of the strongconvexity of loss functions and uses a self-concordant barrier as a regularization term. This algorithm enables us to perform “shrinking exploration” which is a key ingredient in our BCO algorithm. Conversely, all previous works on BCO use a time invariant exploration scheme. This paper is organized as follows. In Section 2 we introduce our setting and review necessary preliminaries regarding self-concordant barriers. In Section 3 we discuss schemes to perform single1 Setting Convex Linear Smooth Str.-Convex Str.-Convex & Smooth Full-Info. Θ( √ T) Θ(log T) BCO ˜O(T 3/4) ˜O( √ T) ˜O(T 2/3) ˜O( √ T) [Thm. 10] Ω( √ T) Table 1: Known regret bounds in the Full-Info./ BCO setting. Our new result is highlighted, and improves upon the previous ˜O(T 2/3) bound. point gradient estimations, then we define first-order online methods and analyze the performance of such methods receiving noisy gradient estimates. Our main result is described and analyzed in Section 4; Section 5 concludes. 1.1 Prior work For BCO with general convex loss functions, almost simultaneously to [5], a bound of O(T 3/4) was also obtained by [7] for the setting of Lipschitz-continuous convex losses. Conversely, the best known lower bound for this problem is Ω( √ T) proved for the easier full-information setting. In case the adversary is limited to using linear losses, it can be shown that the player does not “pay” for exploration; this property was used by [4] to devise the Geometric Hedge algorithm that achieves an optimal regret rate of ˜O( √ T). Later [1], inspired by interior point methods, devised the first efficient algorithm that attains the same nearly-optimal regret rate for this setup of bandit linear optimization. For some special classes of nonlinear convex losses, there are several works that lean on ideas from [5] to achieve improved upper bounds for BCO. In the case of convex and smooth losses [9] attained an upper bound of ˜O(T 2/3). The same regret rate of ˜O(T 2/3) was achieved by [2] in the case of strongly-convex losses. For the special case of unconstrained BCO with strongly-convex and smooth losses, [2] obtained a regret of ˜O( √ T). A recent paper by Shamir [11], significantly advanced our understanding of BCO by devising a lower bound of Ω( √ T) for the setting of stronglyconvex and smooth BCO. The latter implies the tightness of our bound. A comprehensive survey by Bubeck and Cesa-Bianchi [3], provides a review of the bandit optimization literature in both stochastic and online setting. 2 Setting and Background Notation: During this paper we denote by || · || the ℓ2 norm when referring to vectors, and use the same notation for the spectral norm when referring to matrices. We denote by Bn and Sn the n-dimensional euclidean unit ball and unit sphere, and by v ∼Bn and u ∼Sn random variables chosen uniformly from these sets. The symbol I is used for the identity matrix (its dimension will be clear from the context). For a positive definite matrix A ≻0 we denote by A1/2 the matrix B such that B⊤B = A, and by A−1/2 the inverse of B. Finally, we denote [N] := {1, . . . , N}. 2.1 Bandit Convex Optimization We consider a repeated game of T rounds between a player and an adversary, at each round t ∈ [T] 1. player chooses a point xt ∈K. 2. adversary independently chooses a loss function ft ∈F. 3. player suffers a loss ft(xt) and receives a feedback Ft. 2 In the OCO (Online Convex Optimization) framework we assume that the decision set K is convex and that all functions in F are convex. Our paper focuses on adversaries limited to choosing functions from the set Fσ,β; the set off all σ-strongly-convex and β-smooth functions. We also limit ourselves to oblivious adversaries where the loss sequence {ft}T t=1 is predetermined and is therefore independent of the player’s choices. Mind that in this case the best point in hindsight is also independent of the player’s choices. We also assume that the loss functions are defined over the entire space Rn and are strongly-convex and smooth there; yet the player may only choose points from a constrained set K. Let us define the regret of A, and its regret with respect to a comparator w ∈K: RegretA T = T X t=1 ft(xt) −min w∗∈K T X t=1 ft(w∗), RegretA T (w) = T X t=1 ft(xt) − T X t=1 ft(w) A player aims at minimizing his regret, and we are interested in players that ensure an o(T) regret for any loss sequence that the adversary may choose. The player learns through the feedback Ft received in response to his actions. In the full informations setting, he receives the loss function ft itself as a feedback, usually by means of a gradient oracle i.e. the decision maker has access to the gradient of the loss function at any point in the decision set. Conversely, in the BCO setting the given feedback is ft(xt), i.e., the loss function only at the point that he has chosen; and the player aims at minimizing his expected regret, E  RegretA T  . 2.2 Strong Convexity and Smoothness As mentioned in the last subsection we consider an adversary limited to choosing loss functions from the set Fσ,β, the set of σ-strongly convex and β-smooth functions, here we define these properties. Definition 1. (Strong Convexity) We say that a function f : Rn →R is σ-strongly convex over the set K if for all x, y ∈K it holds that, f(y) ≥f(x) + ∇f(x)⊤(y −x) + σ 2 ||x −y||2 (1) Definition 2. (Smoothness) We say that a convex function f : Rn →R is β-smooth over the set K if the following holds: f(y) ≤f(x) + ∇f(x)⊤(y −x) + β 2 ||x −y||2, ∀x, y ∈K (2) 2.3 Self Concordant Barriers Interior point methods are polynomial time algorithms to solving constrained convex optimization programs. The main tool in these methods is a barrier function that encodes the constrained set and enables the use of a fast unconstrained optimization machinery. More on this subject can be found in [8]. Let K ∈Rn be a convex set with a non empty interior int(K) Definition 3. A function R : int(K) →R is called ν-self-concordant if: 1. R is three times continuously differentiable and convex, and approaches infinity along any sequence of points approaching the boundary of K. 2. For every h ∈Rn and x ∈int(K) the following holds: |∇3R(x)[h, h, h]| ≤2(∇2R(x)[h, h])3/2 and |∇R(x)[h]| ≤ν1/2(∇2R(x)[h, h])1/2 3 here, ∇3R(x)[h, h, h] := ∂3 ∂t1∂t2∂t3 R(x + t1h + t2h + t3h) t1=t2=t3=0. Our algorithm requires a ν-self-concordant barrier over K, and its regret depends on √ν. It is well known that any convex set in Rn admits a ν = O(n) such barrier (ν might be much smaller), and that most interesting convex sets admit a self-concordant barrier that is efficiently represented. The Hessian of a self-concordant barrier induces a local norm at every x ∈int(K), we denote this norm by || · ||x and its dual by || · ||∗ x and define ∀h ∈Rn: ||h||x = q h⊤∇2R(x)h, ||h||∗ x = q h⊤(∇2R(x))−1h we assume that ∇2R(x) always has a full rank. The following fact is a key ingredient in the sampling scheme of BCO algorithms [1, 9]. Let R is be self-concordant barrier and x ∈int(K) then the Dikin Ellipsoide, W1(x) := {y ∈Rn : ||y −x||x ≤1} (3) i.e. the || · ||x-unit ball centered around x, is completely contained in K. Our regret analysis requires a bound on R(y) −R(x); hence, we will find the following lemma useful: Lemma 4. Let R be a ν-self-concordant function over K, then: R(y) −R(x) ≤ν log 1 1 −πx(y), ∀x, y ∈int(K) where πx(y) = inf{t ≥0 : x + t−1(y −x) ∈K}, ∀x, y ∈int(K) Note that πx(y) is called the Minkowsky function and it is always in [0, 1]. Moreover, as y approaches the boundary of K then πx(y) →1. 3 Single Point Gradient Estimation and Noisy First-Order Methods 3.1 Single Point Gradient Estimation A main component of BCO algorithms is a randomized sampling scheme for constructing gradient estimates. Here, we survey the previous schemes as well as the more general scheme that we use. Spherical estimators: Flaxman et al. [5] introduced a method that produces single point gradient estimates through spherical sampling. These estimates are then inserted into a full-information procedure that chooses the next decision point for the player. Interestingly, these gradient estimates are unbiased predictions for the gradients of a smoothed version function which we next define. Let δ > 0 and v ∼Bn, the smoothed version of a function f : Rn →R is defined as follows: ˆf(x) = E[f(x + δv)] (4) The next lemma of [5] ties between the gradients of ˆf and an estimate based on samples of f: Lemma 5. Let u ∼Sn, and consider the smoothed version ˆf defined in Equation (4), then the following applies: ∇ˆf(x) = E[n δ f(x + δu)u] (5) Therefore, n δ f(x + δu)u is an unbiased estimator for the gradients of the smoothed version. 4 K x (a) Eigenpoles Sampling K x (b) Continuous Sampling K x t (c) Shrinking Sampling Figure 1: Dikin Ellipsoide Sampling Schemes Ellipsoidal estimators: Abernethy et al. [1] introduced the idea of sampling from an ellipsoid (specifically the Dikin ellipsoid) rather than a sphere in the context of BCO. They restricted the sampling to the eigenpoles of the ellipsoid (Fig. 1a). A more general method of sampling continuously from an ellipsoid was introduced in [9] (Fig. 1b). We shall see later that our algorithm uses a “shrinking-sampling” scheme (Fig. 1c), which is crucial in achieving the ˜O( √ T) regret bound. The following lemma of [9] shows that we can sample f non uniformly over all directions and create an unbiased gradient estimate of a respective smoothed version: Corollary 6. Let f : Rn →R be a continuous function, let A ∈Rn×n be invertible, and v ∼Bn, u ∼Sn. Define the smoothed version of f with respect to A: ˆf(x) = E[f(x + Av)] (6) Then the following holds: ∇ˆf(x) = E[nf(x + Au)A−1u] (7) Note that if A ≻0 then {Au : u ∈Sn} is an ellipsoid’s boundary. Our next lemma shows that the smoothed version preserves the strong-convexity of f, and that we can measure the distance between ˆf and f using the spectral norm of A2: Lemma 7. Consider a function f : Rn →R, and a positive definite matrix A ∈Rn×n. Let ˆf be the smoothed version of f with respect to A as defined in Equation (6). Then the following holds: • If f is σ-strongly convex then so is ˆf. • If f is convex and β-smooth, and λmax be the largest eigenvalue of A then: 0 ≤ˆf(x) −f(x) ≤β 2 ||A2||2 = β 2 λ2 max (8) Remark: Lemma 7 also holds if we define the smoothed version of f as ˆf(x) = Eu∼Sn[f(x+Au)] i.e. an average of the original function values over the unit sphere rather than the unit ball as defined in Equation (6). Proof is similar to the one of Lemma 7. 3.2 Noisy First-Order Methods Our algorithm utilizes a full-information online algorithm, but instead of providing this method with exact gradient values we insert noisy estimates of the gradients. In what follows we define first-order online algorithms, and present a lemma that analyses the regret of such algorithm receiving noisy gradients. 5 Definition 8. (First-Order Online Algorithm) Let A be an OCO algorithm receiving an arbitrary sequence of differential convex loss functions f1, . . . , fT , and providing points x1 ←A and xt ← A(f1, . . . , ft−1). Given that A requires all loss functions to belong to some set F0. Then A is called first-order online algorithm if the following holds: • Adding a linear function to a member of F0 remains in F0; i.e., for every f ∈F0 and a ∈Rn then also f + a⊤x ∈F0 • The algorithm’s choices depend only on its gradient values taken in the past choices of A, i.e. : A(f1, . . . , ft−1) = A(∇f1(x1), . . . , ∇ft−1(xt−1)), ∀t ∈[T] The following is a generalization of Lemma 3.1 from [5]: Lemma 9. Let w be a fixed point in K. Let A be a first-order online algorithm receiving a sequence of differential convex loss functions f1, . . . , fT : K →R (ft+1 possibly depending on z1, . . . zt). Where z1 . . . zT are defined as follows: z1 ←A, zt ←A(g1, . . . , gt−1) where gt’s are vector valued random variables such that: E[gt z1, f1, . . . , zt, ft] = ∇ft(zt) Then if A ensures a regret bound of the form: RegretA T ≤BA(∇f1(x1), . . . , ∇fT (xT )) in the full information case then, in the case of noisy gradients it ensures the following bound: E[ T X t=1 ft(zt)] − T X t=1 ft(w) ≤E[BA(g1, . . . , gT )] 4 Main Result and Analysis Following is the main theorem of this paper: Theorem 10. Let K be a convex set with diameter DK and R be a ν-self-concordant barrier over K. Then in the BCO setting where the adversary is limited to choosing β-smooth and σ-stronglyconvex functions and |ft(x)| ≤L, ∀x ∈K, then the expected regret of Algorithm 1 with η = q (ν+2β/σ) log T 2n2L2T is upper bounded as E[RegretT ] ≤4nL s ν + 2β σ  T log T + 2L + βD2 K 2 = O r βν σ T log T ! whenever T/ log T ≥2 (ν + 2β/σ). Algorithm 1 BCO Algorithm for Str.-convex & Smooth losses Input: η > 0, σ > 0, ν-self-concordant barrier R Choose x1 = arg minx∈K R(x) for t = 1, 2 . . . T do Define Bt = ∇2R(xt) + ησtI −1/2 Draw u ∼Sn Play yt = xt + Btu Observe ft(xt + Btu) and define gt = nft(xt + Btu)B−1 t u Update xt+1 = arg minx∈K Pt τ=1  g⊤ τ x + σ 2 ||x −xτ||2 + η−1R(x) end for Algorithm 1 shrinks the exploration magnitude with time (Fig. 1c); this is enabled thanks to the strong-convexity of the losses. It also updates according to a full-information first-order algorithm 6 denoted FTARL-σ, which is defined below. This algorithm is a variant of the FTRL methodology as defined in [6, 10]. Algorithm 2 FTARL-σ Input: η > 0, ν-self concordant barrier R Choose x1 = arg minx∈K R(x) for t = 1, 2 . . . T do Receive ∇ht(xt) Output xt+1 = arg minx∈K Pt τ=1  ∇hτ(xτ)⊤x + σ 2 ||x −xτ||2 + η−1R(x) end for Next we give a proof sketch of Theorem 10 Proof sketch of Therorem 10. Let us decompose the expected regret of Algorithm 1 with respect to w ∈K: E [RegretT (w)] := PT t=1 E [ft(yt) −ft(w)] = PT t=1 E [ft(yt) −ft(xt)] (9) + PT t=1 E h ft(xt) −ˆft(xt) i (10) −PT t=1 E h ft(w) −ˆft(w) i (11) + PT t=1 E h ˆft(xt) −ˆft(w) i (12) where expectation is taken with respect to the player’s choices, and ˆft is defined as ˆft(x) = E[ft(x + Btv)], ∀x ∈K here v ∼Bn and the smoothing matrix Bt is defined in Algorithm 1. The sampling scheme used by Algorithm 1 yields an unbiased gradient estimate gt of the smoothed version ˆft, which is then inserted to FTARL-σ (Algorithm 2). We can therefore interpret Algorithm 1 as performing noisy first-order method (FTARL-σ) over the smoothed versions. The xt’s in Algorithm 1 are the outputs of FTARL-σ, thus the term in Equation (12) is associated with “exploitation”. The other terms in Equations (9)-(11) measure the cost of sampling away from xt, and the distance between the smoothed version and the original function, hence these term are associated with “exploration”. In what follows we analyze these terms separately and show that Algorithm 1 achieves ˜O( √ T) regret. The Exploration Terms: The next hold by the remark that follows Lemma 7 and by the lemma itself: E[ft(yt) −ft(xt)] = E  Eu[ft(xt + Btu)] −ft(xt) xt]  ≤0.5βE  ||B2 t ||2  ≤β/2ησt (13) −E[ft(w) −ˆft(w)] = E h E[ ˆft(w) −ft(w) xt] i ≤0.5βE  ||B2 t ||2  ≤β/2ησt (14) E[ft(xt) −ˆft(xt)] = E h E[ft(xt) −ˆft(xt) xt] i ≤0 (15) where ||B2 t ||2 ≤1/ησt follows by the definition of Bt and by the fact that ∇2R(xt) is positive definite. 7 The Exploitation Term: The next Lemma bounds the regret of FTARL-σ in the full-information setting: Lemma 11. Let R be a self-concordant barrier over a convex set K, and η > 0. Consider an online player receiving σ-strongly-convex loss functions h1, . . . , hT and choosing points according to FTARL-σ (Algorithm 2), and η||∇ht(xt)||∗ t ≤1/2, ∀t ∈[T]. Then the player’s regret is upper bounded as follows: T X t=1 ht(xt) − T X t=1 ht(w) ≤2η T X t=1 (||∇ht(xt)||∗ t )2 + η−1R(w), ∀z ∈K here (||a||∗ t )2 = aT (∇2R(xt) + ησtI)−1a Note that Algorithm 1 uses the estimates gt as inputs into FTARL-σ. Using Corollary 6 we can show that the gt’s are unbiased estimates for the gradients of the smoothed versions ˆft’s. Using the regret bound of the above lemma, and the unbiasedness of the gt’s, Lemma 9 ensures us: T X t=1 E h ˆft(xt) −ˆft(w) i ≤2η T X t=1 E[(||gt||∗ t )2] + η−1R(w) (16) By the definitions of gt and Bt, and recalling |ft(x)| ≤L, ∀x ∈K, we can bound: E[(||gt||∗ t )2 xt] = E h n2 (ft(xt + Btu))2 u⊤B−1 t ∇2R(xt) + ησtI −1 B−1 t u xt i ≤(nL)2 Concluding: Plugging the latter into Equation (16) and combining Equations (9)-(16) we get: E[RegretT (w)] ≤2η(nL)2T + η−1 R(w) + 2βσ−1 log T  (17) Recall that x1 = arg minx∈K R(x) and assume w.l.o.g. that R(x1) = 0 (we can always add R a constant). Thus, for a point w ∈K such that πx1(w) ≤1 −T −1 Lemma 4 ensures us that R(w) ≤ν log T. Combining the latter with Equation (17) and the choice of η in Theorem 10 assures an expected regret bounded by 4nL p (ν + 2βσ−1) T log T. For w ∈K such that πx1(w) > 1−T −1 we can always find w′ ∈K such that ||w −w′|| ≤O(T −1) and πx1(w′) ≤1 −T −1, using the Lipschitzness of the ft’s, Theorem 10 holds. Correctness: Note that Algorithm 1 chooses points from the set {xt + ∇2R(xt) + ησtI −1/2 u, u ∈Sn} which is inside the Dikin ellipsoid and therefore belongs to K (the Dikin Eliipsoid is always in K). 5 Summary and open questions We have presented an efficient algorithm that attains near optimal regret for the setting of BCO with strongly-convex and smooth losses, advancing our understanding of optimal regret rates for bandit learning. Perhaps the most important question in bandit learning remains the resolution of the attainable regret bounds for smooth but non-strongly-convex, or vice versa, and generally convex cost functions (see Table 1). Ideally, this should be accompanied by an efficient algorithm, although understanding the optimal rates up to polylogarithmic factors would be a significant advancement by itself. Acknowledgements The research leading to these results has received funding from the European Union’s Seventh Framework Programme (FP7/2007-2013) under grant agreement n◦336078 – ERCSUBLRN. 8 References [1] Jacob Abernethy, Elad Hazan, and Alexander Rakhlin. Competing in the dark: An efficient algorithm for bandit linear optimization. In COLT, pages 263–274, 2008. [2] Alekh Agarwal, Ofer Dekel, and Lin Xiao. Optimal algorithms for online convex optimization with multi-point bandit feedback. In COLT, pages 28–40, 2010. [3] S´ebastien Bubeck and Nicolo Cesa-Bianchi. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning, 5(1):1–122, 2012. [4] Varsha Dani, Thomas P. Hayes, and Sham Kakade. The price of bandit information for online optimization. In NIPS, 2007. [5] Abraham Flaxman, Adam Tauman Kalai, and H. Brendan McMahan. Online convex optimization in the bandit setting: gradient descent without a gradient. In SODA, pages 385–394, 2005. [6] Elad Hazan. A survey: The convex optimization approach to regret minimization. In Suvrit Sra, Sebastian Nowozin, and Stephen J. Wright, editors, Optimization for Machine Learning, pages 287–302. MIT Press, 2011. [7] Robert D Kleinberg. Nearly tight bounds for the continuum-armed bandit problem. In NIPS, volume 17, pages 697–704, 2004. [8] Arkadii Nemirovskii. Interior point polynomial time methods in convex programming. Lecture Notes, 2004. [9] Ankan Saha and Ambuj Tewari. Improved regret guarantees for online smooth convex optimization with bandit feedback. In AISTATS, pages 636–642, 2011. [10] Shai Shalev-Shwartz. Online learning and online convex optimization. Foundations and Trends in Machine Learning, 4(2):107–194, 2011. [11] Ohad Shamir. On the complexity of bandit and derivative-free stochastic convex optimization. In Conference on Learning Theory, pages 3–24, 2013. 9
2014
319
5,424
Active Learning and Best-Response Dynamics Maria-Florina Balcan Carnegie Mellon ninamf@cs.cmu.edu Christopher Berlind Georgia Tech cberlind@gatech.edu Avrim Blum Carnegie Mellon avrim@cs.cmu.edu Emma Cohen Georgia Tech ecohen@gatech.edu Kaushik Patnaik Georgia Tech kpatnaik3@gatech.edu Le Song Georgia Tech lsong@cc.gatech.edu Abstract We examine an important setting for engineered systems in which low-power distributed sensors are each making highly noisy measurements of some unknown target function. A center wants to accurately learn this function by querying a small number of sensors, which ordinarily would be impossible due to the high noise rate. The question we address is whether local communication among sensors, together with natural best-response dynamics in an appropriately-defined game, can denoise the system without destroying the true signal and allow the center to succeed from only a small number of active queries. By using techniques from game theory and empirical processes, we prove positive (and negative) results on the denoising power of several natural dynamics. We then show experimentally that when combined with recent agnostic active learning algorithms, this process can achieve low error from very few queries, performing substantially better than active or passive learning without these denoising dynamics as well as passive learning with denoising. 1 Introduction Active learning has been the subject of significant theoretical and experimental study in machine learning, due to its potential to greatly reduce the amount of labeling effort needed to learn a given target function. However, to date, such work has focused only on the single-agent low-noise setting, with a learning algorithm obtaining labels from a single, nearly-perfect labeling entity. In large part this is because the effectiveness of active learning is known to quickly degrade as noise rates become high [5]. In this work, we introduce and analyze a novel setting where label information is held by highly-noisy low-power agents (such as sensors or micro-robots). We show how by first using simple game-theoretic dynamics among the agents we can quickly approximately denoise the system. This allows us to exploit the power of active learning (especially, recent advances in agnostic active learning), leading to efficient learning from only a small number of expensive queries. We specifically examine an important setting relevant to many engineered systems where we have a large number of low-power agents (e.g., sensors). These agents are each measuring some quantity, such as whether there is a high or low concentration of a dangerous chemical at their location, but they are assumed to be highly noisy. We also have a center, far away from the region being monitored, which has the ability to query these agents to determine their state. Viewing the agents as examples, and their states as noisy labels, the goal of the center is to learn a good approximation to the true target function (e.g., the true boundary of the high-concentration region for the chemical being monitored) from a small number of label queries. However, because of the high noise rate, learning this function directly would require a very large number of queries to be made (for noise rate η, one would necessarily require Ω( 1 (1/2−η)2 ) queries [4]). The question we address in this 1 paper is to what extent this difficulty can be alleviated by providing the agents the ability to engage in a small amount of local communication among themselves. What we show is that by using local communication and applying simple robust state-changing rules such as following natural game-theoretic dynamics, randomly distributed agents can modify their state in a way that greatly de-noises the system without destroying the true target boundary. This then nicely meshes with recent advances in agnostic active learning [1], allowing for the center to learn a good approximation to the target function from a small number of queries to the agents. In particular, in addition to proving theoretical guarantees on the denoising power of game-theoretic agent dynamics, we also show experimentally that a version of the agnostic active learning algorithm of [1], when combined with these dynamics, indeed is able to achieve low error from a small number of queries, outperforming active and passive learning algorithms without the best-response denoising step, as well as outperforming passive learning algorithms with denoising. More broadly, engineered systems such as sensor networks are especially well-suited to active learning because components may be able to communicate among themselves to reduce noise, and the designer has some control over how they are distributed and so assumptions such as a uniform or other “nice” distribution on data are reasonable. We focus in this work primarily on the natural case of linear separator decision boundaries but many of our results extend directly to more general decision boundaries as well. 1.1 Related Work There has been significant work in active learning (e.g., see [11, 15]) including active learning in the presence of noise [9, 4, 1], yet it is known active learning can provide significant benefits in low noise scenarios only [5]. There has also been extensive work analyzing the performance of simple dynamics in consensus games [6, 8, 14, 13, 3, 2]. However this work has focused on getting to some equilibria or states of low social cost, while we are primarily interested in getting near a specific desired configuration, which as we show below is an approximate equilibrium. 2 Setup We assume we have a large number N of agents (e.g., sensors) distributed uniformly at random in a geometric region, which for concreteness we consider to be the unit ball in Rd. There is an unknown linear separator such that in the initial state, each sensor on the positive side of this separator is positive independently with probability ≥1−η, and each on the negative side is negative independently with probability ≥1 −η. The quantity η < 1/2 is the noise rate. 2.1 The basic sensor consensus game The sensors will denoise themselves by viewing themselves as players in a certain consensus game, and performing a simple dynamics in this game leading towards a specific ϵ-equilibrium. Specifically, the game is defined as follows, and is parameterized by a communication radius r, which should be thought of as small. Consider a graph where the sensors are vertices, and any two sensors within distance r are connected by an edge. Each sensor is in one of two states, positive or negative. The payoff a sensor receives is its correlation with its neighbors: the fraction of neighbors in the same state as it minus the fraction in the opposite state. So, if a sensor is in the same state as all its neighbors then its payoff is 1, if it is in the opposite state of all its neighbors then its payoff is −1, and if sensors are in uniformly random states then the expected payoff is 0. Note that the states of highest social welfare (highest sum of utilities) are the all-positive and all-negative states, which are not what we are looking for. Instead, we want sensors to approach a different near-equilibrium state in which (most of) those on the positive side of the target separator are positive and (most of) those on the negative side of the target separator are negative. For this reason, we need to be particularly careful with the specific dynamics followed by the sensors. We begin with a simple lemma that for sufficiently large N, the target function (i.e., all sensors on the positive side of the target separator in the positive state and the rest in the negative state) is an ϵ-equilibrium, in that no sensor has more than ϵ incentive to deviate. Lemma 1 For any ϵ, δ > 0, for sufficiently large N, with probability 1 −δ the target function is an ϵ-equilibrium. PROOF SKETCH: The target function fails to be an ϵ-equilibrium iff there exists a sensor for which more than an ϵ/2 fraction of its neighbors lie on the opposite side of the separator. Fix one sensor 2 x and consider the probability this occurs to x, over the random placement of the N −1 other sensors. Since the probability mass of the r-ball around x is at least (r/2)d (see discussion in proof of Theorem 2), so long as N −1 ≥(2/r)d · max[8, 4 ϵ2 ] ln( 2N δ ), with probability 1 − δ 2N , point x will have mx ≥ 2 ϵ2 ln( 2N δ ) neighbors (by Chernoff bounds), each of which is at least as likely to be on x’s side of the target as on the other side. Thus, by Hoeffding bounds, the probability that more than a 1 2 + ϵ 2 fraction lie on the wrong side is at most δ 2N + δ 2N = δ N . The result then follows by union bound over all N sensors. For a bit tighter argument and a concrete bound on N, see the proof of Theorem 2 which essentially has this as a special case. Lemma 1 motivates the use of best-response dynamics for denoising. Specifically, we consider a dynamics in which each sensor switches to the majority vote of all the other sensors in its neighborhood. We analyze below the denoising power of this dynamics under both synchronous and asynchronous update models. In supplementary material, we also consider more robust (though less practical) dynamics in which sensors perform more involved computations over their neighborhoods. 3 Analysis of the denoising dynamics 3.1 Simultaneous-move dynamics We start by providing a positive theoretical guarantee for one-round simultaneous move dynamics. We will use the following standard concentration bound: Theorem 1 (Bernstein, 1924) Let X = PN i=1 Xi be a sum of independent random variables such that |Xi −E[Xi]| ≤M for all i. Then for any t > 0, P[X −E[X] > t] ≤exp  −t2 2(Var[X]+Mt/3)  . Theorem 2 If N ≥ 2 (r/2)d( 1 2 −η)2 ln  1 (r/2)d( 1 2 −η)2δ  + 1 then, with probability ≥1 −δ, after one synchronous consensus update every sensor at distance ≥r from the separator has the correct label. Note that since a band of width 2r about a linear separator has probability mass O(r √ d), Theorem 2 implies that with high probability one synchronous update denoises all but an O(r √ d) fraction of the sensors. In fact, Theorem 2 does not require the separator to be linear, and so this conclusion applies to any decision boundary with similar surface area, such as an intersection of a constant number of halfspaces or a decision surface of bounded curvature. Proof (Theorem 2): Fix a point x in the sample at distance ≥r from the separator and consider the ball of radius r centered at x. Let n+ be the number of correctly labeled points within the ball and n−be the number of incorrectly labeled points within the ball. Now consider the random variable ∆= n−−n+. Denoising x can give it the incorrect label only if ∆≥0, so we would like to bound the probability that this happens. We can express ∆as the sum of N −1 independent random variables ∆i taking on value 0 for points outside the ball around x, 1 for incorrectly labeled points inside the ball, or −1 for correct labels inside the ball. Let V be the measure of the ball centered at x (which may be less than rd if x is near the boundary of the unit ball). Then since the ball lies entirely on one side of the separator we have E[∆i] = (1 −V ) · 0 + V η −V (1 −η) = −V (1 −2η). Since |∆i| ≤1 we can take M = 2 in Bernstein’s theorem. We can also calculate that Var[∆i] ≤ E[∆2 i ] = V . Thus the probability that the point x is updated incorrectly is P "N−1 X i=1 ∆i ≥0 # = P "N−1 X i=1 ∆i −E h N−1 X i=1 ∆i i ≥(N −1)V (1 −2η) # ≤exp −(N −1)2V 2(1 −2η)2 2 (N −1)V + 2(N −1)V (1 −2η)/3  ! ≤exp −(N −1)V (1 −2η)2 2 + 4(1 −2η)/3  ≤exp −(N −1)V ( 1 2 −η)2 ≤exp −(N −1)(r/2)d( 1 2 −η)2 , 3 where in the last step we lower bound the measure V of the ball around r by the measure of the sphere of radius r/2 inscribed in its intersection with the unit ball. Taking a union bound over all N points, it suffices to have e−(N−1)(r/2)d( 1 2 −η)2 ≤δ/N, or equivalently N −1 ≥ 1 (r/2)d( 1 2 −η)2  ln N + ln 1 δ  . Using the fact that ln x ≤αx −ln α −1 for all x, α > 0 yields the claimed bound on N. We can now combine this result with the efficient agnostic active learning algorithm of [1]. In particular, applying the most recent analysis of [10, 16] of the algorithm of [1], we get the following bound on the number of queries needed to efficiently learn to accuracy 1 −ϵ with probability 1 −δ. Corollary 1 There exists constant c1 > 0 such that for r ≤ϵ/(c1 √ d), and N satisfying the bound of Theorem 2, if sensors are each initially in agreement with the target linear separator independently with probability at least 1−η, then one round of best-response dynamics is sufficient such that the agnostic active learning algorithm of [1] will efficiently learn to error ϵ using only O(d log 1/ϵ) queries to sensors. In Section 5 we implement this algorithm and show that experimentally it learns a low-error decision rule even in cases where the initial value of η is quite high. 3.2 A negative result for arbitrary-order asynchronous dynamics We contrast the above positive result with a negative result for arbitrary-order asynchronous moves. In particular, we show that for any d ≥1, for sufficiently large N, with high probability there exists an update order that will cause all sensors to become negative. Theorem 3 For some absolute constant c > 0, if r ≤1/2 and sensors begin with noise rate η, and N ≥ 16 (cr)dφ2  ln 8 (cr)dφ2 + ln 1 δ  , where φ = φ(η) = min(η, 1 2 −η), then with probability at least 1 −δ there exists an ordering of the agents so that asynchronous updates in this order cause all points to have the same label. PROOF SKETCH: Consider the case d = 1 and a target function x > 0. Each subinterval of [−1, 1] of width r has probability mass r/2, and let m = rN/2 be the expected number of points within such an interval. The given value of N is sufficiently large that with high probability, all such intervals in the initial state have both a positive count and a negative count that are within ± φ 4 m of their expectations. This implies that if sensors update left-to-right, initially all sensors will (correctly) flip to negative, because their neighborhoods have more negative points than positive points. But then when the “wave” of sensors reaches the positive region, they will continue (incorrectly) flipping to negative because the at least m(1 −φ 2 ) negative points in the left-half of their neighborhood will outweigh the at most (1 −η + φ 4 )m positive points in the right-half of their neighborhood. For a detailed proof and the case of general d > 1, see supplementary material. 3.3 Random order dynamics While Theorem 3 shows that there exist bad orderings for asynchronous dynamics, we now show that we can get positive theoretical guarantees for random order best-response dynamics. The high level idea of the analysis is to partition the sensors into three sets: those that are within distance r of the target separator, those at distance between r and 2r from the target separator, and then all the rest. For those at distance < r from the separator we will make no guarantees: they might update incorrectly when it is their turn to move due to their neighbors on the other side of the target. Those at distance between r and 2r from the separator might also update incorrectly (due to “corruption” from neighbors at distance < r from the separator that had earlier updated incorrectly) but we will show that with high probability this only happens in the last 1/4 of the ordering. I.e., within the first 3N/4 updates, with high probability there are no incorrect updates by sensors at distance between r and 2r from the target. Finally, we show that with high probability, those at 4 distance greater than 2r never update incorrectly. This last part of the argument follows from two facts: (1) with high probability all such points begin with more correctly-labeled neighbors than incorrectly-labeled neighbors (so they will update correctly so long as no neighbors have previously updated incorrectly), and (2) after 3N/4 total updates have been made, with high probability more than half of the neighbors of each such point have already (correctly) updated, and so those points will now update correctly no matter what their remaining neighbors do. Our argument for the sensors at distance in [r, 2r] requires r to be small compared to ( 1 2 −η)/ √ d, and the final error is O(r √ d), so the conclusion is we have a total error less than ϵ for r < c min[ 1 2 −η, ϵ]/ √ d for some absolute constant c. We begin with a key lemma. For any given sensor, define its inside-neighbors to be its neighbors in the direction of the target separator and its outside-neighbors to be its neighbors away from the target separator. Also, let γ = 1/2 −η. Lemma 2 For any c1, c2 > 0 there exist c3, c4 > 0 such that for r ≤ γ c3 √ d and N ≥ c4 (r/2)dγ2 ln( 1 rdγδ), with probability 1−δ, each sensor x at distance between r and 2r from the target separator has mx ≥c1 γ2 ln(4N/δ) neighbors, and furthermore the number of inside-neighbors of x that move before x is within ± γ c2 mx of the number of outside neighbors of x that move before x. Proof: First, the guarantee on mx follows immediately from the fact that the probability mass of the ball around each sensor x is at least (r/2)d, so for appropriate c4 the expected value of mx is at least max[8, 2c1 γ2 ] ln(4N/δ), and then applying Hoeffding bounds [12, 7] and the union bound. Now, fix some sensor x and let us first assume the ball of radius r about x does not cross the unit sphere. Because this is random-order dynamics, if x is the kth sensor to move within its neighborhood, the k −1 sensors that move earlier are each equally likely to be an inside-neighbor or an outsideneighbor. So the question reduces to: if we flip k−1 ≤mx fair coins, what is the probability that the number of heads differs from the number of tails by more than γ c2 mx. For mx ≥2( c2 γ )2 ln(4N/δ), this is at most δ/(2N) by Hoeffding bounds. Now, if the ball of radius r about x does cross the unit sphere, then a random neighbor is slightly more likely to be an inside-neighbor than an outsideneighbor. However, because x has distance at most 2r from the target separator, this difference in probabilities is only O(r √ d), which is at most γ 2c2 for appropriate choice of constant c3.1 So, the result follows by applying Hoeffding bounds to the γ 2c2 gap that remains. Theorem 4 For some absolute constants c3, c4, for r ≤ γ c3 √ d and N ≥ c4 (r/2)dγ2 ln( 1 rdγδ), in random order dynamics, with probability 1 −δ all sensors at distance greater than 2r from the target separator update correctly. PROOF SKETCH: We begin by using Lemma 2 to argue that with high probability, no points at distance between r and 2r from the separator update incorrectly within the first 3N/4 updates (which immediately implies that all points at distance greater than 2r update correctly as well, since by Theorem 2, with high probability they begin with more correctly-labeled neighbors than incorrectlylabeled neighbors and their neighborhood only becomes more favorable). In particular, for any given such point, the concern is that some of its inside-neighbors may have previously updated incorrectly. However, we use two facts: (1) by Lemma 2, we can set c4 so that with high probability the total contribution of neighbors that have already updated is at most γ 8 mx in the incorrect direction (since the outside-neighbors will have updated correctly, by induction), and (2) by standard concentration 1We can analyze the difference in probabilities as follows. First, in the worst case, x is at distance exactly 2r from the separator, and is right on the edge of the unit ball. So we can define our coordinate system to view x as being at location (2r, √ 1 −4r2, 0, . . . , 0). Now, consider adding to x a random offset y in the r-ball. We want to look at the probability that x + y has Euclidean length less than 1 conditioned on the first coordinate of y being negative compared to this probability conditioned on the first coordinate of y being positive. Notice that because the second coordinate of x is nearly 1, if y2 ≤−cr2 for appropriate c then x + y has length less than 1 no matter what the other coordinates of y are (worst-case is if y1 = r but even that adds at most O(r2) to the squared-length). On the other hand, if y2 ≥cr2 then x + y has length greater than 1 also no matter what the other coordinates of y are. So, it is only in between that the value of y1 matters. But notice that the distribution over y2 has maximum density O( √ d/r). So, with probability nearly 1/2, the point is inside the unit ball for sure, with probability nearly 1/2 the point is outside the unit ball for sure, and only with probability O(r2√ d/r) = O(r √ d) does the y1 coordinate make any difference at all. 5 wk bk rk wk+1 + + + − + + + + + − + − − + − − − − + − − Figure 1: The margin-based active learning algorithm after iteration k. The algorithm samples points within margin bk of the current weight vector wk and then minimizes the hinge loss over this sample subject to the constraint that the new weight vector wk+1 is within distance rk from wk. inequalities [12, 7], with high probability at least 1 8mx neighbors of x have not yet updated. These 1 8mx un-updated neighbors together have in expectation a γ 4 mx bias in the correct direction, and so with high probability have greater than a γ 8 mx correct bias for sufficiently large mx (sufficiently large c1 in Lemma 2). So, with high probability this overcomes the at most γ 8 mx incorrect bias of neighbors that have already updated, and so the points will indeed update correctly as desired. Finally, we consider the points of distance ≥2r. Within the first 3 4N updates, with high probability they will all update correctly as argued above. Now consider time 3 4N. For each such point, in expectation 3 4 of its neighbors have already updated, and with high probability, for all such points the fraction of neighbors that have updated is more than half. Since all neighbors have updated correctly so far, this means these points will have more correct neighbors than incorrect neighbors no matter what the remaining neighbors do, and so they will update correctly themselves. 4 Query efficient polynomial time active learning algorithm Recently, Awasthi et al. [1] gave the first polynomial-time active learning algorithm able to learn linear separators to error ϵ over the uniform distribution in the presence of agnostic noise of rate O(ϵ). Moreover, the algorithm does so with optimal query complexity of O(d log 1/ϵ). This algorithm is ideally suited to our setting because (a) the sensors are uniformly distributed, and (b) the result of best response dynamics is noise that is low but potentially highly coupled (hence, fitting the low-noise agnostic model). In our experiments (Section 5) we show that indeed this algorithm when combined with best-response dynamics achieves low error from a small number of queries, outperforming active and passive learning algorithms without the best-response denoising step, as well as outperforming passive learning algorithms with denoising. Here, we briefly describe the algorithm of [1] and the intuition behind it. At high level, the algorithm proceeds through several rounds, in each performing the following operations (see also Figure 1): Instance space localization: Request labels for a random sample of points within a band of width bk = O(2−k) around the boundary of the previous hypothesis wk. Concept space localization: Solve for hypothesis vector wk+1 by minimizing hinge loss subject to the constraint that wk+1 lie within a radius rk from wk; that is, ||wk+1 −wk|| ≤rk. [1, 10, 16] show that by setting the parameters appropriately (in particular, bk = Θ(1/2k) and rk = Θ(1/2k)), the algorithm will achieve error ϵ using only k = O(log 1/ϵ) rounds, with O(d) label requests per round. In particular, a key idea of their analysis is to decompose, in round k, the error of a candidate classifier w as its error outside margin bk of the current separator plus its error inside margin bk, and to prove that for these parameters, a small constant error inside the margin suffices to reduce overall error by a constant factor. A second key part is that by constraining the search for wk+1 to vectors within a ball of radius rk about wk, they show that hinge-loss acts as a sufficiently faithful proxy for 0-1 loss. 6 5 Experiments In our experiments we seek to determine whether our overall algorithm of best-response dynamics combined with active learning is effective at denoising the sensors and learning the target boundary. The experiments were run on synthetic data, and compared active and passive learning (with Support Vector Machines) both pre- and post-denoising. Synthetic data. The N sensor locations were generated from a uniform distribution over the unit ball in R2, and the target boundary was fixed as a randomly chosen linear separator through the origin. To simulate noisy scenarios, we corrupted the true sensor labels using two different methods: 1) flipping the sensor labels with probability η and 2) flipping randomly chosen sensor labels and all their neighbors, to create pockets of noise, with η fraction of total sensors corrupted. Denoising via best-response dynamics. In the denoising phase of the experiments, the sensors applied the basic majority consensus dynamic. That is, each sensor was made to update its label to the majority label of its neighbors within distance r from its location2. We used radius values r ∈{0.025, 0.05, 0.1, 0.2}. Updates of sensor labels were carried out both through simultaneous updates to all the sensors in each iteration (synchronous updates) and updating one randomly chosen sensor in each iteration (asynchronous updates). Learning the target boundary. After denoising the dataset, we employ the agnostic active learning algorithm of Awasthi et al. [1] described in Section 4 to decide which sensors to query and obtain a linear separator. We also extend the algorithm to the case of non-linear boundaries by implementing a kernelized version (see supplementary material for more details). Here we compare the resulting error (as measured against the “true” labels given by the target separator) against that obtained by training a SVM on a randomly selected labeled sample of the sensors of the same size as the number of queries used by the active algorithm. We also compare these post-denoising errors with those of the active algorithm and SVM trained on the sensors before denoising. For the active algorithm, we used parameters asymptotically matching those given in Awasthi et al [1] for a uniform distribution. For SVM, we chose for each experiment the regularization parameter that resulted in the best performance. 5.1 Results Here we report the results for N = 10000 and r = 0.1. Results for experiments with other values of the parameters are included in the supplementary material. Every value reported is an average over 50 independent trials. Denoising effectiveness. Figure 2 (left side) shows, for various initial noise rates, the fraction of sensors with incorrect labels after applying 100 rounds of synchronous denoising updates. In the random noise case, the final noise rate remains very small even for relatively high levels of initial noise. Pockets of noise appear to be more difficult to denoise. In this case, the final noise rate increases with initial noise rate, but is still nearly always smaller than the initial level of noise. Synchronous vs. asynchronous updates. To compare synchronous and asynchronous updates we plot the noise rate as a function of the number of rounds of updates in Figure 2 (right side). As our theory suggests, both simultaneous updates and asynchronous updates can quickly converge to a low level of noise in the random noise setting (in fact, convergence happens quickly nearly every time). Neither update strategy achieves the same level of performance in the case of pockets of noise. Generalization error: pre- vs. post-denoising and active vs. passive. We trained both active and passive learning algorithms on both pre- and post-denoised sensors at various label budgets, and measured the resulting generalization error (determined by the angle between the target and the learned separator). The results of these experiments are shown in Figure 3. Notice that, as expected, denoising helps significantly and on the denoised dataset the active algorithm achieves better generalization error than support vector machines at low label budgets. For example, at a 2We also tested distance-weighted majority and randomized majority dynamics and experimentally observed similar results to those of the basic majority dynamic. 7 0 10 20 30 40 50 Initial Noise(%) 0 5 10 15 20 25 30 35 40 45 Final Noise(%) Random Noise Pockets of Noise 0 1 10 100 1000 Number of Rounds 0 10 20 30 40 50 Final Noise(%) Random Noise - Asynchronous updates Pockets of Noise - Asynchronous updates Random Noise - Synchronous updates Pockets of Noise - Synchronous updates Figure 2: Initial vs. final noise rates for synchronous updates (left) and comparison of synchronous and asynchronous dynamics (right). One synchronous round updates every sensor once simultaneously, while one asynchronous round consists of N random updates. label budget of 30, active learning achieves generalization error approximately 33% lower than the generalization error of SVMs. Similar observations were also obtained upon comparing the kernelized versions of the two algorithms (see supplementary material). 30 40 50 60 70 80 90 100 Label Budget 0.0 0.1 0.2 0.3 0.4 0.5 Generalization Error Pre Denoising - Our Method Pre Denoising - SVM Post Denoising - Our Method Post Denoising - SVM 30 40 50 60 70 80 90 100 Label Budget 0.00 0.05 0.10 0.15 0.20 Generalization Error Pre Denoising - Our Method Pre Denoising - SVM Post Denoising - Our Method Post Denoising - SVM Figure 3: Generalization error of the two learning methods with random noise at rate η = 0.35 (left) and pockets of noise at rate η = 0.15 (right). 6 Discussion We demonstrate through theoretical analysis as well as experiments on synthetic data that local bestresponse dynamics can significantly denoise a highly-noisy sensor network without destroying the underlying signal, allowing for fast learning from a small number of label queries. Our positive theoretical guarantees apply both to synchronous and random-order asynchronous updates, which is borne out in the experiments as well. Our negative result in Section 3.2 for adversarial-order dynamics, in which a left-to-right update order can cause the entire system to switch to a single label, raises the question whether an alternative dynamics could be robust to adversarial update orders. In the supplementary material we present an alternative dynamics that we prove is indeed robust to arbitrary update orders, but this dynamics is less practical because it requires substantially more computational power on the part of the sensors. It is an interesting question whether such general robustness can be achieved by a simple practicall update rule. Another open question is whether an alternative dynamics can achieve better denoising in the region near the decision boundary. Acknowledgments This work was supported in part by NSF grants CCF-0953192, CCF-1101283, CCF-1116892, IIS1065251, IIS1116886, NSF/NIH BIGDATA 1R01GM108341, NSF CAREER IIS1350983, AFOSR grant FA9550-09-1-0538, ONR grant N00014-09-1-0751, and Raytheon Faculty Fellowship. 8 References [1] P. Awasthi, M. F. Balcan, and P. Long. The power of localization for efficiently learning linear separators with noise. In STOC, 2014. [2] M.-F. Balcan, A. Blum, and Y. Mansour. The price of uncertainty. In EC, 2009. [3] M.-F. Balcan, A. Blum, and Y. Mansour. Circumventing the price of anarchy: Leading dynamics to good behavior. SICOMP, 2014. [4] M. F. Balcan and V. Feldman. Statistical active learning algorithms. In NIPS, 2013. [5] A. Beygelzimer, S. Dasgupta, and J. Langford. Importance weighted active learning. In ICML, 2009. [6] L. Blume. The statistical mechanics of strategic interaction. Games and Economic Behavior, 5:387–424, 1993. [7] S. Boucheron, G. Lugosi, and P. Massart. Concentration Inequalities: A Nonasymptotic Theory of Independence. OUP Oxford, 2013. [8] G. Ellison. Learning, local interaction, and coordination. Econometrica, 61:1047–1071, 1993. [9] Daniel Golovin, Andreas Krause, and Debajyoti Ray. Near-optimal bayesian active learning with noisy observations. In NIPS, 2010. [10] S. Hanneke. Personal communication. 2013. [11] S. Hanneke. A statistical theory of active learning. Foundations and Trends in Machine Learning, pages 1–212, 2013. [12] W. Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American Statistical Association, 58(301):13–30, March 1963. [13] D. Kempe, J. Kleinberg, and E. Tardos. Maximizing the spread of influence through a social network. In Proceedings of the Ninth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’03, pages 137–146. ACM, 2003. [14] S. Morris. Contagion. The Review of Economic Studies, 67(1):57–78, 2000. [15] B. Settles. Active Learning. Synthesis Lectures on Artificial Intelligence and Machine Learning. Morgan & Claypool Publishers, 2012. [16] L. Yang. Mathematical Theories of Interaction with Oracles. PhD thesis, CMU Dept. of Machine Learning, 2013. 9
2014
32
5,425
A Latent Source Model for Online Collaborative Filtering Guy Bresler George H. Chen Devavrat Shah Department of Electrical Engineering and Computer Science Massachusetts Institute of Technology Cambridge, MA 02139 {gbresler,georgehc,devavrat}@mit.edu Abstract Despite the prevalence of collaborative filtering in recommendation systems, there has been little theoretical development on why and how well it works, especially in the “online” setting, where items are recommended to users over time. We address this theoretical gap by introducing a model for online recommendation systems, cast item recommendation under the model as a learning problem, and analyze the performance of a cosine-similarity collaborative filtering method. In our model, each of n users either likes or dislikes each of m items. We assume there to be k types of users, and all the users of a given type share a common string of probabilities determining the chance of liking each item. At each time step, we recommend an item to each user, where a key distinction from related bandit literature is that once a user consumes an item (e.g., watches a movie), then that item cannot be recommended to the same user again. The goal is to maximize the number of likable items recommended to users over time. Our main result establishes that after nearly log(km) initial learning time steps, a simple collaborative filtering algorithm achieves essentially optimal performance without knowing k. The algorithm has an exploitation step that uses cosine similarity and two types of exploration steps, one to explore the space of items (standard in the literature) and the other to explore similarity between users (novel to this work). 1 Introduction Recommendation systems have become ubiquitous in our lives, helping us filter the vast expanse of information we encounter into small selections tailored to our personal tastes. Prominent examples include Amazon recommending items to buy, Netflix recommending movies, and LinkedIn recommending jobs. In practice, recommendations are often made via collaborative filtering, which boils down to recommending an item to a user by considering items that other similar or “nearby” users liked. Collaborative filtering has been used extensively for decades now including in the GroupLens news recommendation system [20], Amazon’s item recommendation system [17], the Netflix Prize winning algorithm by BellKor’s Pragmatic Chaos [16, 24, 19], and a recent song recommendation system [1] that won the Million Song Dataset Challenge [6]. Most such systems operate in the “online” setting, where items are constantly recommended to users over time. In many scenarios, it does not make sense to recommend an item that is already consumed. For example, once Alice watches a movie, there’s little point to recommending the same movie to her again, at least not immediately, and one could argue that recommending unwatched movies and already watched movies could be handled as separate cases. Finally, what matters is whether a likable item is recommended to a user rather than an unlikable one. In short, a good online recommendation system should recommend different likable items continually over time. 1 Despite the success of collaborative filtering, there has been little theoretical development to justify its effectiveness in the online setting. We address this theoretical gap with our two main contributions in this paper. First, we frame online recommendation as a learning problem that fuses the lines of work on sleeping bandits and clustered bandits. We impose the constraint that once an item is consumed by a user, the system can’t recommend the item to the same user again. Our second main contribution is to analyze a cosine-similarity collaborative filtering algorithm. The key insight is our inclusion of two types of exploration in the algorithm: (1) the standard random exploration for probing the space of items, and (2) a novel “joint” exploration for finding different user types. Under our learning problem setup, after nearly log(km) initial time steps, the proposed algorithm achieves near-optimal performance relative to an oracle algorithm that recommends all likable items first. The nearly logarithmic dependence is a result of using the two different exploration types. We note that the algorithm does not know k. Outline. We present our model and learning problem for online recommendation systems in Section 2, provide a collaborative filtering algorithm and its performance guarantee in Section 3, and give the proof idea for the performance guarantee in Section 4. An overview of experimental results is given in Section 5. We discuss our work in the context of prior work in Section 6. 2 A Model and Learning Problem for Online Recommendations We consider a system with n users and m items. At each time step, each user is recommended an item that she or he hasn’t consumed yet, upon which, for simplicity, we assume that the user immediately consumes the item and rates it +1 (like) or −1 (dislike).1 The reward earned by the recommendation system up to any time step is the total number of liked items that have been recommended so far across all users. Formally, index time by t ∈{1, 2, . . . }, and users by u ∈[n] ≜{1, . . . , n}. Let πut ∈[m] ≜{1, . . . , m} be the item recommended to user u at time t. Let Y (t) ui ∈{−1, 0, +1} be the rating provided by user u for item i up to and including time t, where 0 indicates that no rating has been given yet. A reasonable objective is to maximize the expected reward r(T ) up to time T: r(T ) ≜ T X t=1 n X u=1 E[Y (T ) uπut] = m X i=1 n X u=1 E[Y (T ) ui ]. The ratings are noisy: the latent item preferences for user u are represented by a length-m vector pu ∈[0, 1]m, where user u likes item i with probability pui, independently across items. For a user u, we say that item i is likable if pui > 1/2 and unlikable if pui < 1/2. To maximize the expected reward r(T ), clearly likable items for the user should be recommended before unlikable ones. In this paper, we focus on recommending likable items. Thus, instead of maximizing the expected reward r(T ), we aim to maximize the expected number of likable items recommended up to time T: r(T ) + ≜ T X t=1 n X u=1 E[Xut] , (1) where Xut is the indicator random variable for whether the item recommended to user u at time t is likable, i.e., Xut = +1 if puπut > 1/2 and Xut = 0 otherwise. Maximizing r(T ) and r(T ) + differ since the former asks that we prioritize items according to their probability of being liked. Recommending likable items for a user in an arbitrary order is sufficient for many real recommendation systems such as for movies and music. For example, we suspect that users wouldn’t actually prefer to listen to music starting from the songs that their user type would like with highest probability to the ones their user type would like with lowest probability; instead, each user would listen to songs that she or he finds likable, ordered such that there is sufficient diversity in the playlist to keep the user experience interesting. We target the modest goal of merely recommending likable items, in any order. Of course, if all likable items have the same probability of being liked and similarly for all unlikable items, then maximizing r(T ) and r(T ) + are equivalent. 1In practice, a user could ignore the recommendation. To keep our exposition simple, however, we stick to this setting that resembles song recommendation systems like Pandora that per user continually recommends a single item at a time. For example, if a user rates a song as “thumbs down” then we assign a rating of −1 (dislike), and any other action corresponds to +1 (like). 2 The fundamental challenge is that to learn about a user’s preference for an item, we need the user to rate (and thus consume) the item. But then we cannot recommend that item to the user again! Thus, the only way to learn about a user’s preferences is through collaboration, or inferring from other users’ ratings. Broadly, such inference is possible if the users preferences are somehow related. In this paper, we assume a simple structure for shared user preferences. We posit that there are k < n different types of users, where users of the same type have identical item preference vectors. The number of types k represents the heterogeneity in the population. For ease of exposition, in this paper we assume that a user belongs to each user type with probability 1/k. We refer to this model as a latent source model, where each user type corresponds to a latent source of users. We remark that there is evidence suggesting real movie recommendation data to be well modeled by clustering of both users and items [21]. Our model only assumes clustering over users. Our problem setup relates to some versions of the multi-armed bandit problem. A fundamental difference between our setup and that of the standard stochastic multi-armed bandit problem [23, 8] is that the latter allows each item to be recommended an infinite number of times. Thus, the solution concept for the stochastic multi-armed bandit problem is to determine the best item (arm) and keep choosing it [3]. This observation applies also to “clustered bandits” [9], which like our work seeks to capture collaboration between users. On the other hand, sleeping bandits [15] allow for the available items at each time step to vary, but the analysis is worst-case in terms of which items are available over time. In our setup, the sequence of items that are available is not adversarial. Our model combines the collaborative aspect of clustered bandits with dynamic item availability from sleeping bandits, where we impose a strict structure on how items become unavailable. 3 A Collaborative Filtering Algorithm and Its Performance Guarantee This section presents our algorithm COLLABORATIVE-GREEDY and its accompanying theoretical performance guarantee. The algorithm is syntactically similar to the ε-greedy algorithm for multiarmed bandits [22], which explores items with probability ε and otherwise greedily chooses the best item seen so far based on a plurality vote. In our algorithm, the greedy choice, or exploitation, uses the standard cosine-similarity measure. The exploration, on the other hand, is split into two types, a standard item exploration in which a user is recommended an item that she or he hasn’t consumed yet uniformly at random, and a joint exploration in which all users are asked to provide a rating for the next item in a shared, randomly chosen sequence of items. Let’s fill in the details. Algorithm. At each time step t, either all the users are asked to explore, or an item is recommended to each user by choosing the item with the highest score for that user. The pseudocode is described in Algorithm 1. There are two types of exploration: random exploration, which is for exploring the space of items, and joint exploration, which helps to learn about similarity between users. For a pre-specified rate α ∈(0, 4/7], we set the probability of random exploration to be εR(n) = 1/nα Algorithm 1: COLLABORATIVE-GREEDY Input: Parameters θ ∈[0, 1], α ∈(0, 4/7]. Select a random ordering σ of the items [m]. Define εR(n) = 1 nα , and εJ(t) = 1 tα . for time step t = 1, 2, . . . , T do With prob. εR(n): (random exploration) for each user, recommend a random item that the user has not rated. With prob. εJ(t): (joint exploration) for each user, recommend the first item in σ that the user has not rated. With prob. 1 −εJ(t) −εR(n): (exploitation) for each user u, recommend an item j that the user has not rated and that maximizes score ep(t) uj , which depends on threshold θ. end 3 (decaying with the number of users), and the probability of joint exploration to be εJ(t) = 1/tα (decaying with time).2 Next, we define user u’s score ep(t) ui for item i at time t. Recall that we observe Y (t) ui = {−1, 0, +1} as user u’s rating for item i up to time t, where 0 indicates that no rating has been given yet. We define ep(t) ui ≜      P v∈e N (t) u 1{Y (t) vi = +1} P v∈e N (t) u 1{Y (t) vi ̸= 0} if P v∈e N (t) u 1{Y (t) vi ̸= 0} > 0, 1/2 otherwise, where the neighborhood of user u is given by e N (t) u ≜{v ∈[n] : ⟨eY (t) u , eY (t) v ⟩≥θ|supp(eY (t) u ) ∩supp(eY (t) v )|}, and eY (t) u consists of the revealed ratings of user u restricted to items that have been jointly explored. In other words, eY (t) ui = ( Y (t) ui if item i is jointly explored by time t, 0 otherwise. The neighborhoods are defined precisely by cosine similarity with respect to jointed explored items. To see this, for users u and v with revealed ratings eY (t) u and eY (t) v , let Ωuv ≜supp(eY (t) u )∩supp(eY (t) v ) be the support overlap of eY (t) u and eY (t) v , and let ⟨·, ·⟩Ωuv be the dot product restricted to entries in Ωuv. Then ⟨eY (t) u , eY (t) v ⟩ |Ωuv| = ⟨eY (t) u , eY (t) v ⟩Ωuv q ⟨eY (t) u , eY (t) u ⟩Ωuv q ⟨eY (t) v , eY (t) v ⟩Ωuv , which is the cosine similarity of revealed rating vectors eY (t) u and eY (t) v restricted to the overlap of their supports. Thus, users u and v are neighbors if and only if their cosine similarity is at least θ. Theoretical performance guarantee. We now state our main result on the proposed collaborative filtering algorithm’s performance with respect to the objective stated in equation (1). We begin with two reasonable, and seemingly necessary, conditions under which our the results will be established. A1 No ∆-ambiguous items. There exists some constant ∆> 0 such that |pui −1/2| ≥∆ for all users u and items i. (Smaller ∆corresponds to more noise.) A2 γ-incoherence. There exist a constant γ ∈[0, 1) such that if users u and v are of different types, then their item preference vectors pu and pv satisfy 1 m⟨2pu −1, 2pv −1⟩≤4γ∆2, where 1 is the all ones vector. Note that a different way to write the left-hand side is E[ 1 m⟨Y ∗ u , Y ∗ v ⟩], where Y ∗ u and Y ∗ v are fully-revealed rating vectors of users u and v, and the expectation is over the random ratings of items. The first condition is a low noise condition to ensure that with a finite number of samples, we can correctly classify each item as either likable or unlikable. The incoherence condition asks that the different user types are well-separated so that cosine similarity can tease apart the users of different types over time. We provide some examples after the statement of the main theorem that suggest the incoherence condition to be reasonable, allowing E[⟨Y ∗ u , Y ∗ v ⟩] to scale as Θ(m) rather than o(m). We assume that the number of users satisfies n = O(mC) for some constant C > 1. This is without loss of generality since otherwise, we can randomly divide the n users into separate population 2For ease of presentation, we set the two explorations to have the same decay rate α, but our proof easily extends to encompass different decay rates for the two exploration types. Furthermore, the constant 4/7 ≥α is not special. It could be different and only affects another constant in our proof. 4 pools, each of size O(mC) and run the recommendation algorithm independently for each pool to achieve the same overall performance guarantee. Finally, we define µ, the minimum proportion of likable items for any user (and thus any user type): µ ≜min u∈[n] Pm i=1 1{pui > 1/2} m . Theorem 1. Let δ ∈(0, 1) be some pre-specified tolerance. Take as input to COLLABORATIVEGREEDY θ = 2∆2(1 + γ) where γ ∈[0, 1) is as defined in A2, and α ∈(0, 4/7]. Under the latent source model and assumptions A1 and A2, if the number of users n = O(mC) satisfies n = Ω  km log 1 δ + 4 δ 1/α , then for any Tlearn ≤T ≤µm, the expected proportion of likable items recommended by COLLABORATIVE-GREEDY up until time T satisfies r(T ) + Tn ≥  1 −Tlearn T  (1 −δ), where Tlearn = Θ  log km ∆δ ∆4(1 −γ)2 1/(1−α) + 4 δ 1/α . Theorem 1 says that there are Tlearn initial time steps for which the algorithm may be giving poor recommendations. Afterward, for Tlearn < T < µm, the algorithm becomes near-optimal, recommending a fraction of likable items 1−δ close to what an optimal oracle algorithm (that recommends all likable items first) would achieve. Then for time horizon T > µm, we can no longer guarantee that there are likable items left to recommend. Indeed, if the user types each have the same fraction of likable items, then even an oracle recommender would use up the µm likable items by this time. Meanwhile, to give a sense of how long the learning period Tlearn is, note that when α = 1/2, we have Tlearn scaling as log2(km), and if we choose α close to 0, then Tlearn becomes nearly log(km). In summary, after Tlearn initial time steps, the simple algorithm proposed is essentially optimal. To gain intuition for incoherence condition A2, we calculate the parameter γ for three examples. Example 1. Consider when there is no noise, i.e., ∆= 1 2. Then users’ ratings are deterministic given their user type. Produce k vectors of probabilities by drawing m independent Bernoulli( 1 2) random variables (0 or 1 with probability 1 2 each) for each user type. For any item i and pair of users u and v of different types, Y ∗ ui · Y ∗ vi is a Rademacher random variable (±1 with probability 1 2 each), and thus the inner product of two user rating vectors is equal to the sum of m Rademacher random variables. Standard concentration inequalities show that one may take γ = Θ q log m m  to satisfy γ-incoherence with probability 1 −1/poly(m). Example 2. We expand on the previous example by choosing an arbitrary ∆> 0 and making all latent source probability vectors have entries equal to 1 2 ± ∆with probability 1 2 each. As before let user u and v are from different type. Now E[Y ∗ ui · Y ∗ vi] = ( 1 2 + ∆)2 + ( 1 2 −∆)2 −2( 1 4 −∆2) = 4∆2 if pui = pvi and E[Y ∗ ui · Y ∗ vi] = 2( 1 4 −∆2) −( 1 2 + ∆)2 −( 1 2 −∆)2 = −4∆2 if pui = 1 −pvi. The value of the inner product E[⟨Y ∗ u , Y ∗ v ⟩] is again equal to the sum of m Rademacher random variables, but this time scaled by 4∆2. For similar reasons as before, γ = Θ q log m m  suffices to satisfy γ-incoherence with probability 1 −1/poly(m). Example 3. Continuing with the previous example, now suppose each entry is 1 2+∆with probability µ ∈(0, 1/2) and 1 2 −∆with probability 1 −µ. Then for two users u and v of different types, pui = pvi with probability µ2 + (1 −µ)2. This implies that E[⟨Y ∗ u , Y ∗ v ⟩] = 4m∆2(1 −2µ)2. Again, using standard concentration, this shows that γ = (1−2µ)2 +Θ q log m m  suffices to satisfy γ-incoherence with probability 1 −1/poly(m). 5 4 Proof of Theorem 1 Recall that Xut is the indicator random variable for whether the item πut recommended to user u at time t is likable, i.e., puπut > 1/2. Given assumption A1, this is equivalent to the event that puπut ≥1 2 + ∆. The expected proportion of likable items is r(T ) + Tn = 1 Tn T X t=1 n X u=1 E[Xut] = 1 Tn T X t=1 n X u=1 P(Xut = 1). Our proof focuses on lower-bounding P(Xut = 1). The key idea is to condition on what we call the “good neighborhood” event Egood(u, t): Egood(u, t) = n at time t, user u has ≥n 5k neighbors from the same user type (“good neighbors”), and ≤∆tn1−α 10km neighbors from other user types (“bad neighbors”) o . This good neighborhood event will enable us to argue that after an initial learning time, with high probability there are at most ∆as many ratings from bad neighbors as there are from good neighbors. The proof of Theorem 1 consists of two parts. The first part uses joint exploration to show that after a sufficient amount of time, the good neighborhood event Egood(u, t) holds with high probability. Lemma 1. For user u, after t ≥ 2 log(10kmnα/∆) ∆4(1 −γ)2 1/(1−α) time steps, P(Egood(u, t)) ≥1 −exp  −n 8k  −12 exp  −∆4(1 −γ)2t1−α 20  . In the above lower bound, the first exponentially decaying term could be thought of as the penalty for not having enough users in the system from the k user types, and the second decaying term could be thought of as the penalty for not yet clustering the users correctly. The second part of our proof to Theorem 1 shows that, with high probability, the good neighborhoods have, through random exploration, accurately estimated the probability of liking each item. Thus, we correctly classify each item as likable or not with high probability, which leads to a lower bound on P(Xut = 1). Lemma 2. For user u at time t, if the good neighborhood event Egood(u, t) holds and t ≤µm, then P(Xut = 1) ≥1 −2m exp  −∆2tn1−α 40km  −1 tα −1 nα . Here, the first exponentially decaying term could be thought of as the cost of not classifying items correctly as likable or unlikable, and the last two decaying terms together could be thought of as the cost of exploration (we explore with probability εJ(t) + εR(n) = 1/tα + 1/nα). We defer the proofs of Lemmas 1 and 2 to the supplementary material. Combining these lemmas and choosing appropriate constraints on the numbers of users and items, we produce the following lemma. Lemma 3. Let δ ∈(0, 1) be some pre-specified tolerance. If the number of users n and items m satisfy n ≥max n 8k log 4 δ , 4 δ 1/αo , µm ≥t ≥max 2 log(10kmnα/∆) ∆4(1 −γ)2 1/(1−α) , 20 log(96/δ) ∆4(1 −γ)2 1/(1−α) , 4 δ 1/α , nt1−α ≥40km ∆2 log 16m δ  , then P(Xut = 1) ≥1 −δ. 6 Proof. With the above conditions on n and t satisfied, we combine Lemmas 1 and 2 to obtain P(Xut = 1) ≥1 −exp  −n 8k  −12 exp  −∆4(1 −γ)2t1−α 20  −2m exp  −∆2tn1−α 40km  −1 tα −1 nα ≥1 −δ 4 −δ 8 −δ 8 −δ 4 −δ 4 = 1 −δ. Theorem 1 follows as a corollary to Lemma 3. As previously mentioned, without loss of generality, we take n = O(mC). Then with number of users n satisfying O(mC) = n = Ω  km log 1 δ + 4 δ 1/α , and for any time step t satisfying µm ≥t ≥Θ  log km ∆δ ∆4(1 −γ)2 1/(1−α) + 4 δ 1/α ≜Tlearn , we simultaneously meet all of the conditions of Lemma 3. Note that the upper bound on number of users n appears since without it, Tlearn would depend on n (observe that in Lemma 3, we ask that t be greater than a quantity that depends on n). Provided that the time horizon satisfies T ≤µm, then r(T ) + Tn ≥ 1 Tn T X t=Tlearn n X u=1 P(Xut = 1) ≥ 1 Tn T X t=Tlearn n X u=1 (1 −δ) = (T −Tlearn)(1 −δ) T , yielding the theorem statement. 5 Experimental Results We provide only a summary of our experimental results here, deferring full details to the supplementary material. We simulate an online recommendation system based on movie ratings from the Movielens10m and Netflix datasets, each of which provides a sparsely filled user-by-movie rating matrix with ratings out of 5 stars. Unfortunately, existing collaborative filtering datasets such as the two we consider don’t offer the interactivity of a real online recommendation system, nor do they allow us to reveal the rating for an item that a user didn’t actually rate. For simulating an online system, the former issue can be dealt with by simply revealing entries in the user-by-item rating matrix over time. We address the latter issue by only considering a dense “top users vs. top items” subset of each dataset. In particular, we consider only the “top” users who have rated the most number of items, and the “top” items that have received the most number of ratings. While this dense part of the dataset is unrepresentative of the rest of the dataset, it does allow us to use actual ratings provided by users without synthesizing any ratings. A rigorous validation would require an implementation of an actual interactive online recommendation system, which is beyond the scope of our paper. First, we validate that our latent source model is reasonable for the dense parts of the two datasets we consider by looking for clustering behavior across users. We find that the dense top users vs. top movies matrices do in fact exhibit clustering behavior of users and also movies, as shown in Figure 1(a). The clustering was found via Bayesian clustered tensor factorization, which was previously shown to model real movie ratings data well [21]. Next, we demonstrate our algorithm COLLABORATIVE-GREEDY on the two simulated online movie recommendation systems, showing that it outperforms two existing recommendation algorithms Popularity Amongst Friends (PAF) [4] and a method by Deshpande and Montanari (DM) [12]. Following the experimental setup of [4], we quantize a rating of 4 stars or more to be +1 (likable), and a rating less than 4 stars to be −1 (unlikable). While we look at a dense subset of each dataset, there are still missing entries. If a user u hasn’t rated item j in the dataset, then we set the corresponding true rating to 0, meaning that in our simulation, upon recommending item j to user u, we receive 0 reward, but we still mark that user u has consumed item j; thus, item j can no longer be recommended to user u. For both Movielens10m and Netflix datasets, we consider the top n = 200 users and the top m = 500 movies. For Movielens10m, the resulting user-by-rating matrix has 80.7% nonzero entries. For Netflix, the resulting matrix has 86.0% nonzero entries. For an algorithm that 7 0 100 200 300 400 500 0 50 100 150 200 (a) 0 100 200 300 400 500 Time −10 0 10 20 30 40 50 60 Average cumulative reward Collaborative-Greedy Popularity Amongst Friends Deshpande-Montanari (b) Figure 1: Movielens10m dataset: (a) Top users by top movies matrix with rows and columns reordered to show clustering of users and items. (b) Average cumulative rewards over time. recommends item πut to user u at time t, we measure the algorithm’s average cumulative reward up to time T as 1 n PT t=1 Pn u=1 Y (T ) uπut, where we average over users. For all four methods, we recommend items until we reach time T = 500, i.e., we make movie recommendations until each user has seen all m = 500 movies. We disallow the matrix completion step for DM to see the users that we actually test on, but we allow it to see the the same items as what is in the simulated online recommendation system in order to compute these items’ feature vectors (using the rest of the users in the dataset). Furthermore, when a rating is revealed, we provide DM both the thresholded rating and the non-thresholded rating, the latter of which DM uses to estimate user feature vectors over time. We discuss choice of algorithm parameters in the supplementary material. In short, parameters θ and α of our algorithm are chosen based on training data, whereas we allow the other algorithms to use whichever parameters give the best results on the test data. Despite giving the two competing algorithms this advantage, COLLABORATIVE-GREEDY outperforms the two, as shown in Figure 1(b). Results on the Netflix dataset are similar. 6 Discussion and Related Work This paper proposes a model for online recommendation systems under which we can analyze the performance of recommendation algorithms. We theoretical justify when a cosine-similarity collaborative filtering method works well, with a key insight of using two exploration types. The closest related work is by Biau et al. [7], who study the asymptotic consistency of a cosinesimilarity nearest-neighbor collaborative filtering method. Their goal is to predict the rating of the next unseen item. Barman and Dabeer [4] study the performance of an algorithm called Popularity Amongst Friends, examining its ability to predict binary ratings in an asymptotic informationtheoretic setting. In contrast, we seek to understand the finite-time performance of such systems. Dabeer [11] uses a model similar to ours and studies online collaborative filtering with a moving horizon cost in the limit of small noise using an algorithm that knows the numbers of user types and item types. We do not model different item types, our algorithm is oblivious to the number of user types, and our performance metric is different. Another related work is by Deshpande and Montanari [12], who study online recommendations as a linear bandit problem; their method, however, does not actually use any collaboration beyond a pre-processing step in which offline collaborative filtering (specifically matrix completion) is solved to compute feature vectors for items. Our work also relates to the problem of learning mixture distributions (c.f., [10, 18, 5, 2]), where one observes samples from a mixture distribution and the goal is to learn the mixture components and weights. Existing results assume that one has access to the entire high-dimensional sample or that the samples are produced in an exogenous manner (not chosen by the algorithm). Neither assumption holds in our setting, as we only see each user’s revealed ratings thus far and not the user’s entire preference vector, and the recommendation algorithm affects which samples are observed (by choosing which item ratings are revealed for each user). These two aspects make our setting more challenging than the standard setting for learning mixture distributions. However, our goal is more modest. Rather than learning the k item preference vectors, we settle for classifying them as likable or unlikable. Despite this, we suspect having two types of exploration to be useful in general for efficiently learning mixture distributions in the active learning setting. Acknowledgements. This work was supported in part by NSF grant CNS-1161964 and by Army Research Office MURI Award W911NF-11-1-0036. GHC was supported by an NDSEG fellowship. 8 References [1] Fabio Aiolli. A preliminary study on a recommender system for the million songs dataset challenge. In Proceedings of the Italian Information Retrieval Workshop, pages 73–83, 2013. [2] Anima Anandkumar, Rong Ge, Daniel Hsu, Sham M. Kakade, and Matus Telgarsky. Tensor decompositions for learning latent variable models, 2012. arXiv:1210.7559. [3] Peter Auer, Nicol`o Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine Learning, 47(2-3):235–256, May 2002. [4] Kishor Barman and Onkar Dabeer. Analysis of a collaborative filter based on popularity amongst neighbors. IEEE Transactions on Information Theory, 58(12):7110–7134, 2012. [5] Mikhail Belkin and Kaushik Sinha. Polynomial learning of distribution families. In Foundations of Computer Science (FOCS), 2010 51st Annual IEEE Symposium on, pages 103–112. IEEE, 2010. [6] Thierry Bertin-Mahieux, Daniel P.W. Ellis, Brian Whitman, and Paul Lamere. The million song dataset. In Proceedings of the 12th International Conference on Music Information Retrieval (ISMIR 2011), 2011. [7] G´erard Biau, Benoˆıt Cadre, and Laurent Rouvi`ere. Statistical analysis of k-nearest neighbor collaborative recommendation. The Annals of Statistics, 38(3):1568–1592, 2010. [8] S´ebastien Bubeck and Nicol`o Cesa-Bianchi. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning, 5(1):1–122, 2012. [9] Loc Bui, Ramesh Johari, and Shie Mannor. Clustered bandits, 2012. arXiv:1206.4169. [10] Kamalika Chaudhuri and Satish Rao. Learning mixtures of product distributions using correlations and independence. In Conference on Learning Theory, pages 9–20, 2008. [11] Onkar Dabeer. Adaptive collaborating filtering: The low noise regime. In IEEE International Symposium on Information Theory, pages 1197–1201, 2013. [12] Yash Deshpande and Andrea Montanari. Linear bandits in high dimension and recommendation systems, 2013. arXiv:1301.1722. [13] Roger B. Grosse, Ruslan Salakhutdinov, William T. Freeman, and Joshua B. Tenenbaum. Exploiting compositionality to explore a large space of model structures. In Uncertainty in Artificial Intelligence, pages 306–315, 2012. [14] Wassily Hoeffding. Probability inequalities for sums of bounded random variables. Journal of the American statistical association, 58(301):13–30, 1963. [15] Robert Kleinberg, Alexandru Niculescu-Mizil, and Yogeshwer Sharma. Regret bounds for sleeping experts and bandits. Machine Learning, 80(2-3):245–272, 2010. [16] Yehuda Koren. The BellKor solution to the Netflix grand prize. http://www.netflixprize.com/ assets/GrandPrize2009_BPC_BellKor.pdf, August 2009. [17] Greg Linden, Brent Smith, and Jeremy York. Amazon.com recommendations: item-to-item collaborative filtering. IEEE Internet Computing, 7(1):76–80, 2003. [18] Ankur Moitra and Gregory Valiant. Settling the polynomial learnability of mixtures of gaussians. Proceedings of the 51st Annual IEEE Symposium on Foundations of Computer Science, 2010. [19] Martin Piotte and Martin Chabbert. The pragmatic theory solution to the netflix grand prize. http:// www.netflixprize.com/assets/GrandPrize2009_BPC_PragmaticTheory.pdf, August 2009. [20] Paul Resnick, Neophytos Iacovou, Mitesh Suchak, Peter Bergstrom, and John Riedl. Grouplens: An open architecture for collaborative filtering of netnews. In Proceedings of the 1994 ACM Conference on Computer Supported Cooperative Work, CSCW ’94, pages 175–186, New York, NY, USA, 1994. ACM. [21] Ilya Sutskever, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Modelling relational data using bayesian clustered tensor factorization. In NIPS, pages 1821–1828, 2009. [22] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. MIT Press, Cambridge, MA, 1998. [23] William R. Thompson. On the Likelihood that one Unknown Probability Exceeds Another in View of the Evidence of Two Samples. Biometrika, 25:285–294, 1933. [24] Andreas T¨oscher and Michael Jahrer. The bigchaos solution to the netflix grand prize. http://www. netflixprize.com/assets/GrandPrize2009_BPC_BigChaos.pdf, September 2009. 9
2014
320
5,426
Self-Paced Learning with Diversity Lu Jiang1, Deyu Meng1,2, Shoou-I Yu1, Zhenzhong Lan1, Shiguang Shan1,3, Alexander G. Hauptmann1 1School of Computer Science, Carnegie Mellon University 2School of Mathematics and Statistics, Xi’an Jiaotong University 3Institute of Computing Technology, Chinese Academy of Sciences lujiang@cs.cmu.edu, dymeng@mail.xjtu.edu.cn {iyu, lanzhzh}@cs.cmu.edu, sgshan@ict.ac.cn, alex@cs.cmu.edu Abstract Self-paced learning (SPL) is a recently proposed learning regime inspired by the learning process of humans and animals that gradually incorporates easy to more complex samples into training. Existing methods are limited in that they ignore an important aspect in learning: diversity. To incorporate this information, we propose an approach called self-paced learning with diversity (SPLD) which formalizes the preference for both easy and diverse samples into a general regularizer. This regularization term is independent of the learning objective, and thus can be easily generalized into various learning tasks. Albeit non-convex,the optimization of the variables included in this SPLD regularization term for sample selection can be globally solved in linearithmic time. We demonstrate that our method significantly outperforms the conventional SPL on three real-world datasets. Specifically, SPLD achieves the best MAP so far reported in literature on the Hollywood2 and Olympic Sports datasets. 1 Introduction Since it was raised in 2009, Curriculum Learning (CL) [1] has been attracting increasing attention in the field of machine learning and computer vision [2]. The learning paradigm is inspired by the learning principle underlying the cognitive process of humans and animals, which generally starts with learning easier aspects of an aimed task, and then gradually takes more complex examples into consideration. It has been empirically demonstrated to be beneficial in avoiding bad local minima and in achieving a better generalization result [1]. A sequence of gradually added training samples [1] is called a curriculum. A straightforward way to design a curriculum is to select samples based on certain heuristical “easiness” measurements [3, 4, 5]. This ad-hoc implementation, however, is problem-specific and lacks generalization capacity. To alleviate this deficiency, Kumar et al. [6] proposed a method called Self-Paced Learning (SPL) that embeds curriculum designing into model learning. SPL introduces a regularization term into the learning objective so that the model is jointly learned with a curriculum consisting of easy to complex samples. As its name suggests, the curriculum is gradually determined by the model itself based on what it has already learned, as opposed to some predefined heuristic criteria. Since the curriculum in the SPL is independent of model objectives in specific problems, SPL represents a general implementation [7, 8] for curriculum learning. In SPL, samples in a curriculum are selected solely in terms of “easiness”. In this work, we reveal that diversity, an important aspect in learning, should also be considered. Ideal self-paced learning should utilize not only easy but also diverse examples that are sufficiently dissimilar from what has already been learned. Theoretically, considering diversity in learning is consistent with the increasing entropy theory in CL that a curriculum should increase the diversity of training examples [1]. This can be intuitively explained in the context of human education. A rational curriculum for a pupil not only needs to include examples of suitable easiness matching her learning pace, but also, 1 Curriculum for SPL Curriculum for SPLD Outdoor bouldering Artificial wall climbing Snow mountain climbing ... ... Positive training samples of “Rock Climbing” a2 a1 a3 a4 a5 a6 b2 b1 b3 b4 c1 c2 c3 c4 a1 a2 a3 a4 c4 a2 b1 c1 a1 c4 easy hard easy and diverse hard 0.05 0.12 0.12 0.13 0.14 0.40 0.17 0.18 0.20 0.35 0.15 0.16 0.20 0.50 0.05 0.12 0.12 0.13 0.50 0.05 0.15 0.17 c2 0.16 0.12 0.50 Figure 1: Illustrative comparison of SPL and SPLD on “Rock Climbing” event using real samples [15]. SPL tends to first select the easiest samples from a single group. SPLD inclines to select easy and diverse samples from multiple groups. importantly, should include some diverse examples on the subject in order for her to develop more comprehensive knowledge. Likewise, learning from easy and diverse samples is expected to be better than learning from either criterion alone. We name the learning paradigm that considers both easiness and diversity Self-Paced Learning with Diversity (SPLD). SPLD proves to be a general learning framework as its intuition is embedded as a regularization term that is independent of specific model objectives. In addition, by considering diversity in learning, SPLD is capable of obtaining better solutions. For example, Fig. 1 plots some positive samples for the event “Rock Climbing” on a real dataset, named MED [15]. Three groups of samples are depicted for illustration. The number under the keyframe indicates the loss, and a smaller loss corresponds to an easier sample. Every group has easy and complex samples. Having learned some samples from a group, the SPL model prefers to select more samples from the same group as they appear to be easy to what the model has learned. This may lead to overfitting to a data subset while ignoring easy samples in other groups. For example, in Fig. 1, the samples selected in first iterations of SPL are all from the “Outdoor bouldering” sub-event because they all look like a1. This is significant as the overfitting becomes more and more severe as the samples from the same group are kept adding into training. This phenomenon is more evident in real-world data where the collected samples are usually biased towards some groups. In contrast, SPLD, considering both easiness and diversity, produces a curriculum that reasonably mixes easy samples from multiple groups. The diverse curriculum is expected to help quickly grasp easy and comprehensive knowledge and to obtain better solutions. This hypothesis is substantiated by our experiments. The contribution of this paper is threefold: (1) We propose a novel idea of considering both easiness and diversity in the self-paced learning, and formulate it into a concise regularization term that can be generally applied to various problems (Section 4.1). (2) We introduce the algorithm that globally optimizes a non-convex problem w.r.t. the variables included in this SPLD regularization term for sample selection (Section 4.2). (3) We demonstrate that the proposed SPLD significantly outperforms SPL on three real-word datasets. Notably, SPLD achieves the best MAP so far reported in literature on two action datasets. 2 Related work Bengio et al. [1] proposed a new learning paradigm called curriculum learning (CL), in which a model is learned by gradually including samples into training from easy to complex so as to increase the entropy of training samples. Afterwards, Bengio and his colleagues [2] presented insightful explorations for the rationality underlying this learning paradigm, and discussed the relationship between the CL and conventional optimization techniques, e.g., the continuation and annealing methods. From human behavioral perspective, Khan et al. [10] provided evidence that CL is consistent with the principle in teaching. The curriculum is often derived by predetermined heuristics in particular problems. For example, Ruvolo and Eaton [3] took the negative distance to the boundary as the indicator for easiness in classification. Spitkovsky et al. [4] used the sentence length as an indicator in 2 studying grammar induction. Shorter sentences have fewer possible solutions and thus were learned earlier. Lapedriza et al. [5] proposed a similar approach by first ranking examples based on certain “training values” and then greedily training the model on these sorted examples. The ad-hoc curriculum design in CL turns out onerous or conceptually difficult to implement in different problems. To alleviate this issue, Kumar et al. [6] designed a new formulation, called self-paced learning (SPL). SPL embeds curriculum design (from easy to more complex samples) into model learning. By virtue of its generality, various applications based on the SPL have been proposed very recently [7, 8, 11, 12, 13]. For example, Jiang et al. [7] discovered that pseudo relevance feedback is a type of self-paced learning which explains the rationale of this iterative algorithm starting from the easy examples i.e. the top ranked documents/videos. Tang et al. [8] formulated a self-paced domain adaptation approach by training target domain knowledge starting with easy samples in the source domain. Kumar et al. [11] developed an SPL strategy for the specific-class segmentation task. Supanˇciˇc and Ramanan [12] designed an SPL method for longterm tracking by setting smallest increase in the SVM objective as the loss function. To the best of our knowledge, there has been no studies to incorporate diversity in SPL. 3 Self-Paced Learning Before introducing our approach, we first briefly review the SPL. Given the training dataset D = {(x1, y1), · · · , (xn, yn)}, where xi ∈Rm denotes the ith observed sample, and yi represents its label, let L(yi, f(xi, w)) denote the loss function which calculates the cost between the ground truth label yi and the estimated label f(xi, w). Here w represents the model parameter inside the decision function f. In SPL, the goal is to jointly learn the model parameter w and the latent weight variable v = [v1, · · · , vn] by minimizing: min w,v E(w, v; λ) = n X i=1 viL(yi, f(xi, w)) −λ n X i=1 vi, s.t. v ∈[0, 1]n, (1) where λ is a parameter for controlling the learning pace. Eq. (1) indicates the loss of a sample is discounted by a weight. The objective of SPL is to minimize the weighted training loss together with the negative l1-norm regularizer −∥v∥1 = −Pn i=1 vi (since vi ≥0). This regularization term is general and applicable to various learning tasks with different loss functions [7, 11, 12]. ACS (Alternative Convex Search) is generally used to solve Eq. (1) [6, 8]. It is an iterative method for biconvex optimization, in which the variables are divided into two disjoint blocks. In each iteration, a block of variables are optimized while keeping the other block fixed. When v is fixed, the existing off-the-shelf supervised learning methods can be employed to obtain the optimal w∗. With the fixed w, the global optimum v∗= [v∗ 1, · · · , v∗ n] can be easily calculated by [6]: v∗ i = 1, L(yi, f(xi, w)) < λ, 0, otherwise. (2) There exists an intuitive explanation behind this alternative search strategy: 1) when updating v with a fixed w, a sample whose loss is smaller than a certain threshold λ is taken as an “easy” sample, and will be selected in training (v∗ i = 1), or otherwise unselected (v∗ i = 0); 2) when updating w with a fixed v, the classifier is trained only on the selected “easy” samples. The parameter λ controls the pace at which the model learns new samples, and physically λ corresponds to the “age” of the model. When λ is small, only “easy” samples with small losses will be considered. As λ grows, more samples with larger losses will be gradually appended to train a more “mature” model. 4 Self-Paced Learning with Diversity In this section we detail the proposed learning paradigm called SPLD. We first formally define its objective in Section 4.1, and discuss an efficient algorithm to solve the problem in Section 4.2. 4.1 SPLD Model Diversity implies that the selected samples should be less similar or clustered. An intuitive approach for realizing this is by selecting samples of different groups scattered in the sample space. We assume that the correlation of samples between groups is less than that of within a group. This 3 auxiliary group membership is either given, e.g. in object recognition frames from the same video can be regarded from the same group, or can be obtained by clustering samples. This aim of SPLD can be mathematically described as follows. Assume that the training samples X = (x1, · · · , xn) ∈Rm×n are partitioned into b groups: X(1), · · · , X(b), where columns of X(j) ∈Rm×nj correspond to the samples in the jth group, nj is the sample number in the group and Pb j=1 nj = n. Accordingly denote the weight vector as v = [v(1), · · · , v(b)], where v(j) = (v(j) 1 , · · · , v(j) nj )T ∈[0, 1]nj. SPLD on one hand needs to assign nonzero weights of v to easy samples as the conventional SPL, and on the other hand requires to disperse nonzero elements across possibly more groups v(i) to increase the diversity. Both requirements can be uniformly realized through the following optimization model: min w,v E(w, v; λ, γ) = n X i=1 viL(yi, f(xi, w)) −λ n X i=1 vi −γ∥v∥2,1, s.t. v ∈[0, 1]n, (3) where λ, γ are the parameters imposed on the easiness term (the negative l1-norm: −∥v∥1) and the diversity term (the negative l2,1-norm: −∥v∥2,1), respectively. As for the diversity term, we have: −∥v∥2,1 = − b X j=1 ∥v(j)∥2. (4) The SPLD introduces a new regularization term in Eq. (3) which consists of two components. One is the negative l1-norm inherited from the conventional SPL, which favors selecting easy over complex examples. The other is the proposed negative l2,1-norm, which favors selecting diverse samples residing in more groups. It is well known that the l2,1-norm leads to the group-wise sparse representation of v [14], i.e. non-zero entries of v tend to be concentrated in a small number of groups. Contrariwise, the negative l2,1-norm should have a counter-effect to group-wise sparsity, i.e. nonzero entries of v tend to be scattered across a large number of groups. In other words, this anti-group-sparsity representation is expected to realize the desired diversity. Note that when each group only contains a single sample, Eq. (3) degenerates to Eq. (1). Unlike the convex regularization term in Eq. (1) of SPL, the term in the SPLD is non-convex. Consequently, the traditional (sub)gradient-based methods cannot be directly applied to optimizing v. We will discuss an algorithm to resolve this issue in the next subsection. 4.2 SPLD Algorithm Similar as the SPL, the alternative search strategy can be employed for solving Eq. (3). However, a challenge is that optimizing v with a fixed w becomes a non-convex problem. We propose a simple yet effective algorithm for extracting the global optimum of this problem, as listed in Algorithm 1. It takes as input the groups of samples, the up-to-date model parameter w, and two self-paced parameters, and outputs the optimal v of minv E(w, v; λ, γ). The global minimum is proved in the following theorem (see the proof in supplementary materials): Theorem 1 Algorithm 1 attains the global optimum to minv E(w, v) for any given w in linearithmic time. As shown, Algorithm 1 selects samples in terms of both the easiness and the diversity. Specifically: • Samples with L(yi, f(xi, w)) < λ will be selected in training (vi = 1) in Step 5. These samples represent the “easy” examples with small losses. • Samples with L(yi, f(xi, w)) > λ + γ will not be selected in training (vi = 0) in Step 6. These samples represent the “complex” examples with larger losses. • Other samples will be selected by comparing their losses to a threshold λ+ γ √ i+√i−1, where i is the sample’s rank w.r.t. its loss value within its group. The sample with a smaller loss than the threshold will be selected in training. Since the threshold decreases considerably as the rank i grows, Step 5 penalizes samples monotonously selected from the same group. We study a tractable example that allows for clearer diagnosis in Fig. 2, where each keyframe represents a video sample on the event “Rock Climbing” of the TRECVID MED data [15], and the number below indicates its loss. The samples are clustered into four groups based on the visual similarity. A colored block on the right shows a curriculum selected by Algorithm 1. When γ = 0, 4 Algorithm 1: Algorithm for Solving minv E(w, v; λ, γ). input : Input dataset D, groups X(1), · · · , X(b), w, λ, γ output: The global solution v = (v(1), · · · , v(b)) of minv E(w, v; λ, γ). 1 for j = 1 to b do // for each group 2 Sort the samples in X(j) as (x(j) 1 , · · · , x(j) nj ) in ascending order of their loss values L; 3 Accordingly, denote the labels and weights of X(j) as (y(j) 1 , · · · , y(j) nj ) and (v(j) 1 , · · · , v(j) nj ); 4 for i = 1 to nj do // easy samples first 5 if L(y(j) i , f(x(j) i , w)) < λ + γ 1 √ i+√i−1 then v(j) i = 1 ; // select this sample 6 else v(j) i = 0; // not select this sample 7 end 8 end 9 return v 0.05 0.12 0.12 0.40 0.20 0.18 0.17 0.50 Outdoor bouldering Artificial wall climbing Snow mountain climbing 0.15 0.35 0.15 0.16 0.28 Bear climbing a rock a c e b d f n g h i j l k m 0.12 a c e b d f n g h i j l k m a c e b d f n g h i j l k m a b c d e f g h i j k l m n Curriculum: a, b, c, d Curriculum: a, j, g, b Curriculum: a, j, g, n (a) (b) (c) Figure 2: An example on samples selected by Algorithm 1. A colored block denotes a curriculum with given λ and γ, and the bold (red) box indicates the easy sample selected by Algorithm 1. as shown in Fig. 2(a), SPLD, which is identical to SPL, selects only easy samples (with the smallest losses) from a single cluster. Its curriculum thus includes duplicate samples like b, c, d with the same loss value. When λ ̸= 0 and γ ̸= 0 in Fig. 2(b), SPLD balances the easiness and the diversity, and produces a reasonable and diverse curriculum: a, j, g, b. Note that even if there exist 3 duplicate samples b, c, d, SPLD only selects one of them due to the decreasing threshold in Step 5 of Algorithm 1. Likewise, samples e and j share the same loss, but only j is selected as it is better in increasing the diversity. In an extreme case where λ = 0 and γ ̸= 0, as illustrated in Fig. 2(c), SPLD selects only diverse samples, and thus may choose outliers, such as the sample n which is a confusable video about a bear climbing a rock. Therefore, considering both easiness and diversity seems to be more reasonable than considering either one alone. Physically the parameters λ and γ together correspond to the “age” of the model, where λ focuses on easiness whereas γ stresses diversity. As Algorithm 1 finds the optimal v, the alternative search strategy can be readily applied to solving Eq. (3). The details are listed in Algorithm 2. As aforementioned, Step 4 can be implemented using the existing off-the-shelf learning method. Following [6], we initialize v by setting vi = 1 to randomly selected samples. Following SPL [6], the self-paced parameters are updated by absolute values of µ1, µ2 (µ1, µ2 ≥1) in Step 6 at the end of every iteration. In practice, it seems more robust by first sorting samples in ascending order of their losses, and then setting the λ, γ according to the statistics collected from the ranked samples (see the discussion in supplementary materials). According to [6], the alternative search in Algorithm 1 converges as the objective function is monotonically decreasing and is bounded from below. 5 Experiments We present experimental results for the proposed SPLD on two tasks: event detection and action recognition. We demonstrate that our approach significantly outperforms SPL on three real-world challenging datasets. The code is at (http://www.cs.cmu.edu/˜lujiang/spld). 5 Algorithm 2: Algorithm of Self-Paced Learning with Diversity. input : Input dataset D, self-pace parameters µ1, µ2 output: Model parameter w 1 if no prior clusters exist then cluster the training samples X into b groups X(1), · · · , X(b); 2 Initialize v∗, λ, γ ; // assign the starting value 3 while not converged do 4 Update w∗= arg minw E(w, v∗; λ, γ) ; // train a classification model 5 Update v∗= arg minv E(w∗, v; λ, γ) using Algorithm 1; // select easy & diverse samples 6 λ ←µ1λ ; γ ←µ2γ ; // update the learning pace 7 end 8 return w = w∗ SPLD is compared against four baseline methods: 1) RandomForest is a robust bootstrap method that trains multiple decision trees using randomly selected samples and features [16]. 2) AdaBoost is a classical ensemble approach that combines the sequentially trained “base” classifiers in a weighted fashion [18]. Samples that are misclassified by one base classifier are given greater weight when used to train the next classifier in sequence. 3) BatchTrain represents a standard training approach in which a model is trained simultaneously using all samples; 4) SPL is a state-of-the-art method that trains models gradually from easy to more complex samples [6]. The baseline methods are a mixture of the well-known and the state-of-the-art methods on training models using sampled data. 5.1 Multimedia Event Detection (MED) Problem Formulation Given a collection of videos, the goal of MED is to detect events of interest, e.g. “Birthday Party” and “Parade”, solely based on the video content. The task is very challenging due to complex scenes, camera motion, occlusions, etc. [17, 19, 8]. Dataset The experiments are conducted on the largest collection on event detection: TRECVID MED13Test, which consists of about 32,000 Internet videos. There are a total of 3,490 videos from 20 complex events, and the rest are background videos. For each event 10 positive examples are given to train a detector, which is tested on about 25,000 videos. The official test split released by NIST (National Institute of Standards and Technology) is used [15]. Experimental setting A Deep Convolutional Neural Network is trained on 1.2 million ImageNet challenge images from 1,000 classes [20] to represent each video as a 1,000-dimensional vector. Algorithm 2 is used. By default, the group membership is generated by the spectral clustering, and the number of groups is set to 64. Following [9, 8], LibLinear is used as the solver in Step 4 of Algorithm 2 due to its robust performance on this task. The performance is evaluated using MAP as recommended by NIST. The parameters of all methods are tuned on the same validation set. Table 1 lists the overall MAP comparison. To reduce the influence brought by initialization, we repeated experiments of SPL and SPLD 10 times with random starting values, and report the best run and the mean (with the 95% confidence interval) of the 10 runs. The proposed SPLD outperforms all baseline methods with statistically significant differences at the p-value level of 0.05, according to the paired t-test. It is worth emphasizing that MED is very challenging [15] and 26% relative (2.5 absolute) improvement over SPL is a notable gain. SPLD outperforms other baselines on both the best run and the 10 runs average. RandomForest and AdaBoost yield poorer performance. This observation agrees with the study in literature [15, 9] that SVM is more robust on event detection. Table 1: MAP (x100) comparison with the baseline methods on MED. Run Name RandomForest AdaBoost BatchTrain SPL SPLD Best Run 3.0 2.8 8.3 9.6 12.1 10 Runs Average 3.0 2.8 8.3 8.6±0.42 9.8±0.45 BatchTrain, SPL and SPLD are all performed using SVM. Regarding the best run, SPL boosts the MAP of the BatchTrain by a relative 15.6% (absolute 1.3%). SPLD yields another 26% (absolute 2.5%) over SPL. The MAP gain suggests that optimizing objectives with the diversity is inclined to attain a better solution. Fig. 3 plots the validation and test AP on three representative events. As illustrated, SPLD attains a better solution within fewer iterations than SPL, e.g. in Fig. 3(a) SPLD obtains the best test AP (0.14) by 6 iterations as opposed to AP (0.12) by 11 iterations in 6 10 20 30 40 50 0 0.05 0.1 0.15 0.2 Iteration Average Precision Dev AP Test AP BatchTrain 10 20 30 40 50 0 0.05 0.1 0.15 0.2 Iteration Average Precision Dev AP Test AP BatchTrain 10 20 30 40 50 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Iteration Average Precision Dev AP Test AP BatchTrain 10 20 30 40 50 0 0.1 0.2 0.3 0.4 0.5 Iteration Average Precision Dev AP Test AP BatchTrain 10 20 30 40 50 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 Iteration Average Precision Dev AP Test AP BatchTrain 10 20 30 40 50 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 Iteration Average Precision Dev AP Test AP BatchTrain (a) E006: Birthday party (b) E008: Flash mob gathering (c) E023: Dog show SPL SPLD Figure 3: The validation and test AP in different iterations. Top row plots the SPL result and bottom shows the proposed SPLD result. The x-axis represents the iteration in training. The blue solid curve (Dev AP) denotes the AP on the validation set, the red one marked by squares (Test AP) denotes the AP on the test set, and the green dashed curve denotes the Test AP of BatchTrain which remains the same across iterations. (a) Iter 1 Indoorbirthday party ... Iter2 Iter 3 Car/Truck Iter 4 Iter 9 Iter 10 Indoorbirthday party Indoorbirthday party Indoor birthday party Indoorbirthday party Outdoorbirthday party Outdoor birthday party Indoorbirthday party Indoorbirthday party Outdoorbirthday party Indoorbirthday party Indoorbirthday party ... ... ... Car/Truck Bicycle/Scooter Car/Truck Bicycle/Scooter Car/Truck Car/Truck Bicycle/Scooter Bicycle/Scooter Car/Truck Bicycle/Scooter (b) (a) (b) E006: Birthday party E007: Changing a vehicle tire The number of iterations in training Car/Truck Figure 4: Comparison of positive samples used in each iteration by (a) SPL (b) SPLD. SPL. Studies [1, 6] have shown that SPL converges fast, while this observation further suggests that SPLD may lead to an even faster convergence. We hypothesize that it is because the diverse samples learned in the early iterations in SPLD tend to be more informative. The best Test APs of both SPL and SPLD are better than BatchTrain, which is consistent with the observation in [5] that removing some samples may be beneficial in training a better detector. As shown, Dev AP and Test AP share a similar pattern justifying the rationale for parameters tuning on the validation set. Fig. 4 plots the curriculum generated by SPL and SPLD in a first few iterations on two representative events. As we see, SPL tends to select easy samples similar to what it has already learned, whereas SPLD selects samples that are both easy and diverse to the model. For example, for the event “E006 Birthday Party”, SPL keeps selecting indoor scenes due to the sample learned in the first place. However, the samples learned by SPLD are a mixture of indoor and outdoor birthday parties. For the complex samples, both methods leave them to the last iterations, e.g. the 10th video in “E007”. 5.2 Action Recognition Problem Formulation The goal is to recognize human actions in videos. Datasets Two representative datasets are used: Hollywood2 was collected from 69 different Hollywood movies [21]. It contains 1,707 videos belonging to 12 actions, splitting into a training set (823 videos) and a test set (884 videos). Olympic Sports consists of athletes practicing different sports collected from YouTube [22]. There are 16 sports actions from 783 clips. We use 649 for training and 134 for testing as recommended in [22]. Experimental setting The improved dense trajectory feature is extracted and further represented by the fisher vector [23, 24]. A similar setting discussed in Section 5.1 is applied, except that the groups are generated by K-means (K=128). Table 2 lists the MAP comparison on the two datasets. A similar pattern can be observed that SPLD outperforms SPL and other baseline methods with statistically significant differences. We then compare our MAP with the state-of-the-art MAP in Table 3. Indeed, this comparison may be 7 Table 2: MAP (x100) comparison with the baseline methods on Hollywood2 and Olympic Sports. Run Name RandomForest AdaBoost BatchTrain SPL SPLD Hollywood2 28.20 41.14 58.16 63.72 66.65 Olympic Sports 63.32 69.25 90.61 90.83 93.11 less fair since the features are different in different methods. Nevertheless, with the help of SPLD, we are able to achieve the best MAP reported so far on both datasets. Note that the MAPs in Table 3 are obtained by recent and very competitive methods on action recognition. This improvement confirms the assumption that considering diversity in learning is instrumental. Table 3: Comparison of SPLD to the state-of-the-art on Hollywood2 and Olympic Sports Hollywood2 Olympic Sports Vig et al. 2012 [25] 59.4% Brendel et al. 2011 [28] 73.7% Jiang et al. 2012 [26] 59.5% Jiang et al. 2012 [26] 80.6% Jain et al. 2013 [27] 62.5% Gaidon et al. 2012 [29] 82.7% Wang et al. 2013 [23] 64.3% Wang et al. 2013 [23] 91.2% SPLD 66.7% SPLD 93.1% 5.3 Sensitivity Study We conduct experiments using different number of groups generated by two clustering algorithm: K-means and Spectral Clustering. Each experiment is fully tuned under the given #groups and the clustering algorithm, and the best run is reported in Table 4. The results suggest that SPLD is relatively insensitive to the clustering method and the given group numbers. We hypothesize that SPLD may not improve SPL in the cases where the assumption in Section 4.1 is violated, and the given groups, e.g. random clusters, cannot reflect the latent variousness in data. Table 4: MAP (x100) comparison of different clustering algorithms and #clusters. Dataset SPL Clustering #Groups=32 #Groups=64 #Groups=128 #Groups=256 MED 8.6±0.42 K-means 9.16±0.31 9.20±0.36 9.25±0.32 9.03±0.28 Spectral 9.29±0.42 9.79±0.45 9.22±0.41 9.38±0.43 Hollywood2 63.72 K-means 66.372 66.358 66.653 66.365 Spectral 66.639 66.504 66.264 66.709 Olympic 90.83 K-means 91.86 92.37 93.11 92.65 Spectral 91.08 92.51 93.25 92.54 6 Conclusion We advanced the frontier of the self-paced learning by proposing a novel idea that considers both easiness and diversity in learning. We introduced a non-convex regularization term that favors selecting both easy and diverse samples. The proposed regularization term is general and can be applied to various problems. We proposed a linearithmic algorithm that finds the global optimum of this non-convex problem on updating the samples to be included. Using three real-world datasets, we showed that the proposed SPLD outperforms the state-of-the-art approaches. Possible directions for future work may include studying the diversity for samples in the mixture model, e.g. mixtures of Gaussians, in which a sample is assigned to a mixture of clusters. Another possible direction would be studying assigning reliable starting values for SPL/SPLD. Acknowledgments This work was partially supported by Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior National Business Center contract number D11PC20068. Deyu Meng was partially supported by 973 Program of China (3202013CB329404) and the NSFC project (61373114). The 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/NBC, or the U.S. Government. 8 References [1] Y. Bengio, J. Louradour, R. Collobert, and J. Weston, Curriculum learning. In ICML, 2009. [2] Y. Bengio, A. Courville, and P. Vincent. Representation learning: A review and new perspectives. IEEE Trans. PAMI 35(8):1798-1828, 2013. [3] S. Basu and J. Christensen. Teaching classification boundaries to humans. In AAAI, 2013. [4] V. I. Spitkovsky, H. Alshawi, and D. Jurafsky. Baby steps: How “Less is More” in unsupervised dependency parsing. In NIPS, 2009. [5] A. Lapedriza, H. Pirsiavash, Z. Bylinskii, and A. Torralba. Are all training examples equally valuable? CoRR abs/1311.6510, 2013. [6] M. P. Kumar, B. Packer, and D. Koller. Self-paced learning for latent variable models. In NIPS, 2010. [7] L. Jiang, D. Meng, T. Mitamura, and A. Hauptmann. Easy samples first: self-paced reranking for zeroexample multimedia search. In MM, 2014. [8] K. Tang, V. Ramanathan, L. Fei-Fei, and D. Koller. Shifting weights: Adapting object detectors from image to video. In NIPS, 2012. [9] Z. Lan, L. Jiang, S. I. Yu, et al. CMU-Informedia at TRECVID 2013 multimedia event detection. In TRECVID, 2013. [10] F. Khan, X. J. Zhu, and B. Mutlu. How do humans teach: On curriculum learning and teaching dimension. In NIPS, 2011. [11] M. P. Kumar, H. Turki, D. Preston, and D. Koller. Learning specfic-class segmentation from diverse data. In ICCV, 2011. [12] J. S. Supancic and D. Ramanan. Self-paced learning for long-term tracking. In CVPR, 2013. [13] Y. J. Lee and K. Grauman. Learning the easy things first: Self-paced visual category discovery. In CVPR, 2011. [14] M. Yuan and Y. Lin. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B 68(1):49-67, 2006. [15] P. Over, G. Awad, M. Michel, et al. TRECVID 2013 - an overview of the goals, tasks, data, evaluation mechanisms and metrics. In TRECVID, 2013. [16] L. Breiman. Random forests. Machine learning. 45(1):5-32, 2001. [17] L. Jiang, A. Hauptmann, and G. Xiang. Leveraging high-level and low-level features for multimedia event detection. In MM, 2012. [18] J. Friedman. Stochastic Gradient Boosting. Coputational Statistics and Data Analysis. 38(4):367-378, 2002. [19] L. Jiang, T. Mitamura, S. Yu, and A. Hauptmann. Zero-Example Event Search using MultiModal Pseudo Relevance Feedback. In ICMR, 2014. [20] J. Deng, W. Dong, R. Socher, L. J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. [21] M. Marszalek, I. Laptev, and C. Schmid. Actions in context. In CVPR, 2009. [22] J. C. Niebles, C. W. Chen, and L. Fei-Fei. Modeling temporal structure of decomposable motion segments for activity classification. In ECCV, 2010. [23] H. Wang and C. Schmid. Action recognition with improved trajectories. In ICCV, 2013. [24] Z. Lan, X. Li, and A. Hauptmann. Temporal Extension of Scale Pyramid and Spatial Pyramid Matching for Action Recognition. In arXiv preprint arXiv:1408.7071, 2014. [25] E. Vig, M. Dorr, and D. Cox. Space-variant descriptor sampling for action recognition based on saliency and eye movements. In ECCV, 2012. [26] Y. G. Jiang, Q. Dai, X. Xue, W. Liu, and C. W. Ngo. Trajectory-based modeling of human actions with motion reference points. In ECCV, 2012. [27] M. Jain, H. J´egou, and P. Bouthemy. Better exploiting motion for better action recognition. In CVPR, 2013. [28] W. Brendel and S. Todorovic. Learning spatiotemporal graphs of human activities. In ICCV, 2011. [29] A. Gaidon, Z. Harchaoui, and C. Schmid. Recognizing activities with cluster-trees of tracklets. In BMVC, 2012 9
2014
321
5,427
Inference by Learning: Speeding-up Graphical Model Optimization via a Coarse-to-Fine Cascade of Pruning Classifiers Bruno Conejo∗ GPS Division, California Institute of Technology, Pasadena, CA, USA Universite Paris-Est, Ecole des Ponts ParisTech, Marne-la-Vallee, France bconejo@caltech.edu Nikos Komodakis Universite Paris-Est, Ecole des Ponts ParisTech, Marne-la-Vallee, France nikos.komodakis@enpc.fr Sebastien Leprince & Jean Philippe Avouac GPS Division, California Institute of Technology, Pasadena, CA, USA leprincs@caltech.edu avouac@gps.caltech.edu Abstract We propose a general and versatile framework that significantly speeds-up graphical model optimization while maintaining an excellent solution accuracy. The proposed approach, refereed as Inference by Learning or in short as IbyL, relies on a multi-scale pruning scheme that progressively reduces the solution space by use of a coarse-to-fine cascade of learnt classifiers. We thoroughly experiment with classic computer vision related MRF problems, where our novel framework constantly yields a significant time speed-up (with respect to the most efficient inference methods) and obtains a more accurate solution than directly optimizing the MRF. We make our code available on-line [4]. 1 Introduction Graphical models in computer vision Optimization of undirected graphical models such as Markov Random Fields, MRF, or Conditional Random Fields, CRF, is of fundamental importance in computer vision. Currently, a wide spectrum of problems including stereo matching [25, 13], optical flow estimation [27, 16], image segmentation [23, 14], image completion and denoising [10], or, object recognition [8, 2] rely on finding the mode of the distribution associated to the random field, i.e., the Maximum A Posteriori (MAP) solution. The MAP estimation, often referred as the labeling problem, is posed as an energy minimization task. While this task is NP-Hard, strong optimum solutions or even the optimal solutions can be obtained [3]. Over the past 20 years, tremendous progress has been made in term of computational cost, and, many different techniques have been developed such as move making approaches [3, 19, 22, 21, 28], and message passing methods [9, 32, 18, 20]. A review of their effectiveness has been published in [31, 12]. Nevertheless, the ever increasing dimensionality of the problems and the need for larger solution space greatly challenge these tech∗This work was supported by USGS through the Measurements of surface ruptures produced by continental earthquakes from optical imagery and LiDAR project (USGS Award G13AP00037), the Terrestrial Hazard Observation and Reporting Center of Caltech, and the Moore foundation through the Advanced Earth Surface Observation Project (AESOP Grant 2808). 1 niques as even the best ones have a highly super-linear computational cost and memory requirement relatively to the dimensionality of the problem. Our goal in this work is to develop a general MRF optimization framework that can provide a significant speed-up for such methods while maintaining the accuracy of the estimated solutions. Our strategy for accomplishing this goal will be to gradually reduce (by a significant amount) the size of the discrete state space via exploiting the fact that an optimal labeling is typically far from being random. Indeed, most MRF optimization problems favor solutions that are piecewise smooth. In fact, this spatial structure of the MAP solution has already been exploited in prior work to reduce the dimensionality of the solution space. Related work A first set of methods of this type, referred here for short as the super-pixel approach [30], defines a grouping heuristic to merge many random variables together in super-pixels. The grouping heuristic can be energy-aware if it is based on the energy to minimize as in [15], or, energyagnostic otherwise as in [7, 30]. All random variables belonging to the same super-pixel are forced to take the same label. This restricts the solution space and results in an optimization speed-up as a smaller number of variables needs to be optimized. The super-pixel approach has been applied with segmentation, stereo and object recognition [15]. However, if the grouping heuristic merges variables that should have a different label in the MAP solution, only an approximate labeling is computed. In practice, defining general yet efficient grouping heuristics is difficult. This represents the key limitation of super-pixel approaches. One way to overcome this limitation is to mimic the multi-scale scheme used in continuous optimization by building a coarse to fine representation of the graphical model. Similarly to the superpixel approach, such a multi-scale method, relies again on a grouping of variables for building the required coarse to fine representation [17, 24, 26]. However, contrary to the super-pixel approach, if the grouping merges variables that should have a different label in the MAP solution, there always exists a scale at which these variables are not grouped. This property thus ensures that the MAP solution can still be recovered. Nevertheless, in order to manage a significant speed-up of the optimization, the multi-scale approach also needs to progressively reduce the number of labels per random variable (i.e., the solution space). Typically, this is achieved by use, for instance, of a heuristic that keeps only a small fixed number of labels around the optimal label of each node found at the current scale, while pruning all other labels, which are therefore not considered thereafter [5]. This strategy, however, may not be optimal or even valid for all types of problems. Furthermore, such a pruning heuristic is totally inappropriate (and can thus lead to errors) for nodes located along discontinuity boundaries of an optimal solution, where such boundaries are always expected to exist in practice. An alternative strategy followed by some other methods relies on selecting a subset of the MRF nodes at each scale (based on some criterion) and then fixing their labels according to the optimal solution estimated at the current scale (essentially, such methods contract the entire label set of a node to a single label). However, such a fixing strategy may be too aggressive and can also easily lead to eliminating good labels. Proposed approach Our method simultaneously makes use of the following two strategies for speeding-up the MRF optimization process: (i) it solves the problem through a multi-scale approach that gradually refines the MAP estimation based on a coarse-to-fine representation of the graphical model, (ii) and, at the same time, it progressively reduces the label space of each variable by cleverly utilizing the information computed during the above coarse-to-fine process. To achieve that, we propose to significantly revisit the way that the pruning of the solution space takes place. More specifically: (i) we make use of and incorporate into the above process a fine-grained pruning scheme that allows an arbitrary subset of labels to be discarded, where this subset can be different for each node, (ii) additionally, and most importantly, instead of trying to manually come up with some criteria for deciding what labels to prune or keep, we introduce the idea of relying entirely on a sequence of trained classifiers for taking such decisions, where different classifiers per scale are used. 2 We name such an approach Inference by Learning, and show that it is particularly efficient and effective in reducing the label space while omitting very few correct labels. Furthermore, we demonstrate that the training of these classifiers can be done based on features that are not application specific but depend solely on the energy function, which thus makes our approach generic and applicable to any MRF problem. The end result of this process is to obtain both an important speed-up and a significant decrease in memory consumption as the solution space is progressively reduced. Furthermore, as each scale refines the MAP estimation, a further speed-up is obtained as a result of a warm-start initialization that can be used when transitioning between different scales. Before proceeding, it is worth also noting that there exists a body of prior work [29] that focuses on fixing the labels of a subset of nodes of the graphical model by searching for a partial labeling with the so-called persistency property (which means that this labeling is provably guaranteed to be part of an optimal solution). However, finding such a set of persistent variables is typically very time consuming. Furthermore, in many cases only a limited number of these variables can be detected. As a result, the focus of these works is entirely different from ours, since the main motivation in our case is how to obtain a significant speed-up for the optimization. Hereafter, we assume without loss of generality that the graphical model is a discrete pairwise CRF/MRF. However, one can straightforwardly apply our approach to higher order models. Outline of the paper We briefly review the optimization problem related to a discrete pairwise MRF and introduce the necessary notations in section 2. We describe our general multi-scale pruning framework in section 3. We explain how classifiers are trained in section 4. Experimental results and their analysis are presented in 5. Finally, we conclude the paper in section 6. 2 Notation and preliminaries To represent a discrete MRF model M, we use the following notation M = V, E, L, {φi}i∈V, {φij}(i,j)∈E  . (1) Here V and E represent respectively the nodes and edges of a graph, and L represents a discrete label set. Furthermore, for every i ∈V and (i, j) ∈E, the functions φi : L →R and φij : L2 →R represent respectively unary and pairwise costs (that are also known connectively as MRF potentials φ =  {φi}i∈V, {φij}(i,j)∈E ). A solution x = (xi)i∈V of this model consists of one variable per vertex i, taking values in the label set L, and the total cost (energy) E(x|M) of such a solution is E(x|M) = X i∈V φi(xi) + X (i,j)∈E φij(xi, xj) . The goal of MAP estimation is to find a solution that has minimum energy, i.e., computes xMAP = arg min x∈L|V| E(x|M) . The above minimization takes place over the full solution space of model M, which is L|V|. Here we will also make use of a pruned solution space S(M, A), which is defined based on a binary function A : V × L →{0, 1} (referred to as the pruning matrix hereafter) that specifies the status (active or pruned) of a label for a given vertex, i.e., A(i, l) =  1 if label l is active at vertex i 0 if label l is pruned at vertex i (2) During optimization, active labels are retained while pruned labels are discarded. Based on a given A, the corresponding pruned solution space of model M is defined as S(M, A) = n x ∈L|V| | (∀i), A(i, xi) = 1 o . 3 Multiscale Inference by Learning In this section we describe the overall structure of our MAP estimation framework, beginning by explaining how to construct the coarse-to-fine representation of the input graphical model. 3 3.1 Model coarsening Given a model M (defined as in (1)), we wish to create a “coarser” version of this model M′ = V′, E′, L, {φ′ i}i∈V′, {φ′ ij}(i,j)∈E′ . Intuitively, we want to partition the nodes of M into groups, and treat each group as a single node of the coarser model M′ (the implicit assumption is that nodes of M that are grouped together are assigned the same label). To that end, we will make use of a grouping function g : V →N. The nodes and edges of the coarser model are then defined as follows Figure 1: Black circles: V, Black lines: E, Red squares: V′, Blue lines: E′. V′ = {i′ | ∃i ∈V, i′ = g(i)} , (3) E′ = {(i′, j′) | ∃(i, j) ∈E, i′ = g(i), j′ = g(j), i′ ̸= j′} . (4) Furthermore, the unary and pairwise potentials of M′ are given by (∀i′ ∈V′), φ′ i′(l) = P i∈V|i′=g(i) φi(l) + P (i,j)∈E|i′=g(i)=g(j) φij(l, l) , (5) (∀(i′, j′) ∈E′), φ′ i′j′(l0, l1) = X (i,j)∈E|i′=g(i),j′=g(j) φij(l0, l1) . (6) With a slight abuse of notation, we will hereafter use g(M) to denote the coarser model resulting from M when using the grouping function g, i.e., we define g(M) = M′. Also, given a solution x′ of M′, we can “upsample” it into a solution x of M by setting xi = x′ g(i) for each i ∈V. We will use the following notation in this case: g−1(x′) = x. We provide a toy example in supplementary materials. 3.2 Coarse-to-fine optimization and label pruning To estimate the MAP of an input model M, we first construct a series of N +1 progressively coarser models (M(s))0≤s≤N by use of a sequence of N grouping functions (g(s))0≤s<N, where M(0) = M and (∀s), M(s+1) = g(s)(M(s)) . This provides a multiscale (coarse-to-fine) representation of the original model., where the elements of the resulting models are denoted as follows: M(s) =  V(s), E(s), L, {φ(s) i }i∈V(s), {φ(s) ij }(i,j)∈E(s)  In our framework, MAP estimation proceeds from the coarsest to the finest scale (i.e., from model M(N) to M(0)). During this process, a pruning matrix A(s) is computed at each scale s, which is used for defining a restricted solution space S(M(s), A(s)). The elements of the matrix A(N) at the coarsest scale are all set equal to 1 (i.e., no label pruning is used in this case), whereas in all other scales A(s) is computed by use of a trained classifier f (s). More specifically, at any given scale s, the following steps take place: i. We approximately minimize (via any existing MRF optimization method) the energy of the model M(s) over the restricted solution space S(M(s), A(s)), i.e., we compute x(s) ≈arg minx∈S(M(s),A(s)) E(x|M(s)) . ii. Given the estimated solution x(s), a feature map z(s) : V(s) × L →RK is computed at the current scale, and a trained classifier f (s) : RK →{0, 1} uses this feature map z(s) to construct the pruning matrix A(s−1) for the next scale as follows (∀i ∈V(s−1), ∀l ∈L), A(s−1)(i, l) = f (s)(z(s)(g(s−1)(i), l)) . iii. Solution x(s) is “upsampled” into x(s−1) = [g(s−1)]−1(x(s)) and used as the initialization for the optimization at the next scale s −1. Note that, due to (5) and (6), it holds E(x(s−1)|M(s−1)) = E(x(s)|M(s)). Therefore, this initialization ensures that energy will continually decrease if the same is true for the optimization applied per scale. Furthermore, it can allow for a warm-starting strategy when transitioning between scales. The pseudocode of the resulting algorithm appears in Algo. 1. 4 Algorithm 1: Inference by learning framework Data: Model M, grouping functions (g(s))0≤s<N, classifiers (f (s))0<s≤N Result: x(0) Compute the coarse to fine sequence of MRFs: M(0) ←M for s = [0 . . . N −1] do M(s+1) ←g(s)(M(s)) Optimize the coarse to fine sequence of MRFs over pruned solution spaces: (∀i ∈V(N), ∀l ∈L), A(N)(i, l) ←1 Initialize x(N) for s = [N...0] do Update x(s) by iterative minimization: x(s) ≈arg minx∈S(M(s),A(s)) E(x|M(s)) if s ̸= 0 then Compute feature map z(s) Update pruning matrix for next finer scale: A(s−1)(i, l) = f (s)(z(s)(g(s−1)(i), l)) Upsample x(s) for initializing solution x(s−1) at next scale: x(s−1) ←[g(s−1)]−1(x(s)) 4 Features and classifier for label pruning For each scale s, we explain how the set of features comprising the feature map z(s) is computed and how we train (off-line) the classifier f (s). This is a crucial step for our approach. Indeed, if the classifier wrongly prunes labels that belong to the MAP solution, then, only an approximate labeling might be found at the finest scale. Moreover, keeping too many active labels will result in a poor speed-up for MAP estimation. 4.1 Features The feature map z(s) : V(s) × L →RK is formed by stacking K individual real-valued features defined on V(s) × L. We propose to compute features that are not application specific but depend solely on the energy function and the current solution x(s). This makes our approach generic and applicable to any MRF problem. However, as we establish a general framework, specific application features can be straightforwardly added in future work. Presence of strong discontinuity This binary feature, PSD(s), accounts for the existence of discontinuity in solution x(s) when a strong link (i.e., φij(x(s) i , x(s) j ) > ρ) exists between neighbors. Its definition follows for any vertex i ∈V(s) and any label l ∈L : PSD(s)(i, l) =  1 ∃(i, j) ∈E(s)| φij(x(s) i , x(s) j ) > ρ 0 otherwise (7) Local energy variation This feature represents the local variation of the energy around the current solution x(s). It accounts for both the unary and pairwise terms associated to a vertex and a label. As in [11], we remove the local energy of the current solution as it leads to a higher discriminative power. The local energy variation feature, LEV(s), is defined for any i ∈V(s) and l ∈L as follows: LEV(s)(i, l) = φ(s) i (l) −φ(s) i (x(s) i ) N (s) V (i) + X j:(i,j)∈E(s) φ(s) ij (l, x(s) j ) −φ(s) ij (x(s) i , x(s) j ) N (s) E (i) (8) with N (s) V (i) = card{i′ ∈V(s−1) : g(s−1)(i′) = i} and N (s) E (i) = card{(i′, j′) ∈E(s−1) : g(s−1)(i′) = i, g(s−1)(j′) = j}. Unary “coarsening” This feature, UC(s), aims to estimate an approximation of the coarsening induced in the MRF unary terms when going from model M(s−1) to model M(s), i.e., as a result of 5 applying the grouping function g(s−1). It is defined for any i ∈V(s) and l ∈L as follows UC(s)(i, l) = X i′∈V(s−1)|g(s−1)(i′)=i |φ(s−1) i′ (l) −φ(s) i (l) N (s) V (i)| N (s) V (i) (9) Feature normalization The features are by design insensitive to any additive term applied on all the unary and pairwise terms. However, we still need to apply a normalization to the LEV(s) and UC(s) features to make them insensitive to any positive global scaling factor applied on both the unary and pairwise terms (such scaling variations are commonly used in computer vision). Hence, we simply divide group of features, LEV(s) and UC(s) by their respective mean value. 4.2 Classifier To train the classifiers, we are given as input a set of MRF instances (all of the same class, e.g., stereo-matching) along with the ground truth MAP solutions. We extract a subset of MRFs for offline learning and a subset for on-line testing. For each MRF instance in the training set, we apply the algorithm 1 without any pruning (i.e., A(s) ≡1) and, at each scale, we keep track of the features z(s) and also compute the binary function X(s) MAP : V(s) × L →{0, 1} defined as follows: (∀i ∈V, ∀l ∈L), X(0) MAP(i, l) = 1, if l is the ground truth label for node i 0, otherwise (∀s > 0)(∀i ∈V(s), ∀l ∈L), X(s) MAP(i, l) = _ i′∈V(s−1):g(s)(i′)=i X(s−1) MAP (i′, l) , where W denotes the binary OR operator. The values 0 and 1 in X(s) MAP define respectively the two classes c0 and c1 when training the classifier f (s), where c0 means that the label can be pruned and c1 that the label should not be pruned. To treat separately the nodes that are on the border of a strong discontinuity, we split the feature map z(s) into two groups z(s) 0 and z(s) 1 , where z(s) 0 contains only features where PSD(s) = 0 and z(s) 1 contains only features where PSD(s) = 1 (strong discontinuity). For each group, we train a standard linear C-SVM classifier with l2-norm regularization (regularization parameter was set to C = 10). The linear classifiers give good enough accuracy during training while also being fast to evaluate at test time During training (and for each group), we also introduce weights to balance the different number of elements in each class (c0 is much larger than c1), and to also strongly penalize misclassification in c1 (as such misclassification can have a more drastic impact on the accuracy of MAP estimation). To accomplish that, we set the weight for class c0 to 1, and the weight for class c1 to λ card(c0) card(c1), where card(·) counts the number of training samples in each class. Parameter λ is a positive scalar (common to both groups) used for tuning the penalization of misclassification in c1 (it will be referred to as the pruning aggressiveness factor hereafter as it affects the amount of labels that get pruned). During on-line testing, depending on the value of the PSD feature, f (s) applies the linear classifier learned on group z(s) 0 if PSD(s) = 0, or the linear classifier learned on group z(s) 1 if PSD(s) = 1. 5 Experimental results We evaluate our framework on pairwise MRFs from stereo-matching, image restoration, and, optical flow estimation problems. The corresponding MRF graphs consist of regular 4-connected grids in this case. At each scale, the grouping function merges together vertices of 2 × 2 subgrids. We leave more advanced grouping functions [15] for future work. As MRF optimization subroutine, we use the Fast-PD algorithm [21]. We make our code available on-line [4]. Experimental setup For the stereo matching problem, we estimate the disparity map from images IR and IL where each label encodes a potential disparity d (discretized at quarter of a pixel precision), with MRF potentials φp(d) = ||IL(yp, xp)−IR(yp, xp−d)||1 and φpq(d0, d1) = wpq|d0−d1|, with the weight wpq varying based on the image gradient (parameters are adjusted for each sequence). We train the classifier on the well-known Tsukuba stereo-pair (61 labels), and use all other 6 (a) Speed-up (b) Active label ratio (c) Energy ratio (d) Label agreement Figure 2: Performance of our Inference by Learning framework: (Top row) stereo matching, (Middle row) optical flow, (Bottom row) image restoration. For stereo matching, the Average Middlebury curve represents the average value of the statistic for the entire Middlebury dataset [6] (2001, 2003, 2005 and 2006) (37 stereopairs). stereo-pairs of [6] (2001, 2003, 2005 and 2006) for testing. For image restoration, we estimate the pixel intensity of a noisy and incomplete image I with MRF potentials φp(l) = ||I(yp, xp) −l||2 2 and φ(l0, l1) = 25 min(||l0 −l1||2 2, 200). We train the classifier on the Penguin image stereo-pair (256 labels), and use House (256 labels) for testing (dataset [31]). For the optical flow estimation, we estimate a subpixel-accurate 2D displacement field between two frames by extending the stereo matching formulation to 2D. Using the dataset of [1], we train the classifier on Army (1116 labels), and test on RubberWhale (625 labels) and Dimetrodon (483 labels). For all experiments, we use 5 scales and set in (7) ρ = 5 ¯wpq with ¯wpq being the mean value of edge weights. Evaluations We evaluate three optimization strategies: the direct optimization (i.e., optimizing the full MRF at the finest scale), the multi-scale optimization (λ = 0, i.e., our framework without any pruning), and our Inference by Learning optimization, where we experiment with different error ratios λ that range between 0.001 and 1. We assess the performance by computing the energy ratio, i.e., the ratio between the current energy and the energy computed by the direct optimization, the best label agreement, i.e., the proportion of labels that coincides with the labels of the lowest computed energy, the speed-up factor, i.e., the ratio of computation time between the direct optimization and the current optimization strategy, and, the active label ratio, i.e., the percentage of active labels at the finest scale. Results and discussion For all problems, we present in Fig. 2 the performance of our Inference by Learning approach for all tested aggressiveness factors and show in Fig. 3 estimated results for λ = 0.01. We present additional results in the supplementary material. For every problem and aggressiveness factors until λ = 0.1, our pruning-based optimization obtains a lower energy (column (c) of Fig. 2) in less computation time, achieving a speed-up factor (column (a) of Fig. 2) close to 5 for Stereo-matching, above 10 for Optical-flow and up to 3 for image restoration. (note that these speed-up factors are with respect to an algorithm, FastPD, that was the most efficient one in recent comparisons [12]). The percentage of active labels (Fig. 2 column (b)) strongly correlates with the speed-up factor. The best labeling agreement (Fig. 2 column (d)) is never worse than 97% (except for the image restoration problems because of the in-painted area) 7 Tsukuba Venus Teddy Army Dimet. House (a) (b) (c) (d) (e) (f) Figure 3: Results of our Inference by Learning framework for λ = 0.1. Each row is a different MRF problem. (a) original image, (b) ground truth, (c) solution of the pruning framework, (d,e,f) percentage of active labels per vertex for scale 0, 1 and 2 (black 0%, white 100%). and is always above 99% for λ ⩽0.1. As expected, less pruning happens near label discontinuities as illustrated in column (d,e,f) of Fig. 3 justifying the use of a dedicated linear classifier. Moreover, large homogeneously labeled regions are pruned earlier in the coarse to fine scale. 6 Conclusion and future work Our Inference by Learning approach consistently speeds-up the graphical model optimization by a significant amount while maintaining an excellent accuracy of the labeling estimation. On most experiments, it even obtains a lower energy than direct optimization. In future work, we plan to experiment with problems that require general pairwise potentials where message-passing techniques can be more effective than graph-cut based methods but are at the same time much slower. Our framework is guaranteed to provide an even more dramatic speedup in this case since the computational complexity of message-passing methods is quadratic with respect to the number of labels while being linear for graph-cut based methods used in our experiments. We also intend to explore the use of application specific features, learn the grouping functions used in the coarse-to-fine scheme, jointly train the cascade of classifiers, and apply our framework to high order graphical models. References [1] S. Baker, S. Roth, D. Scharstein, M.J. Black, J. P. Lewis, and R. Szeliski. A database and evaluation methodology for optical flow. In ICCV 2007., 2007. [2] Martin Bergtholdt, J¨org Kappes, Stefan Schmidt, and Christoph Schn¨orr. A study of parts-based object class detection using complete graphs. IJCV, 2010. [3] Y. Boykov, O. Veksler, and R. Zabih. Fast approximate energy minimization via graph cuts. PAMI, 2001. [4] B. Conejo. http://imagine.enpc.fr/˜conejob/ibyl/. 8 [5] B. Conejo, S. Leprince, F. Ayoub, and J. P. Avouac. Fast global stereo matching via energy pyramid minimization. ISPRS Ann. Photogramm. Remote Sens. Spatial Inf. Sci., 2014. [6] Middlebury Stereo Datasets. [7] Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient graph-based image segmentation. IJCV, 2004. [8] Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Pictorial structures for object recognition. IJCV, 2005. [9] P.F. Felzenszwalb and D.P. Huttenlocher. Efficient belief propagation for early vision. In CVPR, 2004. [10] W.T. Freeman and E.C. Pasztor. Learning low-level vision. In ICCV, 1999. [11] Xiaoyan Hu and P. Mordohai. A quantitative evaluation of confidence measures for stereo vision. PAMI., 2012. [12] J.H. Kappes, B. Andres, F.A. Hamprecht, C. Schnorr, S. Nowozin, D. Batra, Sungwoong Kim, B.X. Kausler, J. Lellmann, N. Komodakis, and C. Rother. A comparative study of modern inference techniques for discrete energy minimization problems. In CVPR, 2013. [13] Junhwan Kim, V. Kolmogorov, and R. Zabih. Visual correspondence using energy minimization and mutual information. In ICCV, 2003. [14] S. Kim, C. Yoo, S. Nowozin, and P. Kohli. Image segmentation using higher-order correlation clustering, 2014. [15] Taesup Kim, S. Nowozin, P. Kohli, and C.D. Yoo. Variable grouping for energy minimization. In CVPR, 2011. [16] T. Kohlberger, C. Schnorr, A. Bruhn, and J. Weickert. Domain decomposition for variational optical-flow computation. IEEE Transactions on Information Theory/Image Processing, 2005. [17] Pushmeet Kohli, Victor S. Lempitsky, and Carsten Rother. Uncertainty driven multi-scale optimization. In DAGM-Symposium, 2010. [18] V. Kolmogorov. Convergent tree-reweighted message passing for energy minimization. PAMI, 2006. [19] V. Kolmogorov and R. Zabin. What energy functions can be minimized via graph cuts? PAMI, 2004. [20] N. Komodakis, N. Paragios, and G. Tziritas. Mrf optimization via dual decomposition: Message-passing revisited. In CVPR, 2007. [21] N. Komodakis, G. Tziritas, and N. Paragios. Fast, approximately optimal solutions for single and dynamic mrfs. In CVPR, 2007. [22] M. Pawan Kumar and Daphne Koller. Map estimation of semi-metric mrfs via hierarchical graph cuts. In UAI, 2009. [23] M.P. Kumar, P.H.S. Ton, and A. Zisserman. Obj cut. In CVPR, 2005. [24] H. Lombaert, Yiyong Sun, L. Grady, and Chenyang Xu. A multilevel banded graph cuts method for fast image segmentation. In ICCV 2005., 2005. [25] T. Meltzer, C. Yanover, and Y. Weiss. Globally optimal solutions for energy minimization in stereo vision using reweighted belief propagation. In ICCV, 2005. [26] P. Perez and F. Heitz. Restriction of a markov random field on a graph and multiresolution statistical image modeling. IEEE Transactions on Information Theory/Image Processing, 1996. [27] S. Roth and M.J. Black. Fields of experts: a framework for learning image priors. In CVPR, 2005. [28] C. Rother, V. Kolmogorov, V. Lempitsky, and M. Szummer. Optimizing binary mrfs via extended roof duality. In CVPR, 2007. [29] Alexander Shekhovtsov. Maximum persistency in energy minimization. In CVPR, 2014. [30] Jianbo Shi and Jitendra Malik. Normalized cuts and image segmentation. PAMI., 2000. [31] R. Szeliski, R. Zabih, D. Scharstein, O. Veksler, V. Kolmogorov, Aseem Agarwala, M. Tappen, and C. Rother. A comparative study of energy minimization methods for markov random fields with smoothness-based priors. PAMI, 2008. [32] M.J. Wainwright, T.S. Jaakkola, and A.S. Willsky. Map estimation via agreement on trees: messagepassing and linear programming. IEEE Transactions on Information Theory/Image Processing, 2005. 9
2014
322
5,428
Capturing Semantically Meaningful Word Dependencies with an Admixture of Poisson MRFs David I. Inouye Pradeep Ravikumar Inderjit S. Dhillon Department of Computer Science University of Texas at Austin {dinouye,pradeepr,inderjit}@cs.utexas.edu Abstract We develop a fast algorithm for the Admixture of Poisson MRFs (APM) topic model [1] and propose a novel metric to directly evaluate this model. The APM topic model recently introduced by Inouye et al. [1] is the first topic model that allows for word dependencies within each topic unlike in previous topic models like LDA that assume independence between words within a topic. Research in both the semantic coherence of a topic models [2, 3, 4, 5] and measures of model fitness [6] provide strong support that explicitly modeling word dependencies—as in APM—could be both semantically meaningful and essential for appropriately modeling real text data. Though APM shows significant promise for providing a better topic model, APM has a high computational complexity because O(p2) parameters must be estimated where p is the number of words ([1] could only provide results for datasets with p = 200). In light of this, we develop a parallel alternating Newton-like algorithm for training the APM model that can handle p = 104 as an important step towards scaling to large datasets. In addition, Inouye et al. [1] only provided tentative and inconclusive results on the utility of APM. Thus, motivated by simple intuitions and previous evaluations of topic models, we propose a novel evaluation metric based on human evocation scores between word pairs (i.e. how much one word “brings to mind” another word [7]). We provide compelling quantitative and qualitative results on the BNC corpus that demonstrate the superiority of APM over previous topic models for identifying semantically meaningful word dependencies. (MATLAB code available at: http://bigdata.ices.utexas.edu/software/apm/) 1 Introduction and Related Work In standard topic models such as LDA [8, 9], the primary representation for each topic is simply a list of top 10 or 15 words. To understand a topic, a person must manually consider many of the possible 10 2  pairwise relationships as well as possibly larger m-wise relationships and attempt to infer abstract meaning from this list of words. Of all the 10 2  pairwise relationships probably a very small number of them are direct relationships. For example, a topic with the list of words “money”, “fund”, “exchange” and “company” can be understood as referring to investment but this can only be inferred from a very high-level human abstraction of meaning. This problem has given rise to research on automatically labeling topics with a topic word or phrase that summarizes the topic [10, 11, 12]. [13] propose to evaluate topic models by randomly replacing a topic word with a random word and evaluating whether a human can identify the intruding word. The intuition for this metric is that the top words of a good topic will be related, and therefore, a person will be able to easily identify the word that does not have any relationship to the other words. [2, 3, 5] compute statistics related to Pointwise Mutual Information for all pairs of top words in a topic and attempt to correlate this with human judgments. All of these metrics suggest that capturing 1 semantically meaningful relationships between pairs of words is fundamental to the interpretability and usefulness of topic models as a document summarization and exploration tool. In light of these metrics, [1] recently proposed a topic model called Admixture of Poisson MRFs (APM) that relaxes the independence assumption for the topic distributions and explicitly models word dependencies. This can be motivated in part by [6] who investigated whether the Multinomial (i.e. independent) assumption of word-topic distributions actually fits real-world text data. Somewhat unsurprisingly, [6] found that the Multinomial assumption was often violated and thus gives evidence that models with word dependencies—such as APM—may be a fundamentally more appropriate model for text data. Previous research in topic modeling has implicitly uncovered this issue with model misfit by finding that models with 50, 100 or even 500 topics tend to perform better on semantic coherence experiments than smaller models with only 10 or 20 topics [4]. Though using more topics may allow topic models to ignore the issue of word dependencies, using more topics can make the coherence of a topic model more difficult as suggested by [4] who found that using 100 or 500 topics did not significantly improve the coherence results over 50 topics. Intuitively, a topic model with a much smaller number of topics (e.g. 5 or 10) is easier to comprehend. For instance, if training on newspaper text, the number of topics could roughly correspond to the number of sections in a newspaper such as news, weather and sports. Or, if modeling an encyclopedia, the top-level topics could be art, history, science, and society. Thus, rather than using more topics, APM opens the way for a promising topic model that can overcome this model misfit issue while only using a small number of topics. Even though APM shows promise for being a significantly more powerful and more realistic topic model than previous models, the original paper acknowledged the significant computational complexity. Instead of needing to fit O(k(n + p)) parameters, APM needs to estimate O(k(n + p2)) parameters. [1] suggested that by using a sparsity prior (i.e. ℓ1 regularization of the likelihood), this computational complexity could be reduced. However, [1] could only produce some quantitative results on a very small dataset with only 200 words. In addition, the quantitative results from [1] were tentative and inconclusive on whether APM could actually perform better than LDA in coherence experiments. Therefore, in this paper, we seek to answer two major open questions regarding APM: 1) Is there an algorithm that can overcome the computational complexity of APM and handle real-world datasets? 2) Does the APM model actually capture more semantically interesting concepts that were not possible with previous topic models? We answer the first question by developing a parallel alternating algorithm whose independent subproblems are solved using a Newton-like algorithm similar to the algorithms developed for sparse inverse covariance estimation [14]. As in [14], this new APM algorithm exploits the sparsity of the solution to significantly reduce the computational time for computing the approximate Newton direction. However, unlike [14], the APM model is solving for k Poisson MRFs simultaneously whereas [14] is only solving for a single Gaussian MRF. Another difference from [14] is that the whole algorithm can be easily parallelized up to min(n, p). For the second question about the semantic utility of APM, we develop a novel evaluation metric that more directly evaluates the APM model against human judgments of semantic relatedness—a notion called evocation introduced by [7]. Intuitively, the idea is that humans seek to understand traditional topic models by looking at the list of top words. They will implicitly attempt to find how these words are related and extract some more abstract meaning that generalizes the set of words. Thus, this evaluation metric attempts to explicitly score how well pairs of words capture some semantically meaningful word dependency. Previous research has evaluated topic models using word similarity measures [4]. However, our work is different from [4] in three significant ways: 1) our metrics use evocation rather than similarity (e.g. antonyms should have high evocation but low similarity), 2) we evaluate top individual word pairs instead of rough aggregate statistics, and 3) we evaluate a topic model that directly captures word dependencies (i.e. APM). We demonstrate that APM substantially outperforms other topic models in both quantitative and qualitative ways. 2 Background on Admixture of Poisson MRFs (APM) Admixtures The general notion of admixtures introduced by [1] generalizes many previous topic models including PLSA [15], LDA [8], and the Spherical Admixture Model (SAM) [16]. Admix2 tures have also been known as mixed membership models [17]. In contrast to mixture distributions which assume that each observation is drawn from 1 of k component distributions, admixture distributions assume that each observation is drawn from an admixed distribution whose parameters are a mixture of component parameters. As examples of admixtures, PLSA and LDA are admixtures of Multinomials whereas SAM is an admixture of Von-Mises Fisher distributions. In addition, because of the connections between Poissons and Multinomials, PLSA and LDA can be seen as admixtures of independent Poisson distributions [1]. Poisson MRFs (PMRF) Yang et al. [18] introduced a multivariate generalization of the Poisson that assumes that the conditional distributions are univariate Poisson which is similar to a Gaussian MRF whose conditionals are Gaussian (unlike a Guassian MRF, however, the marginals are not univariate Poisson). A PMRF can be parameterized by a node vector θ and an edge matrix Θ whose non-zeros encode the direct dependencies between words: PrPMRF(x | θ, Θ) = exp θT x+xT Θx− Pp s=1 ln(xs!) −A (θ, Θ)  , where A (θ, Θ) is the log partition function needed for normalization. This formulation needs to be slightly modified to allow for positive edges using the ideas from [19]. The log partition function can be approximated by using the pseudo log-likelihood instead of the true likelihood, which means that A (θ, Θ) ≈Pp s=1 exp(θs + xT Θs). The reader should note that because this is an MRF distribution, all the properties of MRFs apply to PMRFs including that a word is independent of all other words given the value of its neighbors. For example, in a chain graph, all the variables are correlated with each other but they have a much simpler dependency structure that can be encoded with O(n) parameters. Therefore, PMRFs more directly and succinctly capture the dependencies between words as opposed to other simple statistics such as covariance or pointwise mutual information. Admixture of Poisson MRFs (APM) Inouye et al. [1] essentially constructed a new admixture model by using Poisson MRFs as the topic-word distributions instead of the usual Multinomial as in LDA. This allows for word dependencies within each topic. For example, if the word “classification” appears in a document, “supervised” is more likely to appear than in general documents. Given the admixture weights vector for a document the likelihood of a document is simply: PrAPM(x | w, θ1...k, Θ1...k) = PrPMRF x | θ = Pk j=1 wjθj, Θ = Pk j=1 wjΘj (please see Appendix A for notational conventions used throughout the paper). Inouye et al. [1] define a Dirichlet(α) prior on the admixture weights and a conjugate prior with hyperparameter β on the PMRF parameters which can be easily incorporated as pseudo counts. For our experiments as described in Sec. 4.1, we set α = 1 (i.e. a uniform prior on admixture weights) and β = {0, 1}. 3 Parallel Alternating Newton-like Algorithm for APM In the original APM paper [1], parameters were estimated by maximizing the joint approximate posterior over all variables.1 Instead of maximizing jointly over all parameters, we split the problem into alternating convex optimization problems. Let us denote the likelihood part (i.e. the smooth part) of the optimization function as g(W, θ1...k, Θ1...k) and the non-smooth ℓ1 regularization term as h where the full negative posterior is defined as f = g + h. The smooth part of the approximate posterior can be written as: g = −1 n n X i=1 p X s=1 h k X j=1 wijxis(θj s + xT i Θj s) −exp k X j=1 wij(θj s + xT i Θj s) i , (1) where xi is the word-count vector for the ith document, wi is the admixture weight vector for the ith document, and θj and Θj are the PMRF parameters for the jth component (see Appendix B for derivation). By writing g in this form, it is straightforward to see that even though the whole optimization problem is not convex because of the interaction between the admixture weights w and the PMRF parameters, the problem is convex if either the admixture weights W or the component parameters θ1...k, Θ1...k are held fixed. To simplify the notation in the following sections, we combine 1This posterior approximation was based on the pseudo-likelihood while ignoring the symmetry constraint so that nodewise regression parameters are independent. This leads to an overcomplete parameterization for APM. For an overview of composite likelihood methods, see [20]. For a comparison of pseudo-likelihood versus nodewise regressions, see [21]. 3 the node (which is analogous to an intercept term in regression) and edge parameters by defining zi = [1 xT i ]T , φj s = [θj s (Θj s)T ]T and Φs = [φ1 s φ2 s · · · φk s]. Thus, we can alternate between optimizing two similar optimization problems where one has a nonsmooth ℓ1 regularization and the other has the constraint that wi must lie on the simplex ∆k: arg min Φ1,Φ2,··· ,Φp −1 n p X s=1 h tr(ΨsΦs) − n X i=1 exp(zT i Φswi) i + p X s=1 λ∥vec(Φs)\1∥1 (2) arg min w1,w2,··· ,wn∈∆k −1 n n X i=1 h ψT i wi − p X s=1 exp(zT i Φswi)) i , (3) where ψi and Ψs are constants in the optimization that can be computed from the data matrix X and the other parameters that are being held fixed (see Alg. 2 in Appendix D for computation of Ψs). This alternating scheme is analogous to Alternating Least Squares (ALS) for Non-negative Matrix Factorization (NMF) [22] and EM-like algorithms such as k-means. By writing the optimization as in Eq. 2 and Eq. 3, we also expose the simple independence between the subproblems because they are simple summations. Thus, we can easily parallelize both optimization problems upto min(n, p) with little overhead and simple changes to the code—in our MATLAB implementation, we only changed a for loop to a parfor loop. 3.1 Newton-like Algorithms for Subproblems For each of the subproblems, we develop Newton-like optimization algorithms. For the component PMRFs, we borrow several important ideas from [14] including fixed and free sets of variables for the ℓ1 regularized optimization problem. The overall idea is to construct a quadratic approximation around the current solution and approximately optimize this simpler function to find a step direction. Usually, finding the Newton direction requires computing the Hessian for all the optimization variables but because of the ℓ1 regularization, we only need to focus on variables that might be non-zero. This set of free variables, denoted F, can be simply determined from the gradient and current iterate [14]. Since usually there is only a small number of free variables compared to fixed variables (i.e. λ is large enough), we can simply run coordinate descent on these free variables and only implicitly calculate Hessian information as needed in each coordinate descent step. After finding an approximate Newton direction, we find a step size that satisfies the Armijo rule and then update the iterate (see Alg. 2 in Appendix D). We also employed a similar Newton-like algorithm for estimating the admixture weights. Instead of the ℓ1 regularization term, however, this subproblem has the constraint that the admixture weights wi must lie on the simplex so that each document can be properly interpreted as a convex mixture of over topic parameters. For this constraint, we used a dual-coordinate descent algorithm to find the approximate Newton direction as in [23]. Finally, we put both subproblem algorithms together and alternate between the two (see Alg. 1 in Appendix D). For tracing through different λ parameters, λ is initially set to ∞so that the model trains an independent APM model first. Then, the initial λ = λmax is found by computing the largest gradient of the final independent iteration. Every time the alternating algorithm converges, the value of λ is decreased so that a set of models is trained for decreasing values of λ. 3.2 Timing Results We conducted two main timing experiments to show that the algorithm can be efficiently parallelized and the algorithm can scale to reasonably large datasets. For the parallel timing experiment, we used the BNC corpus described in Sec. 4.1 (n = 4049, p = 1646) and fixed k = 5, λ = 8 and a total of 30 alternating iterations. For the large data experiment, we used a Wikipedia dataset formed from a recent Wikipedia dump by choosing the top 10k words neglecting stop words and then selecting the longest documents. We ran several main iterations of the algorithm with this dataset while fixing the parameters k = 5 and λ = 0.5. All timing experiments were conducted on the TACC Maverick system with Intel Xeon E5-2680 v2 Ivy Bridge CPUs (2.80 GHz), 20 CPUs per node, and 12.8 GB memory per CPU (https://www.tacc.utexas.edu/). 4 The parallel timing results can be seen in Fig. 1 (left) which shows that the algorithm does have almost linear speedup when parallelizing across multiple workers. Though we only had access to a single computer with 20 processors, substantially more speed up could be obtained by using more processors on a distributed computing system. This simple parallelism makes this algorithm viable for much larger datasets. The timing results for the Wikipedia can be seen in Fig. 1 (right). These results give an approximate computational complexity of O(np2) which show that the proposed algorithm has the potential for scaling to datasets where n is O(105) and p is O(104). The O(p2) comes from the fact that there are p subproblems and each subproblem needs to calculate the gradient which is O(p) as well as approximate the Newton direction for a subset of the variables. The first iteration takes longer because the initial parameter values are na¨ıvely set to 0 whereas future iterations start from reasonable initial value. 0 5 10 15 20 0 5 10 15 20 Speedup # of MATLAB Workers Parallel Speedup on BNC Dataset Perfect Speedup Actual Speedup 1 3.1 3.4 0.6 2.2 2.2 0 1 2 3 4 n = 20,000 p = 5,000 # of Words = 50M n = 100,000 p = 5,000 # of Words = 133M n = 20,000 p = 10,000 # of Words = 57M Time (hrs) APM Training Time on Wikipedia Dataset 1st Iter. Avg. Next 3 Iter. Figure 1: (left) The speedup on the BNC dataset shows that the algorithm scales approximately linearly with the number of workers because the subproblems are all independent. (right) The timing results on the Wikipedia dataset show that the algorithm scales to larger datasets and has a computational complexity of approximately O(np2). 4 Evocation Metric Boyd-Graber et al. [7] introduced the notion of evocation which denotes the idea of which words “evoke” or “bring to mind” other words. There can be many types of evocation including the following examples from [7]: [rose - flower] (example), [brave - noble] (kind), [yell - talk] (manner), [eggs - bacon] (co-occurence), [snore - sleep] (setting), [wet - desert] (antonymy), [work - lazy] (exclusivity), and [banana - kiwi] (likeness). This is distinctive from word similarity or synonymy since two words can have very different meanings but “bring to mind” the other word (e.g. antonyms). This notion of word relatedness is a much simpler but potentially more semantically meaningful and interpretable than word similarity. For instance, “work” and “lazy” do not have similar meanings but are related through the semantic meanings of the words. Another difference is that—unlike word semantic similarity— words that generally appear in very different contexts yet mean the same thing would probably not have a high evocation score. For example, “networks” and “graphs” both have a definition that means a set of nodes and edges yet usually one word is chosen in a particular context. Recent work in evaluating topic models [2, 3, 4, 5] formulate automated metrics based on automatically scoring all pairs of top words and noticing that they correlate with human judgment of overall topic coherence. All of these metrics are based on the common assumption that a person should be able to understand a topic by understanding the abstract semantic connections between the word pairs. Thus, evocation is a reasonable notion for evaluating topic modeling because it directly evaluates the level of semantic connection between word pairs. In addition, this new evocation metric provides a way to explicitly evaluate the edge matrices of APM, which would be ignored in previous metrics because explicit word dependencies are not modeled in other topic models. We now formally define our evocation metric. Given human-evaluated scores for a subset of word pairs H and the corresponding weights given by a topic model for this subset of word pairs M, let us define πM(j) to be an ordering of the word pairs induced by M such that Mπ(1) ≥Mπ(2) ≥ · · · ≥Mπ(|H|). Then, the top-m evocation metric is simply: Evocm(M, H) = m X j=1 HπM(j) . (4) Note that the scaling of M is inconsequential because M is only needed to define an ordering or ranking of H. For example, ˆ M = α exp(M) would yield the same evocation score for all scalar 5 values α > 0 because the ordering would be maintained. Essentially, M merely induces an ordering of the word pairs and the evocation score is the sum of the human scores for these top m word pairs. For APM, the word pair weights come primarily from the PMRF edge matrices Θ1...k—the PMRF node vectors are only used to provide an ordering if there are not enough non-zeros in the edge matrices. For the other Multinomial-based topic models which do not have parameters explicitly associated with word-pairs, we can compute the most likely word pairs in a topic by multiplying their corresponding marginal probabilities. This weighting corresponds to the probability that two independent draws from the topic distribution produce the word pair and thus is the most obvious choice for Multinomial-based topic models. Since this metric only gives a way to evaluate one topic, we consider two ways of determining the overall evocation score for the whole topic model: Evoc-1 = Pk j=1 1 kEvocm(Mj, H) and Evoc-2 = Evocm(Pk j=1 1 kMj, H). In words, these are “average evocation of topics” and “evocation of average topic” respectively. Evoc-1 measures whether all or at least most topics capture meaningful word associations since it can be affected by uninteresting topics. Evoc-2 is reasonable for measuring whether the topic model as a whole is capturing word semantics even if some of the topics are not capturing interesting word associations. This second measure has some relation to the word similarity measure of topic coherence in [4]. However, [4] uses similarity rather than evocation, does not directly evaluate top individual word pairs and does not evaluate any models with word dependencies such as APM. 4.1 Experimental Setup Human-Scored Evocation Dataset The original human-scored evocation dataset was produced by a set of trained undergraduates in which 1,000 words were hand selected primarily based on their frequency and usage in the British National Corpus (BNC) [7]. From the possible pairwise evaluations, approximately 10% of the word pairs were randomly selected to be manually scored by a set of trained undergraduates. The second dataset was constructed by predicting the pairs of words that were likely to have a high evocation using a standard machine learning classifier. This new set of pairs was scored using Amazon MTurk (mturk.com) by using the original dataset as a control [24]. Though these scores are between synsets—which are a word, part-of-speech and sense triplet—, we mapped all of the synsets to word, part-of-speech pairs since that is the only information we have for the BNC corpus. This led to a total of 1646 words. In addition, though the evocation dataset has scores for directed relationships (i.e. word1 →word2 could have a different score than word2 → word1), we averaged these two scores because the directionality of the relationship is not modeled by APM or any other topic model. BNC Corpus Because the evocation dataset was based on the BNC corpus, we used the BNC corpus for our experiments. We processed the BNC corpus by lemmatizing each word using the WordNetLemmatizer included in the nltk package (nltk.org) and then attaching the part-of-speech, which is already included in the BNC corpus. We only retained the counts for the 1646 words that occurred in the human-scored datasets but processed all 4049 documents in the corpus. APM Model Parameters We trained APM on the BNC corpus with several different parameter settings including various λ and β parameter settings. We also trained two particular APM models denoted APM-LowReg and APM-HeldOut. APM-LowReg uses a very small regularization parameter so that almost all edges are non-zero. APM-HeldOut automatically selects a reasonable value for λ based on the likelihood of a held-out set of the documents. Thus, the APM-HeldOut model does not require a user-specified λ parameter but—as seen in the following sections—still performs reasonably well even compared to the APM model in which many different parameter settings are attempted. In addition, the APM-HeldOut can stop the training early when the model begins to overfit the data rather than tracing through all the λ parameters—this could lead to a significant gain in model training time. The authors suggest that APM-HeldOut is a simple baseline model for future comparison if a user does not want to specify λ. Other Models For comparison, we trained five other models: Correlated Topic Models (CTM), Hierarchical Dirichlet Process (HDP), Latent Dirichlet Allocation (LDA), Replicated Softmax (RSM), and a na¨ıve random baseline (RND). CTM models correlations between topics [25]. HDP 6 is a non-parametric Bayesian model that selects the number of topics based input data and hyperparameters [26]. The standard topic model LDA was trained using MALLET [27]. LDA was trained for at least 5,000 iterations and HDP was trained for at least 300 iterations since HDP is computationally expensive. RSM is an undirected topic model based on Restricted Boltzmann Machines (RBM) [28]. The random model is merely the expected evocation score if edges are ranked at random. We ran a full factorial experimental setting where all the combinations of a set of parameter values were trained to give a fair comparison between models (see Appendix C for a summary of parameter values). All these comparison models only indirectly model dependencies between words through the latent variables since the topic distributions are Multinomials whereas APM can directly model the dependencies between words since the topic distributions are Poisson MRFs. Selecting Best Parameters We randomly split the human scores into a 50% tuning split and 50% testing split. Note that we have a tuning split rather than a training split because the model training algorithms are unsupervised (i.e. they never see the human scores) so the only supervision occurs in selecting the final model parameters (i.e. during the tuning phase). Therefore, we selected the final parameters based on the tuning split and computed the final evocation scores on the test split. Thus, even when selecting the parameter settings, the modeling process never sees the test data. 4.2 Main Results The Evoc-1 and Evoc-2 scores with m = 50 for all models can be seen in Fig. 2.2 For Evoc-1, the APM models significantly outperform all other models for a small number of topics and even capture many semantically meaningful word pairs with a single topic. For higher number of topics, the APM models seem to perform only competitively with previous topic models. It seems that APM-LowReg performs better with a small number of topics whereas APM-HeldOut—which generally chooses a relatively high λ—seems more robust for large number of topics. These trends are likely caused because there is a relatively small number of documents (n = 4049) so the APM-LowReg begins to significantly overfit the data as the number of topics increases whereas APM-HeldOut does not seem to overfit as much. For all the APM models, the degradation in performance as the number of topics increases is most likely caused by the fact that a Poisson MRF with O(p2) parameters is a much more flexible distribution than a Multinomial, and thus, fewer topics are needed to appropriately model the data. These results also give some evidence that APM can succinctly model the data with a much smaller number of topics than is needed for independent topic models; this succinctness could be particularly helpful for the interpretability and intuitions of topic models. 0 200 400 600 800 1000 1200 1400 1600 k = 1 3 5 10 25 50 k = 1 3 5 10 25 50 Evoc-1 (Avg. Evoc. of Topics) Evoc-2 (Evoc. of Avg. Topic) Evocation (m= 50) APM APM-LowReg APM-HeldOut CTM HDP LDA RSM RND Figure 2: Both Evoc-1 scores (left) and Evoc-2 scores (right) demonstrate that APM usually significantly outperforms other topic models in capturing meaningful word pairs. For the Evoc-2 score, the APM models—including the APM-HeldOut model which automatically determines a λ from the data—significantly outperform previous topic models even for a large number of topics. This supports the idea that APM only needs a small number of topics to capture many of the semantically meaningful word dependencies. Thus, when increasing the number of topics beyond 5, the performance does not decrease as in Evoc-1. It is likely that this discrepancy is caused by the fact that many of the edges are concentrated in a small number of topics even when the number of topics is 10 or 25. As expected because of previous research in topic models, most other topic 2For simplicity and comparability, we grouped HDP into the topic number that was closest to its discovered number of topics because HDP can select a variable number of topics. 7 models perform slightly better with a larger number of topics. Though it is possible that using 100 or 500 topics for these topic models might give an evocation score better than APM with 5 topics, this would only enforce the idea that APM can perform better or at least competitively with previous topic models while only using a comparatively small number of topics. Qualitative Analysis of Top 20 Word Pairs for Best LDA and APM Models To validate the intuition of using evocation as an human-standard evaluation metric, we present the top 20 word pairs for the best standard topic model—in this case LDA—and the best APM model for the Evoc-2 metric as seen in Table 1. The best performing LDA model was trained with 50 topics, α = 1 and β = 0.0001. The best APM model was the APM-LowReg model trained with only 5 topics and a small regularization parameter λ = 0.05. It is important to note that the best model for LDA has 50 topics while the best model for APM only has 5 topics. As before, this reinforces the theme that APM can capture more semantically meaningful word pairs with a smaller number of topics than previous topic models. Table 1: Top 20 words for LDA (left) and APM (right) Rank Evoc. Rank Evoc. Rank Evoc. Rank Evoc. 1 38 woman.n ↔man.n 11 0 car.n ↔bus.n 1 13 smoke.v ↔cigarette.n 11 72 aunt.n ↔uncle.n 2 0 woman.n ↔wife.n 12 31 year.n ↔day.n 2 60 love.v ↔love.n 12 28 tea.n ↔coffee.n 3 13 train.n ↔car.n 13 25 car.n ↔seat.n 3 13 eat.v ↔food.n 13 25 operational.a ↔aircraft.n 4 69 school.n ↔class.n 14 50 teach.v ↔student.n 4 50 west.n ↔east.n 14 0 competition.n ↔compete.v 5 0 drive.v ↔car.n 15 0 tell.v ↔get.v 5 38 south.n ↔north.n 15 35 green.n ↔green.a 6 82 teach.v ↔school.n 16 38 wife.n ↔man.n 6 75 iron.n ↔steel.n 16 0 fox.n ↔animal.n 7 38 engine.n ↔car.n 17 100 run.v ↔car.n 7 57 question.n ↔answer.n 17 19 smoke.n ↔fire.n 8 35 publish.v ↔book.n 18 0 give.v ↔get.v 8 13 boil.v ↔potato.n 18 41 wine.n ↔drink.v 9 7 religious.a ↔church.n 19 16 paper.n ↔book.n 9 7 religious.a ↔church.n 19 33 troop.n ↔force.n 10 38 state.n ↔government.n 20 19 white.a ↔black.a 10 97 husband.n ↔wife.n 20 7 lock.n ↔key.n LDA Evocation of Avg. Graph = 967 APM Evocation of Avg. Graph = 1627 Edge Edge Edge Edge Rank Evoc. Rank Evoc. Rank Evoc. Rank Evoc. 1 38 woman.n ↔man.n 11 0 car.n ↔bus.n 1 13 smoke.v ↔cigarette.n 11 72 aunt.n ↔uncle.n 2 0 woman.n ↔wife.n 12 31 year.n ↔day.n 2 60 love.v ↔love.n 12 28 tea.n ↔coffee.n 3 13 train.n ↔car.n 13 25 car.n ↔seat.n 3 13 eat.v ↔food.n 13 25 operational.a ↔aircraft.n 4 69 school.n ↔class.n 14 50 teach.v ↔student.n 4 50 west.n ↔east.n 14 0 competition.n ↔compete.v 5 0 drive.v ↔car.n 15 0 tell.v ↔get.v 5 38 south.n ↔north.n 15 35 green.n ↔green.a 6 82 teach.v ↔school.n 16 38 wife.n ↔man.n 6 75 iron.n ↔steel.n 16 0 fox.n ↔animal.n 7 38 engine.n ↔car.n 17 100 run.v ↔car.n 7 57 question.n ↔answer.n 17 19 smoke.n ↔fire.n 8 35 publish.v ↔book.n 18 0 give.v ↔get.v 8 13 boil.v ↔potato.n 18 41 wine.n ↔drink.v 9 7 religious.a ↔church.n 19 16 paper.n ↔book.n 9 7 religious.a ↔church.n 19 33 troop.n ↔force.n 10 38 state.n ↔government.n 20 19 white.a ↔black.a 10 97 husband.n ↔wife.n 20 7 lock.n ↔key.n LDA Evocation of Avg. Graph = 967 APM Evocation of Avg. Graph = 1627 Edge Edge Edge Edge One interesting example is that LDA finds two word pairs [woman.n - wife.n] and [wife.n - man.n] that capture some semantic notion of marriage. However, APM directly captures this semantic meaning with [husband.n - wife.n]. APM also finds more intuitive verb-noun relationships that are closely tied semantically and portray a particular context: [smoke.v - cigarette.n], [eat.v - food.n], [boil.v - potato.n], and [drink.v - wine.n] whereas LDA tends to select less interesting verb-noun relationships such as [run.v - car.n]. In addition, APM finds multiple semantically coherent yet high level word pairs such as [iron.n - steel.n], [question.n - answer.n], and [aunt.n - uncle.n], whereas LDA finds several low-level edges such as [year.n - day.n] and [tell.v - get.v]. These overall trends become even more evident when looking at the top 50 edges as can be found in the Appendix E. Both the quantitative evaluation metrics (i.e. Evoc-1 and Evoc-2) as well as a qualitative exploration of the top word pairs give strong evidence that APM can succinctly capture both more interesting and higher-level semantic concepts through word dependencies than independent topic models. 5 Conclusion and Future Work We motivated the need for more expressive topic models that consider word dependencies—such as APM—by considering previous work on topic model evaluation metrics. We overcame the significant computational barrier of APM by providing a fast alternating Newton-like algorithm which can be easily parallelized. We proposed a new evaluation metric based on human evocation scores that seeks to measure whether a model is capturing semantically meaningful word pairs. Finally, we presented compelling quantitative and qualitative measures showing the superiority of APM in capturing semantically meaningful word pairs. In addition, this metric suggests new evaluations of topic models based on evaluating top word pairs rather than top words. One drawback with the current human-scored data is that only a small portion of the word pairs have been scored. Thus, one extension is to dynamically collect more human scores as needed for evaluation. This work also opens the door for exciting new word-semantic applications for APM such as Word Sense Induction using topic models [29], keyword expansion or suggestion, document summarization, and document visualization because APM is capturing semantically meaningful relationships between words. Acknowledgments D. Inouye was supported by the NSF Graduate Research Fellowship via DGE-1110007. P. Ravikumar acknowledges support from ARO via W911NF-12-1-0390 and NSF via IIS-1149803, IIS1447574, and DMS-1264033. I. Dhillon acknowledges support from NSF via CCF-1117055. 8 References [1] D. I. Inouye, P. Ravikumar, and I. S. Dhillon, “Admixture of Poisson MRFs: A Topic Model with Word Dependencies,” in International Conference on Machine Learning (ICML), 2014. [2] D. Mimno, H. M. Wallach, E. Talley, M. Leenders, and A. McCallum, “Optimizing semantic coherence in topic models,” in EMNLP, pp. 262–272, 2011. [3] D. Newman, Y. Noh, E. Talley, S. Karimi, and T. Baldwin, “Evaluating topic models for digital libraries,” in ACM/IEEE Joint Conference on Digital Libraries (JCDL), pp. 215–224, 2010. [4] K. Stevens and P. Kegelmeyer, “Exploring topic coherence over many models and many topics,” in EMNLP-CoNLL, pp. 952–961, 2012. [5] N. Aletras and R. Court, “Evaluating Topic Coherence Using Distributional Semantics,” in International Conference on Computational Semantics (IWCS 2013) - Long Papers, pp. 13–22, 2013. [6] D. Mimno and D. Blei, “Bayesian Checking for Topic Models,” in EMNLP, pp. 227–237, 2011. [7] J. Boyd-graber, C. Fellbaum, D. Osherson, and R. Schapire, “Adding Dense, Weighted Connections to {WordNet},” in Proceedings of the Global {WordNet} Conference, 2006. [8] D. Blei, A. Ng, and M. Jordan, “Latent dirichlet allocation,” JMLR, vol. 3, pp. 993–1022, 2003. [9] T. L. Griffiths and M. Steyvers, “Finding scientific topics,” Proceedings of the National Academy of Sciences of the United States of America, vol. 101, pp. 5228–35, Apr. 2004. [10] J. H. Lau, K. Grieser, D. Newman, and T. Baldwin, “Automatic Labelling of Topic Models,” in NAACL HLT, pp. 1536–1545, 2011. [11] D. Magatti, S. Calegari, D. Ciucci, and F. Stella, “Automatic Labeling Of Topics,” in ISDA, 2009. [12] X.-l. Mao, Z.-y. Ming, Z.-j. Zha, T.-s. Chua, H. Yan, and X. Li, “Automatic Labeling Hierarchical Topics,” in CIKM, pp. 2383–2386, 2012. [13] J. Chang, J. Boyd-Graber, S. Gerrish, C. Wang, and D. Blei, “Reading tea leaves: How humans interpret topic models,” NIPS, pp. 1–9, 2009. [14] C.-J. Hsieh, M. A. Sustik, I. S. Dhillon, and P. Ravkiumar, “Sparse inverse covariance matrix estimation using quadratic approximation,” NIPS, pp. 1–18, 2011. [15] T. Hofmann, “Probabilistic latent semantic analysis,” in Uncertainty in Artificial Intelligence (UAI), pp. 289–296, Morgan Kaufmann Publishers Inc., 1999. [16] J. Reisinger, A. Waters, B. Silverthorn, and R. J. Mooney, “Spherical topic models,” in ICML, pp. 903– 910, 2010. [17] E. M. Airoldi, D. M. Blei, S. E. Fienberg, and E. P. Xing, “Mixed Membership Stochastic Blockmodels.,” JMLR, vol. 9, pp. 1981–2014, Sept. 2008. [18] E. Yang, P. Ravikumar, G. I. Allen, and Z. Liu, “Graphical models via generalized linear models,” in NIPS, pp. 1367–1375, 2012. [19] E. Yang, P. Ravikumar, G. Allen, and Z. Liu., “On poisson graphical models,” in NIPS, pp. 1718–1726, 2013. [20] C. Varin, N. Reid, and D. Firth, “An overview of composite likelihood methods,” STATISTICA SINICA, vol. 21, pp. 5–42, 2011. [21] J. D. Lee and T. J. Hastie, “Structure Learning of Mixed Graphical Models,” in AISTATS, vol. 31, pp. 388– 396, 2013. [22] D. D. Lee and H. S. Seung, “Algorithms for Non-negative Matrix Factorization,” in NIPS, pp. 556–562, 2000. [23] H.-F. Yu, F.-L. Huang, and C.-J. Lin, “Dual coordinate descent methods for logistic regression and maximum entropy models,” Machine Learning, vol. 85, pp. 41–75, Nov. 2010. [24] S. Nikolova, J. Boyd-graber, C. Fellbaum, and P. Cook, “Better Vocabularies for Assistive Communication Aids: Connecting Terms using Semantic Networks and Untrained Annotators,” in ACM Conference on Computers and Accessibility, pp. 171–178, 2009. [25] D. M. Blei and J. D. Lafferty, “Correlated topic models,” in NIPS, pp. 147–154, 2005. [26] Y. W. Teh, M. I. Jordan, M. J. Beal, and D. M. Blei, “Hierarchical Dirichlet Processes,” Journal of the American Statistical Association, vol. 101, pp. 1566–1581, Dec. 2006. [27] A. K. McCallum, “MALLET: A Machine Learning for Language Toolkit,” 2002. [28] G. Hinton and R. Salakhutdinov, “Replicated softmax: An undirected topic model,” NIPS, 2009. [29] J. H. Lau, P. Cook, D. Mccarthy, D. Newman, and T. Baldwin, “Word Sense Induction for Novel Sense Detection,” in EACL, pp. 591–601, 2012. 9
2014
323
5,429
Kernel Mean Estimation via Spectral Filtering Krikamol Muandet MPI-IS, T¨ubingen krikamol@tue.mpg.de Bharath Sriperumbudur Dept. of Statistics, PSU bks18@psu.edu Bernhard Sch¨olkopf MPI-IS, T¨ubingen bs@tue.mpg.de Abstract The problem of estimating the kernel mean in a reproducing kernel Hilbert space (RKHS) is central to kernel methods in that it is used by classical approaches (e.g., when centering a kernel PCA matrix), and it also forms the core inference step of modern kernel methods (e.g., kernel-based non-parametric tests) that rely on embedding probability distributions in RKHSs. Previous work [1] has shown that shrinkage can help in constructing “better” estimators of the kernel mean than the empirical estimator. The present paper studies the consistency and admissibility of the estimators in [1], and proposes a wider class of shrinkage estimators that improve upon the empirical estimator by considering appropriate basis functions. Using the kernel PCA basis, we show that some of these estimators can be constructed using spectral filtering algorithms which are shown to be consistent under some technical assumptions. Our theoretical analysis also reveals a fundamental connection to the kernel-based supervised learning framework. The proposed estimators are simple to implement and perform well in practice. 1 Introduction The kernel mean or the mean element, which corresponds to the mean of the kernel function in a reproducing kernel Hilbert space (RKHS) computed w.r.t. some distribution P, has played a fundamental role as a basic building block of many kernel-based learning algorithms [2–4], and has recently gained increasing attention through the notion of embedding distributions in an RKHS [5– 13]. Estimating the kernel mean remains an important problem as the underlying distribution P is usually unknown and we must rely entirely on the sample drawn according to P. Given a random sample drawn independently and identically (i.i.d.) from P, the most common way to estimate the kernel mean is by replacing P by the empirical measure, Pn := 1 n Pn i=1 δXi where δx is a Dirac measure at x [5, 6]. Without any prior knowledge about P, the empirical estimator is possibly the best one can do. However, [1] showed that this estimator can be “improved” by constructing a shrinkage estimator which is a combination of a model with low bias and high variance, and a model with high bias but low variance. Interestingly, significant improvement is in fact possible if the trade-off between these two models is chosen appropriately. The shrinkage estimator proposed in [1], which is motivated from the classical James-Stein shrinkage estimator [14] for the estimation of the mean of a normal distribution, is shown to have a smaller mean-squared error than that of the empirical estimator. These findings provide some support for the conceptual premise that we might be somewhat pessimistic in using the empirical estimator of the kernel mean and there is abundant room for further progress. In this work, we adopt a spectral filtering approach to obtain shrinkage estimators of kernel mean that improve on the empirical estimator. The motivation behind our approach stems from the idea presented in [1] where the kernel mean estimation is reformulated as an empirical risk minimization (ERM) problem, with the shrinkage estimator being then obtained through penalized ERM. It is important to note that this motivation differs fundamentally from the typical supervised learning as the goal of regularization here is to get the James-Stein-like shrinkage estimators [14] rather than 1 to prevent overfitting. By looking at regularization from a filter function perspective, in this paper, we show that a wide class of shrinkage estimators for kernel mean can be obtained and that these estimators are consistent for an appropriate choice of the regularization/shrinkage parameter. Unlike in earlier works [15–18] where the spectral filtering approach has been used in supervised learning problems, we here deal with unsupervised setting and only leverage spectral filtering as a way to construct a shrinkage estimator of the kernel mean. One of the advantages of this approach is that it allows us to incorporate meaningful prior knowledge. The resultant estimators are characterized by the filter function, which can be chosen according to the relevant prior knowledge. Moreover, the spectral filtering gives rise to a broader interpretation of shrinkage through, for example, the notion of early stopping and dimension reduction. Our estimators not only outperform the empirical estimator, but are also simple to implement and computationally efficient. The paper is organized as follows. In Section 2, we introduce the problem of shrinkage estimation and present a new result that theoretically justifies the shrinkage estimator over the empirical estimator for kernel mean, which improves on the work of [1] while removing some of its drawbacks. Motivated by this result, we consider a general class of shrinkage estimators obtained via spectral filtering in Section 3 whose theoretical properties are presented in Section 4. The empirical performance of the proposed estimators are presented in Section 5. The missing proofs of the results are given in the supplementary material. 2 Kernel mean shrinkage estimator In this section, we present preliminaries on the problem of shrinkage estimation in the context of estimating the kernel mean [1] and then present a theoretical justification (see Theorem 1) for shrinkage estimators that improves our understanding of the kernel mean estimation problem, while alleviating some of the issues inherent in the estimator proposed in [1]. Preliminaries: Let H be an RKHS of functions on a separable topological space X. The space H is endowed with inner product ⟨·, ·⟩, associated norm ∥· ∥, and reproducing kernel k : X × X →R, which we assume to be continuous and bounded, i.e., κ := supx∈X p k(x, x) < ∞. The kernel mean of some unknown distribution P on X and its empirical estimate—we refer to this as kernel mean estimator (KME)—from i.i.d. sample x1, . . . , xn are given by µP := Z X k(x, ·) dP(x) and ˆµP := 1 n n X i=1 k(xi, ·), (1) respectively. As mentioned before, ˆµP is the “best” possible estimator to estimate µP if nothing is known about P. However, depending on the information that is available about P, one can construct various estimators of µP that perform “better” than µP. Usually, the performance measure that is used for comparison is the mean-squared error though alternate measures can be used. Therefore, our main objective is to improve upon KME in terms of the mean-squared error, i.e., construct ˜µP such that EP∥˜µP −µP∥2 ≤EP∥ˆµP −µP∥2 for all P ∈P with strict inequality holding for at least one element in P where P is a suitably large class of Borel probability measures on X. Such an estimator ˜µP is said to be admissible w.r.t P. If P = M 1 +(X) is the set of all Borel probability measures on X, then ˜µP satisfying the above conditions may not exist and in that sense, ˆµP is possibly the best estimator of µP that one can have. Admissibility of shrinkage estimator: To improve upon KME, motivated by the James-Stein estimator, ˜θ, [1] proposed a shrinkage estimator ˆµα := αf ∗+ (1 −α)ˆµP where α ∈R is the shrinkage parameter that balances the low-bias, high-variance model (ˆµP) with the high-bias, low-variance model (f ∗∈H). Assuming for simplicity f ∗= 0, [1] showed that EP∥ˆµα −µP∥2 < EP∥ˆµP −µP∥2 if and only if α ∈(0, 2∆/(∆+ ∥µP∥2)) where ∆:= EP∥ˆµP −µP∥2. While this is an interesting result, the resultant estimator ˆµα is strictly not a “statistical estimator” as it depends on quantities that need to be estimated, i.e., it depends on α whose choice requires the knowledge of µP, which is the quantity to be estimated. We would like to mention that [1] handles the general case with f ∗ being not necessarily zero, wherein the range for α then depends on f ∗as well. But for the purposes of simplicity and ease of understanding, for the rest of this paper we assume f ∗= 0. Since ˆµα is not practically interesting, [1] resorted to the following representation of µP and ˆµP as solutions to the minimization problems [1, 19]: 2 µP = arg inf g∈H Z X ∥k(x, ·) −g∥2 dP(x), ˆµP = arg inf g∈H 1 n n X i=1 ∥k(xi, ·) −g∥2, (2) using which ˆµα is shown to be the solution to the regularized empirical risk minimization problem: ˇµλ = arg inf g∈H 1 n n X i=1 ∥k(xi, ·) −g∥2 + λ∥g∥2, (3) where λ > 0 and α := λ λ+1, i.e., ˇµλ = ˆµ λ λ+1 . It is interesting to note that unlike in supervised learning (e.g., least squares regression), the empirical minimization problem in (2) is not ill-posed and therefore does not require a regularization term although it is used in (3) to obtain a shrinkage estimator of µP. [1] then obtained a value for λ through cross-validation and used it to construct ˆµ λ λ+1 as an estimator of µP, which is then shown to perform empirically better than ˆµP. However, no theoretical guarantees including the basic requirement of ˆµ λ λ+1 being consistent are provided. In fact, because λ is data-dependent, the above mentioned result about the improved performance of ˆµα over a range of α does not hold as such a result is proved assuming α is a constant and does not depend on the data. While it is clear that the regularizer in (3) is not needed to make (2) well-posed, the role of λ is not clear from the point of view of ˆµ λ λ+1 being consistent and better than ˆµP. The following result provides a theoretical understanding of ˆµ λ λ+1 from these viewpoints. Theorem 1. Let ˇµλ be constructed as in (3). Then the following hold. (i) ∥ˇµλ −µP∥ P→0 as λ →0 and n →∞. In addition, if λ = n−β for some β > 0, then ∥ˇµλ −µP∥= OP(n−min{β,1/2}). (ii) For λ = cn−β with c > 0 and β > 1, define Pc,β := {P ∈M 1 +(X) : ∥µP∥2 < A R k(x, x) dP(x)} where A := 21/ββ 21/ββ+c1/β(β−1)(β−1)/β . Then ∀n and ∀P ∈Pc,β, we have EP∥ˇµλ −µP∥2 < EP∥ˆµP −µP∥2. Remark. (i) Theorem 1(i) shows that ˇµλ is a consistent estimator of µP as long as λ →0 and the convergence rate in probability of ∥ˇµλ −µP∥is determined by the rate of convergence of λ to zero, with the best possible convergence rate being n−1/2. Therefore to attain a fast rate of convergence, it is instructive to choose λ such that λ√n →0 as λ →0 and n →∞. (ii) Suppose for some c > 0 and β > 1, we choose λ = cn−β, which means the resultant estimator ˇµλ is a proper estimator as it does not depend on any unknown quantities. Theorem 1(ii) shows that for any n and P ∈Pc,β, ˇµλ is a “better” estimator than ˆµP. Note that for any P ∈M 1 +(X), ∥µP∥2 = R R k(x, y) dP(x) dP(y) ≤( R p k(x, x) dP(x))2 ≤ R k(x, x) dP(x). This means ˇµλ is admissible if we restrict M 1 +(X) to Pc,β which considers only those distributions for which ∥µP∥2/ R k(x, x) dP(x) is strictly less than a constant, A < 1. It is obvious to note that if c is very small or β is very large, then A gets closer to one and ˇµλ behaves almost like ˆµP, thereby matching with our intuition. (iii) A nice interpretation for Pc,β can be obtained as in Theorem 1(ii) when k is a translation invariant kernel on Rd. It can be shown that Pc,β contains the class of all probability measures whose characteristic function has an L2 norm (and therefore is the set of square integrable probability densities if P has a density w.r.t. the Lebesgue measure) bounded by a constant that depends on c, β and k (see §2 in the supplementary material). ■ 3 Spectral kernel mean shrinkage estimator Let us return to the shrinkage estimator ˆµα considered in [1], i.e., ˆµα = αf ∗+ (1 −α)ˆµP = α P i⟨f ∗, ei⟩ei + (1 −α) P i⟨ˆµP, ei⟩ei, where (ei)i∈N are the countable orthonormal basis (ONB) of H—countable ONB exist since H is separable which follows from X being separable and k being continuous [20, Lemma 4.33]. This estimator can be generalized by considering the shrinkage estimator ˆµα := P i αi⟨f ∗, ei⟩ei + P i(1 −αi)⟨ˆµP, ei⟩ei where α := (α1, α2, . . .) ∈R∞is a sequence of shrinkage parameters. If ∆α := EP∥ˆµα −µP∥2 is the risk of this estimator, the following theorem gives an optimality condition on α for which ∆α < ∆. Theorem 2. For some ONB (ei)i, ∆α −∆= P i(∆α,i −∆i) where ∆α,i and ∆i denote the risk of the ith component of ˆµα and ˆµP, respectively. Then, ∆α,i −∆i < 0 if 0 < αi < 2∆i ∆i + (f ∗ i −µi)2 , (4) 3 uncorrelated isotropic Gaussian X ∼N(θ, I) ˆθML = X . θ target correlated anisotropic Gaussian X ∼N(θ, Σ) ˆθML = X . θ target Figure 1: Geometric explanation of a shrinkage estimator when estimating a mean of a Gaussian distribution. For isotropic Gaussian, the level sets of the joint density of ˆθML = X are hyperspheres. In this case, shrinkage has the same effect regardless of the direction. Shaded area represents those estimates that get closer to θ after shrinkage. For anisotropic Gaussian, the level sets are concentric ellipsoids, which makes the effect dependent on the direction of shrinkage. where f ∗ i and µi denote the Fourier coefficients of f ∗and µP, respectively. The condition in (4) is a component-wise version of the condition given in [1, Theorem 1] for a class of estimators ˆµα := αf ∗+ (1 −α)ˆµP which may be expressed here by assuming that we have a constant shrinkage parameter αi = α for all i. Clearly, as the optimal range of αi may vary across coordinates, the class of estimators in [1] does not allow us to adjust αi accordingly. To understand why this property is important, let us consider the problem of estimating the mean of Gaussian distribution illustrated in Figure 1. For correlated random variable X ∼N(θ, Σ), a natural choice of basis is the set of orthonormal eigenvectors which diagonalize the covariance matrix Σ of X. Clearly, the optimal range of αi depends on the corresponding eigenvalues. Allowing for different basis (ei)i and shrinkage parameter αi opens up a wide range of strategies that can be used to construct “better” estimators. A natural strategy under this representation is as follows: i) we specify the ONB (ei)i and project ˆµP onto this basis. ii) we shrink each ˆµi independently according to a pre-defined shrinkage rule. iii) the shrinkage estimate is reconstructed as a superposition of the resulting components. In other words, an ideal shrinkage estimator can be defined formally as a non-linear mapping: ˆµP −→ X i h(αi)⟨f ∗, ei⟩ei + X i (1 −h(αi))⟨ˆµP, ei⟩ei (5) where h : R →R is a shrinkage rule. Since we make no reference to any particular basis (ei)i, nor to any particular shrinkage rule h, a wide range of strategies can be adopted here. For example, we can view whitening as a special case in which f ∗is the data average 1 n Pn i=1 xi and 1−h(αi) = 1/√αi where αi and ei are the ith eigenvalue and eigenvector of the covariance matrix, respectively. Inspired by Theorem 2, we adopt the spectral filtering approach as one of the strategies to construct the estimators of the form (5). To this end, owing to the regularization interpretation in (3), we consider estimators of the form Pn i=1 βik(xi, ·) for some β ∈Rn—looking for such an estimator is equivalent to learning a signed measure that is supported on (xi)n i=1. Since Pn i=1 βik(xi, ·) is a minimizer of (3), β should satisfy Kβ = K1n where K is an n × n Gram matrix and 1n = [1/n. . . . , 1/n]⊤. Here the solution is trivially β = 1n, i.e., the coefficients of the standard estimator ˆµP if K is invertible. Since K−1 may not exist and even if it exists, the computation of it can be numerically unstable, the idea of spectral filtering—this is quite popular in the theory of inverse problems [15] and has been used in kernel least squares [17]—is to replace K−1 by some regularized matrices gλ(K) that approximates K−1 as λ goes to zero. Note that unlike in (3), the regularization is quite important here (i.e., the case of estimators of the form Pn i=1 βik(xi, ·)) without which the the linear system is under determined. Therefore, we propose the following class of estimators: ˆµλ := n X i=1 βik(xi, ·) with β(λ) := gλ(K)K1n, (6) where gλ(·) is a filter function and λ is referred to as a shrinkage parameter. The matrix-valued function gλ(K) can be described by a scalar function gλ : [0, κ2] →R on the spectrum of K. That is, if K = UDU⊤is the eigen-decomposition of K where D = diag(˜γ1, . . . , ˜γn), we have gλ(D) = diag(gλ(˜γ1), . . . , gλ(˜γn)) and gλ(K) = Ugλ(D)U⊤. For example, the scalar filter function of Tikhonov regularization is gλ(γ) = 1/(γ + λ). In the sequel, we call this class of estimators a spectral kernel mean shrinkage estimator (Spectral-KMSE). 4 Table 1: Update equations for β and corresponding filter functions. Algorithm Update Equation (a := K1n −Kβt−1) Filter Function L2 Boosting βt ←βt−1 + ηa g(γ) = η Pt−1 i=1(1 −ηγ)i Acc. L2 Boosting βt ←βt−1 + ωt(βt−1 −βt−2) + κt n a g(γ) = pt(γ) Iterated Tikhonov (K + nλI)βi = 1n + nλβi−1 g(γ) = (γ+λ)t−γt λ(γ+λ)t Truncated SVD None g(γ) = γ−11{γ≥λ} 0 0.2 0.4 0.6 0.8 1 0 0.5 1 1.5 γ g(γ)γ Tikhonov L2 Boosting ν−method Iterated Tikhonov TSVD Figure 2: Plot of g(γ)γ. Proposition 3. The Spectral-KMSE satisfies ˆµλ = Pn i=1 gλ(˜γi)˜γi⟨ˆµ, ˜vi⟩˜vi, where (˜γi, ˜vi) are eigenvalue and eigenfunction pairs of the empirical covariance operator bCk : H →H defined as bCk = 1 n Pn i=1 k(·, xi) ⊗k(·, xi). By virtue of Proposition 3, if we choose 1 −h(˜γ) := gλ(˜γ)˜γ, the Spectral-KMSE is indeed in the form of (5) when f ∗= 0 and (ei)i is the kernel PCA (KPCA) basis, with the filter function gλ determining the shrinkage rule. Since by definition gλ(˜γi) approaches the function 1/˜γi as λ goes to 0, the function gλ(˜γi)˜γi approaches 1 (no shrinkage). As the value of λ increases, we have more shrinkage because the value of gλ(˜γi)˜γi deviates from 1, and the behavior of this deviation depends on the filter function gλ. For example, we can see that Proposition 3 generalizes Theorem 2 in [1] where the filter function is gλ(K) = (K + nλI)−1, i.e., g(γ) = 1/(γ + λ). That is, we have gλ(˜γi)˜γi = ˜γi/(˜γi + λ), implying that the effect of shrinkage is relatively larger in the lowvariance direction. In the following, we discuss well-known examples of spectral filtering algorithms obtained by various choices of gλ. Update equations for β(λ) and corresponding filter functions are summarized in Table 1. Figure 2 illustrates the behavior of these filter functions. L2 Boosting. This algorithm, also known as gradient descent or Landweber iteration, finds a weight β by performing a gradient descent iteratively. Thus, we can interpret early stopping as shrinkage and the reciprocal of iteration number as shrinkage parameter, i.e., λ ≈1/t. The step-size η does not play any role for shrinkage [16], so we use the fixed step-size η = 1/κ2 throughout. Accelerated L2 Boosting. This algorithm, also known as ν-method, uses an accelerated gradient descent step, which is faster than L2 Boosting because we only need √ t iterations to get the same solution as the L2 Boosting would get after t iterations. Consequently, we have λ ≈1/t2. Iterated Tikhonov. This algorithm can be viewed as a combination of Tikhonov regularization and gradient descent. Both parameters λ and t play the role of shrinkage parameter. Truncated Singular Value Decomposition. This algorithm can be interpreted as a projection onto the first principal components of the KPCA basis. Hence, we may interpret dimensionality reduction as shrinkage and the size of reduced dimension as shrinkage parameter. This approach has been used in [21] to improve the kernel mean estimation under the low-rank assumption. Most of the above spectral filtering algorithms allow to compute the coefficients β without explicitly computing the eigen-decomposition of K, as we can see in Table 1, and some of which may have no natural interpretation in terms of regularized risk minimization. Lastly, an initialization of β corresponds to the target of shrinkage. In this work, we assume that β0 = 0 throughout. 4 Theoretical properties of Spectral-KMSE This section presents some theoretical properties for the proposed Spectral-KMSE in (6). To this end, we first present a regularization interpretation that is different from the one in (3) which involves learning a smooth operator from H to H [22]. This will be helpful to investigate the consistency of the Spectral-KMSE. Let us consider the following regularized risk minimization problem, arg minF∈H⊗H EX ∥k(X, ·) −F[k(X, ·)]∥2 H + λ∥F∥2 HS (7) where F is a Hilbert-Schmidt operator from H to H. Essentially, we are seeking a smooth operator F that maps k(x, ·) to itself, where (7) is an instance of the regression framework in [22]. The formulation of shrinkage as the solution of a smooth operator regression, and the empirical solution (8) and in the lines below, were given in a personal communication by Arthur Gretton. It can be 5 shown that the solution to (7) is given by F = Ck(Ck + λI)−1 where Ck : H →H is a covariance operator in H defined as Ck = R k(·, x) ⊗k(·, x) dP(x) (see §5 of the supplement for a proof). Define µλ := FµP = Ck(Ck + λI)−1µP. Since k is bounded, it is easy to verify that Ck is HilbertSchmidt and therefore compact. Hence by the Hilbert-Schmidt theorem, Ck = P i γi⟨·, ψi⟩ψi where (γi)i∈N are the positive eigenvalues and (ψi)i∈N are the corresponding eigenvectors that form an ONB for the range space of Ck denoted as R(Ck). This implies µλ can be decomposed as µλ = P∞ i=1 γi γi+λ⟨µP, ψi⟩ψi. We can observe that the filter function corresponding to the problem (7) is gλ(γ) = 1/(γ + λ). By extending this approach to other filter functions, we obtain µλ = P∞ i=1 γigλ(γi)⟨µP, ψi⟩ψi which is equivalent to µλ = Ckgλ(Ck)µP. Since Ck is a compact operator, the role of filter function gλ is to regularize the inverse of Ck. In standard supervised setting, the explicit form of the solution is fλ = gλ(Lk)Lkfρ where Lk is the integral operator of kernel k acting in L2(X, ρX) and fρ is the expected solution given by fρ(x) = R Y y dρ(y|x) [16]. It is interesting to see that µλ admits a similar form to that of fλ, but it is written in term of covariance operator Ck instead of the integral operator Lk. Moreover, the solution to (7) is also in a similar form to the regularized conditional embedding µY |X = CY X(Ck + λI)−1 [9]. This connection implies that the spectral filtering may be applied more broadly to improve the estimation of conditional mean embedding, i.e., µY |X = CY Xgλ(Ck). The empirical counterpart of (7) is given by arg min F 1 n n X i=1 ∥k(xi, ·) −F[k(xi, ·)]∥2 H + λ∥F∥2 HS, (8) resulting in ˆµλ = FˆµP = 1⊤ n K(K + λI)−1Φ where Φ = [k(x1, ·), . . . , k(xn, ·)]⊤, which matches with the one in (6) with gλ(K) = (K + λI)−1. Note that this is exactly the F-KMSE proposed in [1]. Based on µλ which depends on P, an empirical version of it can be obtained by replacing Ck and µP with their empirical estimators leading to ˜µλ = bCkgλ( bCk)ˆµP. The following result shows that ˆµλ = ˜µλ, which means the Spectral-KMSE proposed in (6) is equivalent to solving (8). Proposition 4. Let bCk and ˆµP be the sample counterparts of Ck and µP given by bCk := 1 n Pn i=1 k(xi, ·) ⊗k(xi, ·) and ˆµP := 1 n Pn i=1 k(xi, ·), respectively. Then, we have that ˜µλ := bCkgλ( bCk)ˆµP = ˆµλ, where ˆµλ is defined in (6). Having established a regularization interpretation for ˆµλ, it is of interest to study the consistency and convergence rate of ˆµλ similar to KMSE in Theorem 1. Our main goal here is to derive convergence rates for a broad class of algorithms given a set of sufficient conditions on the filter function, gλ. We believe that for some algorithms it is possible to derive the best achievable bounds, which requires ad-hoc proofs for each algorithm. To this end, we provide a set of conditions any admissible filter function, gλ must satisfy. Definition 1. A family of filter functions gλ : [0, κ2] →R, 0 < λ ≤κ2 is said to be admissible if there exists finite positive constants B, C, D, and η0 (all independent of λ) such that (C1) supγ∈[0,κ2] |γgλ(γ)| ≤B, (C2) supγ∈[0,κ2] |rλ(γ)| ≤C and (C3) supγ∈[0,κ2] |rλ(γ)|γη ≤ Dλη, ∀η ∈(0, η0] hold, where rλ(γ) := 1 −γgλ(γ). These conditions are quite standard in the theory of inverse problems [15, 23]. The constant η0 is called the qualification of gλ and is a crucial factor that determines the rate of convergence in inverse problems. As we will see below, that the rate of convergence of ˆµλ depends on two factors: (a) smoothness of µP which is usually unknown as it depends on the unknown P and (b) qualification of gλ which determines how well the smoothness of µP is captured by the spectral filter, gλ. Theorem 5. Suppose gλ is admissible in the sense of Definition 1. Let κ = supx∈X p k(x, x). If µP ∈R(Cβ k ) for some β > 0, then for any δ > 0, with probability at least 1 −3e−δ, ∥ˆµλ −µP∥≤2κB + κB √ 2δ √n + Dλmin{β,η0}∥C−β k µP∥+ Cτ (2 √ 2κ2√ δ)min{1,β} nmin{1/2,β/2} ∥C−β k µP∥, where R(A) denotes the range space of A and τ is some universal constant that does not depend on λ and n. Therefore, ∥ˆµλ −µP∥= OP(n−min{1/2,β/2}) with λ = o(n−min{1/2,β/2} min{β,η0} ). Theorem 5 shows that the convergence rate depends on the smoothness of µP which is imposed through the range space condition that µP ∈R(Cβ k ) for some β > 0. Note that this is in contrast 6 to the estimator in Theorem 1 which does not require any smoothness assumptions on µP. It can be shown that the smoothness of µP increases with increase in β. This means, irrespective of the smoothness of µP for β > 1, the best possible convergence rate is n−1/2 which matches with that of KMSE in Theorem 1. While the qualification η0 does not seem to directly affect the rates, it controls the rate at which λ converges to zero. For example, if gλ(γ) = 1/(γ + λ) which corresponds to Tikhonov regularization, it can be shown that η0 = 1 which means for β > 1, λ = o(n−1/2) implying that λ cannot decay to zero slower than n−1/2. Ideally, one would require a larger η0 (preferably infinity which is the case with truncated SVD) so that the convergence of λ to zero can be made arbitrarily slow if β is large. This way, both β and η0 control the behavior of the estimator. In fact, Theorem 5 provides a choice for λ—which is what we used in Theorem 1 to study the admissibility of ˇµλ to Pc,β—to construct the Spectral-KMSE. However, this choice of λ depends on β which is not known in practice (although η0 is known as it is determined by the choice of gλ). Therefore, λ is usually learnt from data through cross-validation or through Lepski’s method [24] for which guarantees similar to the one presented in Theorem 5 can be provided. However, irrespective of the data-dependent/independent choice for λ, checking for the admissibility of Spectral-KMSE (similar to the one in Theorem 1) is very difficult and we intend to consider it in future work. 5 Empirical studies Synthetic data. Given the i.i.d. sample X = {x1, x2, . . . , xn} from P where xi ∈Rd, we evaluate different estimators using the loss function L(β, X, P) := ∥Pn i=1 βik(xi, ·) −Ex∼P[k(x, ·)]∥2 H. The risk of the estimator is subsequently approximated by averaging over m independent copies of X. In this experiment, we set n = 50, d = 20, and m = 1000. Throughout, we use the Gaussian RBF kernel k(x, x′) = exp(−∥x −x′∥2/2σ2) whose bandwidth parameter is calculated using the median heuristic, i.e., σ2 = median{∥xi −xj∥2}. To allow for an analytic calculation of the loss L(β, X, P), we assume that the distribution P is a d-dimensional mixture of Gaussians [1, 8]. Specifically, the data are generated as follows: x ∼P4 i=1 πiN(θi, Σi)+ε, θij ∼U(−10, 10), Σi ∼ W(3 × Id, 7), ε ∼N(0, 0.2 × Id) where U(a, b) and W(Σ0, df) are the uniform distribution and Wishart distribution, respectively. As in [1], we set π = [0.05, 0.3, 0.4, 0.25]. A natural approach for choosing λ is cross-validation procedure, which can be performed efficiently for the iterative methods such as Landweber and accelerated Landweber. For these two algorithms, we evaluate the leave-one-out score and select βt at the iteration t that minimizes this score (see, e.g., Figure 3(a)). Note that these methods have the built-in property of computing the whole regularization path efficiently. Since each iteration of the iterated Tikhonov is in fact equivalent to the F-KMSE, we assume t = 3 for simplicity and use the efficient LOOCV procedure proposed in [1] to find λ at each iteration. Lastly, the truncation limit of TSVD can be identified efficiently by mean of generalized cross-validation (GCV) procedure [25]. To allow for an efficient calculation of GCV score, we resort to the alternative loss function L(β) := ∥Kβ −K1n∥2 2. Figure 3 reveals interesting aspects of the Spectral-KMSE. Firstly, as we can see in Figure 3(a), the number of iterations acts as shrinkage parameter whose optimal value can be attained within just a few iterations. Moreover, these methods do not suffer from “over-shrinking” because λ →0 as t →∞. In other words, if the chosen t happens to be too large, the worst we can get is the standard empirical estimator. Secondly, Figure 3(b) demonstrates that both Landweber and accelerated Landweber are more computationally efficient than the F-KMSE. Lastly, Figure 3(c) suggests that the improvement of shrinkage estimators becomes increasingly remarkable in a high-dimensional setting. Interestingly, we can observe that most Spectral-KMSE algorithms outperform the SKMSE, which supports our hypothesis on the importance of the geometric information of RKHS mentioned in Section 3. In addition, although the TSVD still gain from shrinkage, the improvement is smaller than other algorithms. This highlights the importance of filter functions and associated parameters. Real data. We apply Spectral-KMSE to the density estimation problem via kernel mean matching [1, 26]. The datasets were taken from the UCI repository1 and pre-processed by standardizing each feature. Then, we fit a mixture model Q = Pr j=1 πjN(θj, σ2 j I) to the pre-processed dataset 1http://archive.ics.uci.edu/ml/ 7 0 10 20 30 40 10 −1.8 10 −1.6 10 −1.4 10 −1.2 Iterations Risk (1000 iterations) KME S−KMSE F−KMSE Landweber Acc. Landweber Iterated Tikhonov (λ=0.01) (a) risk vs. iteration 10 1 10 2 10 3 10 −6 10 −5 10 −4 10 −3 10 −2 10 −1 10 0 10 1 10 2 Sample Size Elapsed Time (1000 iterations) KME S−KMSE F−KMSE Landweber Acc Landweber Iterated Tikhonov Truncated SVD (b) runtime vs. sample size 20 40 60 80 100 0 10 20 30 40 50 60 Dimensionality Percentage of Improvement (1000 iterations) S−KMSE F−KMSE Landweber Acc Landweber Iter. Tikhonov Truncated SVD (c) risk vs. dimension Figure 3: (a) For iterative algorithms, the number of iterations acts as shrinkage parameter. (b) The iterative algorithms such as Landweber and accelerated Landweber are more efficient than the FKMSE. (c) A percentage of improvement w.r.t. the KME, i.e., 100 × (R −Rλ)/R where R and Rλ denote the approximated risk of KME and KMSE, respectively. Most Spectral-KMSE algorithms outperform S-KMSE which does not take into account the geometric information of the RKHS. X := {xi}n i=1 by minimizing ∥µQ −ˆµX∥2 subject to the constraint Pr j=1 πj = 1. Here µQ is the mean embedding of the mixture model Q and ˆµX is the empirical mean embedding obtained from X. Based on different estimators of µX, we evaluate the resultant model Q by the negative loglikelihood score on the test data. The parameters (πj, θj, σ2 j ) are initialized by the best one obtained from the K-means algorithm with 50 initializations. Throughout, we set r = 5 and use 25% of each dataset as a test set. Table 2: The average negative log-likelihood evaluated on the test set. The results are obtained from 30 repetitions of the experiment. The boldface represents the statistically significant results. Dataset KME S-KMSE F-KMSE Landweber Acc Land Iter Tik TSVD ionosphere 36.1769 36.1402 36.1622 36.1204 36.1554 36.1334 36.1442 glass 10.7855 10.7403 10.7448 10.7099 10.7541 10.9078 10.7791 bodyfat 18.1964 18.1158 18.1810 18.1607 18.1941 18.1267 18.1061 housing 14.3016 14.2195 14.0409 14.2499 14.1983 14.2868 14.3129 vowel 13.9253 13.8426 13.8817 13.8337 14.1368 13.8633 13.8375 svmguide2 28.1091 28.0546 27.9640 28.1052 27.9693 28.0417 28.1128 vehicle 18.5295 18.3693 18.2547 18.4873 18.3124 18.4128 18.3910 wine 16.7668 16.7548 16.7457 16.7596 16.6790 16.6954 16.5719 wdbc 35.1916 35.1814 35.0023 35.1402 35.1366 35.1881 35.1850 Table 2 reports the results on real data. In general, the mixture model Q obtained from the proposed shrinkage estimators tend to achieve lower negative log-likelihood score than that obtained from the standard empirical estimator. Moreover, we can observe that the relative performance of different filter functions vary across datasets, suggesting that, in addition to potential gain from shrinkage, incorporating prior knowledge through the choice of filter function could lead to further improvement. 6 Conclusion We shows that several shrinkage strategies can be adopted to improve the kernel mean estimation. This paper considers the spectral filtering approach as one of such strategies. Compared to previous work [1], our estimators take into account the specifics of kernel methods and meaningful prior knowledge through the choice of filter functions, resulting in a wider class of shrinkage estimators. The theoretical analysis also reveals a fundamental similarity to standard supervised setting. Our estimators are simple to implement and work well in practice, as evidenced by the empirical results. Acknowledgments The first author thanks Ingo Steinwart for pointing out existing works along the line of spectral filtering, and Arthur Gretton for suggesting the connection of shrinkage to smooth operator framework. This work was carried out when the second author was a Research Fellow in the Statistical Laboratory, Department of Pure Mathematics and Mathematical Statistics at the University of Cambridge. 8 References [1] K. Muandet, K. Fukumizu, B. Sriperumbudur, A. Gretton, and B. Sch¨olkopf. “Kernel Mean Estimation and Stein Effect”. In: ICML. 2014, pp. 10–18. [2] B. Sch¨olkopf, A. Smola, and K.-R. M¨uller. “Nonlinear Component Analysis as a Kernel Eigenvalue Problem”. In: Neural Computation 10.5 (July 1998), pp. 1299–1319. [3] J. Shawe-Taylor and N. Cristianini. Kernel Methods for Pattern Analysis. Cambridge, UK: Cambridge University Press, 2004. [4] B. Sch¨olkopf and A. J. Smola. Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. Cambridge, MA, USA: MIT Press, 2001. [5] A. Berlinet and T. C. Agnan. Reproducing Kernel Hilbert Spaces in Probability and Statistics. Kluwer Academic Publishers, 2004. [6] A. Smola, A. Gretton, L. Song, and B. Sch¨olkopf. “A Hilbert Space Embedding for Distributions”. In: ALT. Springer-Verlag, 2007, pp. 13–31. [7] A. Gretton, K. M. Borgwardt, M. Rasch, B. Sch¨olkopf, and A. J. Smola. “A kernel method for the two-sample-problem”. In: NIPS. 2007. [8] K. Muandet, K. Fukumizu, F. Dinuzzo, and B. Sch¨olkopf. “Learning from Distributions via Support Measure Machines”. In: NIPS. 2012, pp. 10–18. [9] L. Song, J. Huang, A. Smola, and K. Fukumizu. “Hilbert Space Embeddings of Conditional Distributions with Applications to Dynamical Systems”. In: ICML. 2009. [10] K. Muandet, D. Balduzzi, and B. Sch¨olkopf. “Domain Generalization via Invariant Feature Representation”. In: ICML. 2013, pp. 10–18. [11] K. Muandet and B. Sch¨olkopf. “One-Class Support Measure Machines for Group Anomaly Detection”. In: UAI. AUAI Press, 2013, pp. 449–458. [12] B. K. Sriperumbudur, A. Gretton, K. Fukumizu, B. Sch¨olkopf, and G. R. G. Lanckriet. “Hilbert Space Embeddings and Metrics on Probability Measures”. In: JMLR 99 (2010), pp. 1517–1561. [13] K. Fukumizu, L. Song, and A. Gretton. “Kernel Bayes’ Rule: Bayesian Inference with Positive Definite Kernels”. In: JMLR 14 (2013), pp. 3753–3783. [14] C. M. Stein. “Estimation of the Mean of a Multivariate Normal Distribution”. In: The Annals of Statistics 9.6 (1981), pp. 1135–1151. [15] H. W. Engl, M. Hanke, and A. Neubauer. Regularization of Inverse Problems. Vol. 375. Mathematics and its Applications. Kluwer Academic Publishers Group, Dordrecht, 1996. [16] E. D. Vito, L. Rosasco, and R. Verri. Spectral Methods for Regularization in Learning Theory. 2006. [17] E. D. Vito, L. Rosasco, A. Caponnetto, U. D. Giovannini, and F. Odone. “Learning from Examples as an Inverse Problem.” In: JMLR 6 (2005), pp. 883–904. [18] L. Baldassarre, L. Rosasco, A. Barla, and A. Verri. “Vector Field Learning via Spectral Filtering.” In: ECML/PKDD (1). Vol. 6321. Lecture Notes in Computer Science. Springer, 2010, pp. 56–71. [19] J. Kim and C. D. Scott. “Robust Kernel Density Estimation”. In: JMLR 13 (2012), 2529–2565. [20] I. Steinwart and A. Christmann. Support Vector Machines. New York: Springer, 2008. [21] L. Song and B. Dai. “Robust Low Rank Kernel Embeddings of Multivariate Distributions”. In: NIPS. 2013, pp. 3228–3236. [22] S. Gr¨unew¨alder, G. Arthur, and J. Shawe-Taylor. “Smooth Operators”. In: ICML. Vol. 28. 2013, pp. 1184–1192. [23] L. L. Gerfo, L. Rosasco, F. Odone, E. D. Vito, and A. Verri. “Spectral Algorithms for Supervised Learning.” In: Neural Computation 20.7 (2008), pp. 1873–1897. [24] O. V. Lepski, E. Mammen, and V. G. Spokoiny. “Optimal Spatial Adaptation to Inhomogeneous Smoothness: An Approach based on Kernel Estimates with Variable Bandwith Selectors”. In: Annals of Statistics 25 (1997), pp. 929–947. [25] G. Golub, M. Heath, and G. Wahba. “Generalized Cross-Validation as a Method for Choosing a Good Ridge Parameter”. In: Technometrics 21 (1979), pp. 215–223. [26] L. Song, X. Zhang, A. Smola, A. Gretton, and B. Sch¨olkopf. “Tailoring Density Estimation via Reproducing Kernel Moment Matching”. In: ICML. 2008, pp. 992–999. 9
2014
324
5,430
A Dual Algorithm for Olfactory Computation in the Locust Brain Sina Tootoonian M´at´e Lengyel st582@eng.cam.ac.uk m.lengyel@eng.cam.ac.uk Computational & Biological Learning Laboratory Department of Engineering, University of Cambridge Trumpington Street, Cambridge CB2 1PZ, United Kingdom Abstract We study the early locust olfactory system in an attempt to explain its wellcharacterized structure and dynamics. We first propose its computational function as recovery of high-dimensional sparse olfactory signals from a small number of measurements. Detailed experimental knowledge about this system rules out standard algorithmic solutions to this problem. Instead, we show that solving a dual formulation of the corresponding optimisation problem yields structure and dynamics in good agreement with biological data. Further biological constraints lead us to a reduced form of this dual formulation in which the system uses independent component analysis to continuously adapt to its olfactory environment to allow accurate sparse recovery. Our work demonstrates the challenges and rewards of attempting detailed understanding of experimentally well-characterized systems. 1 Introduction Olfaction is perhaps the most widespread sensory modality in the animal kingdom, often crucial for basic survival behaviours such as foraging, navigation, kin recognition, and mating. Remarkably, the neural architecture of olfactory systems across phyla is largely conserved [1]. Such convergent evolution suggests that what we learn studying the problem in small model systems will generalize to larger ones. Here we study the olfactory system of the locust Schistocerca americana. While we focus on this system because it is experimentally well-characterized (Section 2), we expect our results to extend to other olfactory systems with similar architectures. We begin by observing that although most odors are mixtures of hundreds of molecular species, with typically only a few of these dominating in concentration – i.e. odors are sparse in the space of molecular concentrations (Fig. 1A). We introduce a simple generative model of odors and their effects on odorant receptors that reflects this sparsity (Section 3). Inspired by recent experimental findings [2], we then propose that the function of the early olfactory system is maximum a posteriori (MAP) inference of these concentration vectors from receptor inputs (Section 4). This is basically a sparse signal recovery problem, but the wealth of biological evidence available about the system rules out standard solutions. We are then led by these constraints to propose a novel solution to this problem in term of its dual formulation (Section 5), and further to a reduced form of this solution (Section 6) in which the circuitry uses ICA to continuously adapt itself to the local olfactory environment (Section 7). We close by discussing predictions of our theory that are amenable to testing in future experiments, and future extensions of the model to deal with readout and learning simultaneously, and to provide robustness against noise corrupting sensory signals (Section 8). 1 Molecules Relative concentration 0 1 2 Time (s) E D A C 0 1 2 Time (s) antenna mushroom body (MB) antennal lobe (AL) 90,000 ORNs ~1000 glomeruli ~1000 PNs ~300 LNs 50,000 KCs 1 GGN Odors ~100 bLNs Behaviour B Figure 1: Odors and the olfactory circuit. (A) Relative concentrations of ∼70 molecules in the odor of the Festival strawberry cultivar, demonstrating sparseness of odor vectors. (B,C) Diagram and schematic of the locust olfactory circuit. Inputs from 90,000 ORNs converge onto ∼1000 glomeruli, are processed by the ∼1000 cells (projection neurons, PN, and local internuerons, LNs) of the antennal lobe, and read out in a feedforward manner by the 50,000 Kenyon cells (KC) of the mushroom body, whose activity ultimately is read out to produce behavior. (D,E) Odor response of a PN (D) and a KC (E) to 7 trials of 44 mixtures of 8 monomolecular components (colors) demonstrating cell- and odor-specific responses. The odor presentation window is in gray. PN responses are dense and temporally patterned. KC responses are sparse and are often sensitive to single molecules in a mixture. Panel A is reproduced from [8], B from [6], and D-E from the dataset in [2]. 2 Biological background A schematic of the locust olfactory system is shown in Figure 1B-C. Axons from ∼90, 000 olfactory receptor neurons (ORNs) each thought to express one type of olfactory receptor (OR) converge onto approximately 1000 spherical neuropilar structures called ‘glomeruli’, presumably by the ‘1-OR-to1-glomerulus’ rule observed in flies and mice. The functional role of this convergence is thought to be noise reduction through averaging. The glomeruli are sampled by the approximately 800 excitatory projection neurons (PNs) and 300 inhibitory local interneurons (LNs) of the antennal lobe (AL). LNs are densely connected to other LNs and to the PNs; PNs are connected to each-other only indirectly via their dense connections to LNs [3]. In response to odors, the AL exhibits 20 Hz local field potential oscillations and odorand cell-specific activity patterns in its PNs and LNs (Fig. 1D). The PNs form the only output of the AL and project densely [4] to the 50,000 Kenyon cells (KCs) of the mushroom body (MB). The KCs decode the PNs in a memoryless fashion every oscillation cycle, converting the dense and promiscuous PN odor code into a very sparse and selective KC code [5], often sensitive to a single component in a complex odor mixture [2] (Fig. 1E). KCs make axo-axonal connections with neighbouring KCs [6] but otherwise only communicate with one-another indirectly via global inhibition mediated by the giant GABA-ergic neuron [7]. Thus, while the AL has rich recurrency, there is no feedback from the KCs back to the AL: the PN to KC circuit is strictly feedforward. As we shall see below, this presents a fundamental challenge to theories of AL-MB computation. 2 3 Generative model Natural odors are mixtures of hundreds of different types of molecules at various concentrations (e.g. [8]), and can be represented as points in RN +, where each dimension represents the concentration of one of the N molecular species in ‘odor space’. Often a few of these will be at a much higher concentration than the others, i.e. natural odors are sparse. Because the AL responds similarly across concentrations [9] , we will ignore concentration in our odor model and consider odors as binary vectors x ∈{0, 1}N. We will also assume that molecules appear in odor vectors independently of one-another with probability k/N, where k is the average complexity of odors (# of molecules/odor, equivalently the Hamming weight of x) in odor space. We assume a linear noise-free observation model y = Ax for the M-dimensional glomerular activity vector (we discuss observation noise in Section 7). A is an M × N affinity matrix representing the response of each of the M glomeruli to each of the N molecular odor components and has elements drawn iid. from a zero-mean Gaussian with variance 1/M. Our generative model for odors and observations is summarized as x = {x1, . . . , xN}, xi ∼Bernoulli(k/N), y = Ax, Aij ∼N(0, M −1) (1) 4 Basic MAP inference Inspired by the sensitivity of KCs to monomolecular odors [2], we propose that the locust olfactory system acts as a spectrum analyzer which uses MAP inference to recover the sparse N-dimensional odor vector x responsible for the dense M-dimensional glomerular observations y, with M ≪ N e.g. O(1000) vs. O(10000) in the locust. Thus, the computational problem is akin to one in compressed sensing [10], which we will exploit in Section 5. We posit that each KC encodes the presence of a single molecular species in the odor, so that the overall KC activity vector represents the system’s estimate of the odor that produced the observations y. To perform MAP inference on binary x from y given A, a standard approach is to relax x to the positive orthant RN + [11], smoothen the observation model with isotropic Gaussian noise of variance σ2 and perform gradient descent on the log posterior log p(x|y, A, k) = C −β∥x∥1 − 1 2σ2 ∥y −Ax∥2 2 (2) where β = log((1−q)/q), q = k/N, ∥x∥1 = PM i=1 xi for x ⪰0, and C is a constant. The gradient of the posterior determines the x dynamics: ˙x ∝∇x log p = −β sgn(x) + 1 2σ2 AT (y −Ax) (3) Given our assumed 1-to-1 mapping of KCs to (decoded) elements of x, these dynamics fundamentally violate the known biology for two reasons. First, they stipulate KC dynamics where there are none. Second, they require all-to-all connectivity of KCs via AT A where none exist. In reality, the dynamics in the circuit occur in the lower (∼M) dimensional measurement space of the antennal lobe, and hence we need a way of solving the inference problem there rather than directly in the high (N) dimensional space of KC activites. 5 Low dimensional dynamics from duality To compute the MAP solution using lower-dimensional dynamics, we consider the following compressed sensing (CS) problem: minimize ∥x∥1, subject to ∥y −Ax∥2 2 = 0 (4) whose Lagrangian has the form L(x, λ) = ∥x∥1 + λ∥y −Ax∥2 2 (5) where λ is a scalar Lagrange multiplier. This is exactly the equation for our (negative) log posterior (Eq. 2) with the constants absorbed by λ. We will assume that because x is binary, the two systems will have the same solution, and will henceforth work with the CS problem. 3 To derive low dimensional dynamics, we first reformulate the constraint and solve minimize ∥x∥1, subject to y = Ax (6) with Lagrangian L(x, λ) = ∥x∥1 + λT (y −Ax) (7) where now λ is a vector of Lagrange multipliers. Note that we are still solving an N-dimensional minimization problem with M ≪N constraints, while we need M-dimensional dynamics. Therefore, we consider the dual optimization problem of maximizing g(λ) where g(λ) = infx L(x, λ) is the dual Lagrangian of the problem. If strong duality holds, the primal and dual objectives have the same value at the solution, and the primal solution can be found by minimizing the Lagrangian at the optimal value of λ [11]. Were x ∈RN, strong duality would hold for our problem by Slater’s sufficiency condition [11]. The binary nature of x robs our problem of the convexity required for this sufficiency condition to be applicable. Nevertheless we proceed assuming strong duality holds. The dual Lagrangian has a closed-form expression for our problem. To see this, let b = AT λ. Then, exploiting the form of the 1-norm and x being binary, we obtain the following: g(λ)−λT y = inf x ∥x∥1−bT x = inf x M X i=1 (|xi|−bixi) = M X i=1 inf xi (|xi|−bixi) = − M X i=1 [bi−1]+ (8) or, in vector form, g(λ) = λT y −1T [b −1]+, where [·]+ is the positive rectifying function. Maximizing g(λ) by gradient descent yields M dimensional dynamics in λ: ˙λ ∝∇λ g = y −A θ(AT λ −1) (9) where θ(·) is the Heaviside function. The solution to the CS problem – the odor vector that produced the measurements y – is then read out at the convergence of these dynamics to λ⋆as x⋆= argminx L(x, λ⋆) = θ(AT λ⋆−1) (10) A natural mapping of equations 9 and 10 to antennal lobe dynamics is for the output of the M glomeruli to represent y, the PNs to represent λ, and the KCs to represent (the output of) θ, and hence eventually x⋆. Note that this would still require the connectivity between PNs and KCs to be negative reciprocal (and determined by the affinity matrix A). We term the circuit under this mapping the full dual circuit (Fig. 2B). These dynamics allow neuronal firing rates to be both positive and negative, hence they can be implemented in real neurons as e.g. deviations relative to a baseline rate [12], which is subtracted out at readout. We measured the performance of a full dual network of M = 100 PNs in recovering binary odor vectors containing an average of k = 1 to 10 components out of a possible N = 1000. The results in Figure 2E (blue) show that the dynamics exhibit perfect recovery.1 For comparison, we have included the performance of the purely feedforward circuit (Fig. 2A), in which the glomerular vector y is merely scaled by the k-specific amount that yields minimum error before being read out by the KCs (Fig. 2E, black). In principle, no recurrent circuit should perform worse than this feedfoward network, otherwise we have added substantial (energetic and time) costs without computational benefits. 6 The reduced dual circuit The full dual antennal lobe circuit described by Equations 9 and 10 is in better agreement with the known biology of the locust olfactory system than 2 for a number of reasons: 1. Dynamics are in the lower dimensional space of the antennal lobe PNs (λ) rather than the mushroom body KCs (x). 2. Each PN λi receives private glomerular input yi 3. There are no direct connections between PNs; their only interaction with other PNs is indirect via inhibition provided by θ. 1See the the Supplementary Material for considerations when simulating the piecewise linear dynamics of 9. 4 0 1 2 3 4 5 6 7 8 k Distance Feedforward Full Dual Reduced Dual 0 0.02 0.04 PN activation 0 0.2 0.4 0.6 0.8 1 LN activation Time (a.u.) A Feedforward Circuit B Full Dual C Reduced Dual Odor PNs Odor LNs Odor glom. KCs D E 1 2 3 4 5 6 7 8 9 10 Figure 2: Performance of the feedforward and the dual circuits. (A-C) Circuit schematics. Arrows (circles) indicate excitatory (inhibitory) connections. (D) Example PN and LN odor-evoked dynamics for the reduced dual circuit. Top: PNs receive cell-specific excitation or inhibition whose strength is changed as different LNs are activated, yielding cell-specific temporal patterning. Bottom: The LNs whose corresponding KCs encode the odor (red) are strongly excited and eventually breach the threshold (dashed line), causing changes to the dynamics (time points marked with dots). The excitation of the other LNs (pink) remains subthreshold. (E) Hamming distance between recovered and true odor vector as a function of odor density k. The dual circuits generally outperform the feedforward system over the entire range tested. Points are means, bars are s.e.m., computed for 200 trials (feedforward) and all trials from 200 attempts in which the steady-state solution was found (dual circuits, greater than 90%). 4. The KCs serve merely as a readout stage and are not interconnected.2 However, there is also a crucial disagreement of the full dual dynamics with biology: the requirement for feedback from the KCs to the PNs. The mapping of λ to PNs and θ to the KCs in Equation 9 implies negative reciprocal connectivity of PNs and KCs, i.e. a feedforward connection of Aij from PN i to KC j, and a feedback connection of −Aij from KC j to PN i. This latter connection from KCs to PNs violates biological fact – no such direct and specific connectivity from KCs to PNs exists in the locust system, and even if it did, it would most likely be excitatory rather than inhibitory, as KCs are excitatory. Although KCs are not inhibitory, antennal lobe LNs are and connect densely to the PNs. Hence they could provide the feedback required to guide PN dynamics. Unfortunately, the number of LNs is on the order of that of the PNs, i.e. much fewer than the number of the KCs, making it a priori unlikely that they could replace the KCs in providing the detailed pattern of feedback that the PNs require under the full dual dynamics. To circumvent this problem, we make two assumptions about the odor environment. The first is that any given environment contains a small fraction of the set of all possible molecules in odor space. This implies the potential activation of only a small number of KCs, whose feedback patterns (columns of A) could then be provided by the LNs. The second assumption is that the environment changes sufficiently slowly that the animal has time to learn it, i.e. that the LNs can update their feedback patterns to match the change in required KC activations. This yields the reduced dual circuit, in which the reciprocal interaction of the PNs with the KCs via the matrix A is replaced with interaction with the M LNs via the square matrix B. The activity of the LNs represents the activity of the KCs encoding the molecules in the current odor environment, 2Although axo-axonal connections between neighbouring KC axons in the mushroom body peduncle are known to exist [6], see also Section 2. 5 and the columns of B are the corresponding columns of the full A matrix: ˙λ ∝y −B θ(BT λ −1), x = θ(AT λ −1) (11) Note that instantaneous readout of the PNs is still performed by the KCs as in the full dual. The performance of the reduced dual is shown in red in Figure 2E, demonstrating better performance than the feedforward circuit, though not the perfect recovery of the full dual. This is because the solution sets of the two equations are not the same: Suppose that B = A:,1:M, and that y = Pk i=1 A:,i. The corresponding solution set for reduced dual is Λ1(y) = {λ : (B:,1:k)T λ > 1 ∧ (B:,k+1:M)T λ < 1}, equivalently Λ1(y) = {λ : (A:,1:k)T λ > 1 ∧(A:,k+1:M)T λ < 1}. On the other hand, the solution set for the full dual is Λ0(y) = {λ : (A:,1:k)T λ > 1 ∧(A:,k+1:M)T λ < 1 ∧(A:,M+1:N)T λ < 1}. Note the additional requirement that the projection of λ onto columns M + 1 to N of A must also be less than 1. Hence any solution to the full dual is a solution to the reduced dual , but not necessarily vise-versa: Λ0(y) ⊆Λ1(y). Since only the former are solutions to the full problem, not all solutions to the reduced dual will solve it, leading to the reduced peformance observed. This analysis also implies that increasing (or decreasing) the number of columns in B, so that it is no longer square, will improve (worsen) the performance of the reduced dual, by making its solution-set a smaller (larger) superset of Λ0(y). 7 Learning via ICA Figure 2 demonstrates that the reduced dual has reasonable performance when the B matrix is correct, i.e. it contains the columns of A for the KCs that would be active in the current odor environment. How would this matrix be learned before birth, when presumably little is known about the local environment, or as the animal moves from one odor environment to another? Recall that, according to our generative model (Section 2) and the additional assumptions made for deriving the reduced dual circuit (Section 6), molecules appear independently at random in odors of a given odor environment and the mapping from odors x to glomerular responses y is linear in x via the square mixing matrix B. Hence, our problem of learning B is precisely that of ICA (or more precisely, sparse coding, as the observation noise variance is assumed to be σ2 > 0 for inference), with binary latent variables x. We solve this problem using MAP inference via EM with a mean-field variational approximation q(x) to the posterior p(x|y, B) [13], where q(x) ≜ QM i=1 Bernoulli(xi; qi) = QM i=1 qxi i (1 −qi)1−xi. The E-step, after observing that for binary x, x2 = x, is ∆q ∝−γ −log q 1−q + 1 σ2 BT y − 1 σ2 Cq, with γ = β1 + 1 2σ2 c, β = log((1 −q0)/q0), q0 = k/M, the vector c = diag(BT B), and C = BT B −diag(c), i.e. C is BT B with the diagonal elements set to zero. To yield more plausible neural dynamics, we change variables to v = log(q/(1 −q)). By the chain rule ˙v = diag(∂vi/∂qi) ˙q. As vi is monotonically increasing in qi, and so the corresponding partial derivatives are all positive, and the resulting diagonal matrix is positive definite, we can ignore it in performing gradient descent and still minimize the same objective. Hence we have ∆v ∝−γ −v + 1 σ2 BT y −1 σ2 Cq(v), q(v) = 1 1 + exp(−v), (12) with the obvious mapping of v to LN membrane potentials, and q as the sigmoidal output function representing graded voltage-dependent transmitter release observed in locust LNs. The M-step update is made by changing B to increase log p(B) + Eq log p(x, y|B), yielding ∆B ∝−1 M B + 1 σ2 (rqT + B diag(q(1 −q))), r ≜y −Bq. (13) Note that this update rule takes the form of a local learning rule. Empirically, we observed convergence within around 10,000 iterations using a fixed step size of dt ≈10−2, and σ ≈0.2 for M in the range of 20–100 and k in the range of 1–5. In cases when the algorithm did not converge, lowering σ slightly typically solved the problem. The performance of the algorithm is shown in figure 3. Although the B matrix is learned to high accuracy, it is not learned exactly. The resulting algorithmic noise renders the performance of the dual shown in Fig. 2E an upper bound, since there the exact B matrix was used. 6 0 2000 4000 6000 8000 10000 10 −6 10 −4 10 −2 10 0 Iteration MSE Column of Btrue Coefficient of Binitial Column of Btrue Coefficient of Blearned -1 1 0 A B C Figure 3: ICA performance for M = 40, k = 1, dt = 10−2. (A) Time course of mean squared error between the elements of the estimate B and their true values for 10 different random seeds. σ = 0.162 for six of the seeds, 0.15 for three, and 0.14 for one. (B,C) Projection of the columns of Btrue into the basis of the columns of B before (B) and after learning (C), for one of the random seeds. Plotted values before learning are clipped to the -1–1 range. 8 Discussion 8.1 Biological evidence and predictions Our work is consistent with much of the known anatomy of the locust olfactory system, e.g. the lack of connectivity between PNs and dense connectivity between LNs, and between LNs and PNs [3]; direct ORN inputs to LNs (observed in flies [14]; unknown in locust); dense connectivity from PNs to KCs [4]; odor-evoked dynamics in the antennal lobe [2], vs. memoryless readout in the KCs [5]. In addition, we require gradient descent PN dynamics (untested directly, but consistent with PN dynamics reaching fixed-points upon prolonged odor presentation [15]), and short-term plasticity in the antennal lobe for ICA (a direct search for ICA has not been performed, but short-term plasticity is present in trial-to-trial dynamics [16]). Our model also makes detailed predictions about circuit connectivity. First, it predicts a specific structure for the PN-to-KC connectivity matrix, namely AT , the transpose of the affinity matrix. This is superficially at odds with recent work in flies suggesting random connectivity between PNs and KCs (detailed connectivity information is not present in the locust). Murthy and colleagues [17] examined a small population of genetically identifiable KCs and found no evidence of response stereotypy across flies, unlike that present at earlier stages in the system. Our model is agnostic to permutations of the output vector as these reassign the mapping between KCs and molecules and affect neither information content nor its format, so our results would be consistent with [17] under animal-specific permutations. Caron and co-workers [18] analysed the structural connectivity of single KCs to glomeruli and found it consistent with random connectivity conditioned on a glomerulus-specific connection probability. This is also consistent with our model, with the observed randomness reflecting that of the affinity matrix itself. Our model would predict (a) the observation of repeated connectivity motifs if enough KCs (across animals) were observed, and that (b) each connectivity motif corresponds to the (binarized) glomerular response vector evoked by a particular molecule. In addition we predict symmetric inhibitory connectivity between LNs (BT B), and negative reciprocal connectivity between PNs and LNs (Bij from PN i to LN j and −Bij from LN to PN). 8.2 Combining learning and readout We have presented two mechanisms above – the reduced dual for readout and and ICA for learning – both of which need to be at play to guarantee high performance. In fact, these two mechanisms must be active simultaneously in the animal. Here we sketch a possible mechanism for combining them. The key is equation 12, which we repeat below, augmented with an additional term from the PNs: ∆v ∝−v +  −γ + 1 σ2 BT y −1 σ2 C q(v)  +  BT λ −1  = −v + Ilearning + Ireadout. 7 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 k Distance Feedforward Full Dual Reduced Dual −0.5 0 0.5 −0.5 0 0.5 A B Figure 4: Effects of noise. (A) As in Figure 2E but with a small amount of additive noise in the observations. The full dual still outperforms the feedforward circuit which in turn outperforms the reduced dual over nearly half the tested range. (B) The feedback surface hinting at noise sensitivity. PN phase space is colored according to activation of each of the KCs and a 2D projection around the origin is shown. The average size of a zone with a uniform color is quite small, suggesting that small perturbations would change the configuration of KCs activated by a PN, and hence the readout performance. Suppose (a) the two input channels were segregated e.g. on separate dendritic compartments, and such that (b) the readout component was fast but weak, while (c) the learning component was slow but strong, and (d) the v time constant was faster than both. Early after odor presentation, the main input to the LN would be from the readout circuit, driving the PNs to their fixed point. The input from the learning circuit would eventually catch up and dominate that of the readout circuit, driving the LN dynamics for learning. Importantly, if B has already been learned, then the output of the LNs, q(v), would remain essentially unchanged throughout, as both the learning and readout circuits would produce the same (steady-state) activation vector in the LNs. If the matrix is incorrect, then the readout is likely to be incorrect already, and so the important aspect is the learning update which would eventually dominate. This is just one possibility for combining learning and readout. Indeed, even the ICA updates themselves are non-trivial to implement. We leave the details of both to future work. 8.3 Noise sensitivity Although our derivations for serving inference and learning rules assumed observation noise, the data that we provided to the models contained none. Adding a small amount of noise reduces the performance of the dual circuits, particularly that of the reduced dual, as shown in Figure 4A. Though this may partially be attributed to numerical integration issues (Supplementary Material), there is likely a fundamental theoretical cause underlying it. This is hinted at by the plot in figure 4B of a 2D projection in PN space of the overlayed halfspaces defined by the activation of each of the N KCs. In the central void no KC is active and λ can change freely along ˙λ. As λ crosses into a halfspace, the corresponding KC is activated, changing ˙λ and the trajectory of λ. The different colored zones indicate different patterns of KC activation and correspondingly different changes to ˙λ. The small size of these zones suggests that small changes in the trajectory of λ caused e.g. by noise could result in very different patterns of KC activation. For the reduced dual, most of these halfspaces are absent for the dynamics since B has only a small subset of the columns of A, but are present during readout, exacerbating the problem. How the biological system overcomes this apparently fundamental sensitivity is an important question for future work. Acknowledgements This work was supported by the Wellcome Trust (ST, ML). 8 References [1] Eisthen HL. Why are olfactory systems of different animals so similar?, Brain, behavior and evolution 59:273, 2002. [2] Shen K, et al. Encoding of mixtures in a simple olfactory system, Neuron 80:1246, 2013. [3] Jortner RA. Personal communication. [4] Jortner RA, et al. A simple connectivity scheme for sparse coding in an olfactory system, The Journal of neuroscience 27:1659, 2007. [5] Perez-Orive J, et al. Oscillations and sparsening of odor representations in the mushroom body, Science 297:359, 2002. [6] Leitch B, Laurent G. Gabaergic synapses in the antennal lobe and mushroom body of the locust olfactory system, The Journal of comparative neurology 372:487, 1996. [7] Papadopoulou M, et al. Normalization for sparse encoding of odors by a wide-field interneuron, Science 332:721, 2011. [8] Jouquand C, et al. A sensory and chemical analysis of fresh strawberries over harvest dates and seasons reveals factors that affect eating quality, Journal of the American Society for Horticultural Science 133:859, 2008. [9] Stopfer M, et al. Intensity versus identity coding in an olfactory system, Neuron 39:991, 2003. [10] Foucart S, Rauhut H. A mathematical introduction to compressive sensing. Springer, 2013. [11] Boyd SP, Vandenberghe L. Convex optimization. Cambridge University Press, 2004. [12] Dayan P, Abbott L. Theoretical Neuroscience. Massachusetts Institute of Technology Press, 2005. [13] Neal RM, Hinton GE. In Learning in graphical models, 355, 1998. [14] Ng M, et al. Transmission of olfactory information between three populations of neurons in the antennal lobe of the fly, Neuron 36:463, 2002. [15] Mazor O, Laurent G. Transient dynamics versus fixed points in odor representations by locust antennal lobe projection neurons, Neuron 48:661, 2005. [16] Stopfer M, Laurent G. Short-term memory in olfactory network dynamics, Nature 402:664, 1999. [17] Murthy M, et al. Testing odor response stereotypy in the Drosophila mushroom body, Neuron 59:1009, 2008. [18] Caron SJ, et al. Random convergence of olfactory inputs in the drosophila mushroom body, Nature 497:113, 2013. 9
2014
325
5,431
Online combinatorial optimization with stochastic decision sets and adversarial losses Gergely Neu Michal Valko SequeL team, INRIA Lille – Nord Europe, France {gergely.neu,michal.valko}@inria.fr Abstract Most work on sequential learning assumes a fixed set of actions that are available all the time. However, in practice, actions can consist of picking subsets of readings from sensors that may break from time to time, road segments that can be blocked or goods that are out of stock. In this paper we study learning algorithms that are able to deal with stochastic availability of such unreliable composite actions. We propose and analyze algorithms based on the Follow-The-PerturbedLeader prediction method for several learning settings differing in the feedback provided to the learner. Our algorithms rely on a novel loss estimation technique that we call Counting Asleep Times. We deliver regret bounds for our algorithms for the previously studied full information and (semi-)bandit settings, as well as a natural middle point between the two that we call the restricted information setting. A special consequence of our results is a significant improvement of the best known performance guarantees achieved by an efficient algorithm for the sleeping bandit problem with stochastic availability. Finally, we evaluate our algorithms empirically and show their improvement over the known approaches. 1 Introduction In online learning problems [4] we aim to sequentially select actions from a given set in order to optimize some performance measure. However, in many sequential learning problems we have to deal with situations when some of the actions are not available to be taken. A simple and wellstudied problem where such situations arise is that of sequential routing [8], where we have to select every day an itinerary for commuting from home to work so as to minimize the total time spent driving (or even worse, stuck in a traffic jam). In this scenario, some road segments may be blocked for maintenance, forcing us to work with the rest of the road network. This problem is isomorphic to packet routing in ad-hoc computer networks where some links might not be always available because of a faulty transmitter or a depleted battery. Another important class of sequential decision-making problems where the decision space might change over time is recommender systems [11]. Here, some items may be out of stock or some service may not be applicable at some time (e.g., a movie not shown that day, bandwidth issues in video streaming services). In these cases, the advertiser may refrain from recommending unavailable items. Other reasons include a distributor being overloaded with commands or facing shipment problems. Learning problems with such partial-availability restrictions have been previously studied in the framework of prediction with expert advice. Freund et al. [7] considered the problem of online prediction with specialist experts, where some experts’ predictions might not be available from time to time, and the goal of the learner is to minimize regret against the best mixture of experts. Kleinberg et al. [15] proposed a stronger notion of regret measured against the best ranking of experts and gave efficient algorithms that work under stochastic assumptions on the losses, referring to this setting as prediction with sleeping experts. They have also introduced the notion of sleeping bandit problems where the learner only gets partial feedback about its decisions. They gave an inefficient algorithm 1 for the non-stochastic case, with some hints that it might be difficult to learn efficiently in this general setting. This was later reaffirmed by Kanade and Steinke [14], who reduce the problem of PAC learning of DNF formulas to a non-stochastic sleeping experts problem, proving the hardness of learning in this setup. Despite these negative results, Kanade et al. [13] have shown that there is still hope to obtain efficient algorithms in adversarial environments, if one introduces a certain stochastic a assumption on the decision set. In this paper, we extend the work of Kanade et al. [13] to combinatorial settings where the action set of the learner is possibly huge, but has a compact representation. We also assume stochastic action availability: in each decision period, the decision space is drawn from a fixed but unknown probability distribution independently of the history of interaction between the learner and the environment. The goal of the learner is to minimize the sum of losses associated with its decisions. As usual in online settings, we measure the performance of the learning algorithm by its regret defined as the gap between the total loss of the best fixed decision-making policy from a pool of policies and the total loss of the learner. The choice of this pool, however, is a rather delicate question in our problem: the usual choice of measuring regret against the best fixed action is meaningless, since not all actions are available in all time steps. Following Kanade et al. [13] (see also [15]), we consider the policy space composed of all mappings from decision sets to actions within the respective sets. We study the above online combinatorial optimization setting under three feedback assumptions. Besides the full-information and bandit settings considered by Kanade et al. [13], we also consider a restricted feedback scheme as a natural middle ground between the two by assuming that the learner gets to know the losses associated only with available actions. This extension (also studied by [15]) is crucially important in practice, since in most cases it is unrealistic to expect that an unavailable expert would report its loss. Finally, we also consider a generalization of bandit feedback to the combinatorial case known as semi-bandit feedback. Our main contributions in this paper are two algorithms called SLEEPINGCAT and SLEEPINGCATBANDIT that work in the restricted and semi-bandit information schemes, respectively. The best known competitor of our algorithms is the BSFPL algorithm of Kanade et al. [13] that works in two phases. First, an initial phase is dedicated to the estimation of the distribution of the available actions. Then, in the main phase, BSFPL randomly alternates between exploration and exploitation. Our technique improves over the FPL-based method of Kanade et al. [13] by removing the costly exploration phase dedicated to estimate the availability probabilities, and also the explicit exploration steps in their main phase. This is achieved by a cheap alternative loss estimation procedure called Counting Asleep Times (or CAT) that does not require estimating the distribution of the action sets. This technique improves the regret bound of [13] after T steps from O(T 4/5) to O(T 2/3) in their setting, and also provides a regret guarantee of O( √ T) in the restricted setting.1 2 Background We now give the formal definition of the learning problem. We consider a sequential interaction scheme between a learner and an environment where in each round t ∈[T] = {1, 2, . . . , T}, the learner has to choose an action Vt from a subset St of a known decision set S ⊆{0, 1}d with ∥v∥1 ≤m for all v ∈S. We assume that the environment selects St according to some fixed (but unknown) distribution P, independently of the interaction history. Unaware of the learner’s decision, the environment also decides on a loss vector ℓt ∈[0, 1]d that will determine the loss suffered by the learner, which is of the form V ⊤ t ℓt. We make no assumptions on how the environment generates the sequence of loss vectors, that is, we are interested in algorithms that work in non-oblivious (or adaptive) environments. At the end of each round, the learner receives some feedback based on the loss vector and the action of the learner. The goal of the learner is pick its actions so as to minimize the losses it accumulates by the end of the T’th round. This setup generalizes the setting of online combinatorial optimization considered by Cesa-Bianchi and Lugosi [5], Audibert et al. [1], where the decision set is assumed to be fixed throughout the learning procedure. The interaction protocol is summarized on Figure 1 for reference. 1While not explicitly proved by Kanade et al. [13], their technique can be extended to work in the restricted setting, where it can be shown to guarantee a regret of O(T 3/4). 2 Parameters: full set of decision vectors S = {0, 1}d, number of rounds T, unknown distribution P ∈∆2S For all t = 1, 2, . . . , T repeat 1. The environment draws a set of available actions St ∼P and picks a loss vector ℓt ∈[0, 1]d. 2. The set St is revealed to the learner. 3. Based on its previous observations (and possibly some source of randomness), the learner picks an action Vt ∈St. 4. The learner suffers loss V ⊤ t ℓt and gets some feedback: (a) in the full information setting, the learner observes ℓt, (b) in the restricted setting, the learner observes ℓt,i for all i ∈Dt, (c) in the semi-bandit setting, the learner observes ℓt,i for all i such that Vt,i = 1. Figure 1: The protocol of online combinatorial optimization with stochastic action availability. We distinguish between three different feedback schemes, the simplest one being the full information scheme where the loss vectors are completely revealed to the learner at the end of each round. In the restricted-information scheme, we make a much milder assumption that the learner is informed about the losses of the available actions. Precisely, we define the set of available components as Dt = {i ∈[d] : ∃v ∈St : vi = 1} and assume that the learner can observe the i-th component of the loss vector ℓt if and only if i ∈Dt. This is a sensible assumption in a number of practical applications, e.g., in sequential routing problems where components are associated with links in a network. Finally, in the semi-bandit scheme, we assume that the learner only observes losses associated with the components of its own decision, that is, the feedback is ℓt,i for all i such that Vt,i = 1. This is the case in in online advertising settings where components of the decision vectors represent customer-ad allocations. The observation history Ft is defined as the sigma-algebra generated by the actions chosen by the learner and the decision sets handed out by the environment by the end of round t: Ft = σ(Vt, St, . . . , V1, S1). The performance of the learner is measured with respect to the best fixed policy (otherwise known as a choice function in discrete choice theory [16]) of the form π : 2S →S. In words, a policy π will pick action π( ¯S) ∈¯S whenever the environment selects action set ¯S. The (total expected) regret of the learner is defined as RT = max π T X t=1 E h (Vt −π(St))⊤ℓt i . (1) Note that the above expectation integrates over both the randomness injected by the learner and the stochastic process generating the decision sets. The attentive reader might notice that this regret criterion is very similar to that of Kanade et al. [13], who study the setting of prediction with expert advice (where m = 1) and measure regret against the best fixed ranking of experts. It is actually easy to show that the optimal policy in their setting belongs to the set of ranking policies, making our regret definition equivalent to theirs. 3 Loss estimation by Counting Asleep Times In this section, we describe our method used for estimating unobserved losses that works without having to explicitly learn the availability distribution P. To explain the concept on a high level, let us now consider our simpler partial-observability setting, the restricted-information setting. For the formal treatment of the problem, let us fix any component i ∈[d] and define At,i = 1{i∈Dt} and ai = E [At,i |Ft−1 ]. Had we known the observation probability ai, we would be able to estimate the i’th component of the loss vector ℓt by ˆℓ∗ t,i = (ℓt,iAt,i)/ai, as the quantity ℓt,iAt,i is observable. It is easy to see that the estimate ˆℓ∗ t,i is unbiased by definition – but, unfortunately, we do not know ai, so we have no hope to compute it. A simple idea used by Kanade et al. [13] is to devote 3 the first T0 rounds of interaction solely to the purpose of estimating ai by the sample mean ˆai = (PT0 t=1 At,i)/T0. While this trick gets the job done, it is obviously wasteful as we have to throw away all loss observations before the estimates are sufficiently concentrated. 2 We take a much simpler approach based on the observation that the “asleep-time” of component i is a geometrically distributed random variable with parameter ai. The asleep-time of component i starting from time t is formally defined as Nt,i = min {n > 0 : i ∈Dt+n} , which is the number of rounds until the next observation of the loss associated with component i. Using the above definition, we construct our loss estimates as the vector ˆℓt whose i-th component is ˆℓt,i = ℓt,iAt,iNt,i. (2) It is easy to see that the above loss estimates are unbiased as E [ℓt,iAt,iNt,i |Ft−1 ] = ℓt,iE [At,i |Ft−1 ] E [Nt,i |Ft−1 ] = ℓt,iai · 1 ai = ℓt,i for any i. We will refer to this loss-estimation method as Counting Asleep Times (CAT). Looking at the definition (2), the attentive reader might worry that the vector ˆℓt depends on future realizations of the random decision sets and thus could be useless for practical use. However, observe that there is no reason that the learner should use the estimate ˆℓt,i before component i wakes up in round t + Nt,i – which is precisely the time when the estimate becomes well-defined. This suggests a very simple implementation of CAT: whenever a component is not available, estimate its loss by the last observation from that component! More formally, set ˆℓt,i = ( ℓt,i, if i ∈Dt ˆℓt−1,i, otherwise. It is easy to see that at the beginning of any round t, the two alternative definitions match for all components i ∈Dt. In the next section, we confirm that this property is sufficient for running our algorithm. 4 Algorithms & their analyses For all information settings, we base our learning algorithms on the Follow-the-Perturbed-Leader (FPL) prediction method of Hannan [9], as popularized by Kalai and Vempala [12]. This algorithm works by additively perturbing the total estimated loss of each component, and then running an optimization oracle over the perturbed losses to choose the next action. More precisely, our algorithms maintain the cumulative sum of their loss estimates bLt = Pt s=1 ˆℓt and pick the action Vt = arg min v∈St v T  η bLt−1 −Zt  , where Zt is a perturbation vector with independent exponentially distributed components with unit expectation, generated independently of the history, and η > 0 is a parameter of the algorithm. Our algorithms for the different information settings will be instances of FPL that employ different loss estimates suitable for the respective settings. In the first part of this section, we present the main tools of analysis that will be used for each resulting method. As usual for analyzing FPL-based methods [12, 10, 18], we start by defining a hypothetical forecaster that uses a time-independent perturbation vector eZ with standard exponential components and peeks one step into the future. However, we need an extra trick to deal with the randomness of the decision set: we introduce the time-independent decision set eS ∼P (drawn independently of the filtration (Ft)t) and define eVt = arg min v∈e S v T  η bLt −eZ  . 2Notice that we require “sufficient concentration” from 1/ˆai and not only from ˆai! The deviation of such quantities is rather difficult to control, as demonstrated by the complicated analysis of Kanade et al. [13]. 4 Clearly, this forecaster is infeasible as it uses observations from the future. Also observe that eVt−1 ∼Vt given Ft−1. The following two lemmas show how analyzing this forecaster can help in establishing the performance of our actual algorithms. Lemma 1. For any sequence of loss estimates, the expected regret of the hypothetical forecaster against any fixed policy π : 2S →S satisfies E " T X t=1  eVt −π( eS) T ˆℓt # ≤m (log d + 1) η . The statement is easily proved by applying the follow-the-leader/be-the-leader lemma3 (see, e.g., [4, Lemma 3.1]) and using the upper bound E  eZ ∞  ≤log d + 1. The following result can be extracted from the proof of Theorem 1 of Neu and Bart´ok [18]. Lemma 2. For any sequence of nonnegative loss estimates, E h ( eVt−1 −eVt) T ˆℓt Ft−1 i ≤η E  eV T t−1 ˆℓt 2 Ft−1  . In the next subsections, we apply these results to obtain bounds for the three information settings. 4.1 Algorithm for full information In the simplest setting, we can use ˆℓt = ℓt, which yields the following theorem: Theorem 1. Define L∗ T = max ( min π E " T X t=1 π(St) Tℓt # , 4(log d + 1) ) . Setting η = p (log d + 1)/L∗ T , the regret of FPL in the full information scheme satisfies RT ≤2m q 2L∗ T (log d + 1). As this result is comparable to the best available bounds for FPL [10, 18] in the full information setting and a fixed decision set, it reinforces the observation of Kanade et al. [13], who show that the sleeping experts problem with full information and stochastic availability is no more difficult than the standard experts problem. The proof of Theorem 1 follows directly from combining Lemmas 1 and 2 with some standard tricks. For completeness, details are provided in Appendix A. 4.2 Algorithm for restricted feedback In this section, we use the CAT loss estimate defined in Equation (2) as ˆℓt in FPL, and call the resulting method SLEEPINGCAT. The following theorem gives the performance guarantee for this algorithm. Theorem 2. Define Qt = Pd i=1 E [Vt,i| i ∈Dt]. The total expected regret of SLEEPINGCAT against the best fixed policy is upper bounded as RT ≤m(log d + 1) η + 2ηm T X t=1 Qt. Proof. We start by observing E  π( eS)T ˆℓt  = E [π(St)Tℓt], where we used that ˆℓt is independent of eS and is an unbiased estimate of ℓt, and also that St ∼eS. The proof is completed by combining this with Lemmas 1 and 2, and the bound E  eV T t−1 ˆℓt 2 Ft−1  ≤2mQt. The proof of this last statement follows from a tedious calculation that we defer to Appendix B. 3This lemma can be proved in the current case by virtue of the fixed decision set eS, allowing the necessary recursion steps to go through. 5 Below, we provide two ways of further bounding the regret under various assumptions. The first one provides a universal upper bound that holds without any further assumptions. Corollary 1. Setting η = p (log d + 1)/(2dT), the regret of SLEEPINGCAT against the best fixed policy is bounded as RT ≤2m p 2dT(log d + 1). The proof follows from the fact that Qt ≤d no matter what P is. A somewhat surprising feature of our bound is its scaling with √d log d, which is much worse than the logarithmic dependence exhibited in the full information case. It is easy to see, however, that this bound is not improvable in general – see Appendix D for a simple example. The next bound, however, shows that it is possible to improve this bound by assuming that most components are reliable in some sense, which is the case in many practical settings. Corollary 2. Assuming ai ≥β for all i, we have Qt ≤1/β, and setting η = p β(log d + 1)/(2T) guarantees that the regret of SLEEPINGCAT against the best fixed policy is bounded as RT ≤2m s 2T(log d + 1) β . 4.3 Algorithm for semi-bandit feedback We now turn our attention to the problem of learning with semi-bandit feedback where the learner only gets to observe the losses associated with its own decision. Specifically, we assume that the learner observes all components i of the loss vector such that Vt,i = 1. The extra difficulty in this setting is that our actions influence the feedback that we receive, so we have to be more careful when defining our loss estimates. Ideally, we would like to work with unbiased estimates of the form ˆℓ∗ t,i = ℓt,i q∗ t,i Vt,i, where q∗ t,i = E [Vt,i| Ft−1] = X ¯ S∈2S P( ¯S)E  Vt,i Ft−1, St = ¯S  . (3) for all i ∈[d]. Unfortunately though, we are in no position to compute these estimates, as this would require perfect knowledge of the availability distribution P! Thus we have to look for another way to compute reliable loss estimates. A possible idea is to use qt,i · ai = E [Vt,i| Ft−1, St] · P [i ∈Dt] . instead of q∗ t,i in Equation 3 to normalize the observed losses. This choice yields another unbiased loss estimate as E  ℓt,iVt,i qt,iai Ft−1  = ℓt,i ai E  E  Vt,i qt,i Ft−1, St  Ft−1  = ℓt,i ai E [At,i| Ft−1] = ℓt,i, (4) which leaves us with the problem of computing qt,i and ai. While this also seems to be a tough challenge, we now show to estimate this quantity by generalizing the CAT technique presented in Section 3. Besides our trick used for estimating the 1/ai’s by the random variables Nt,i, we now also have to face the problem of not being able to find a closed-form expression for the qt,i’s. Hence, we follow the geometric resampling approach of Neu and Bart´ok [18] and draw an additional sequence of M perturbation vectors Z′ t(1), . . . , Z′ t(M) and use them to compute V ′ t (k) = arg min v∈St n η bLt−1 −Z′ t(k) o for all k ∈[M]. Using these simulated actions, we define Kt,i = min  k ∈[M] : V ′ t,i(k) = Vt,i ∪{M}  . and ˆℓt,i = ℓt,iKt,iNt,iVt,i (5) for all i. Setting M = ∞makes this expression equivalent to ℓt,iVt,i qt,iai in expectation, yielding yet another unbiased estimator for the losses. Our analysis, however, crucially relies on setting M to 6 a finite value so as to control the variance of the loss estimates. We are not aware of any other work that achieves a similar variance-reduction effect without explicitly exploring the action space [17, 6, 5, 3], making this alternative bias-variance tradeoff a unique feature of our analysis. We call the algorithm resulting from using the loss estimates above SLEEPINGCATBANDIT. The following theorem gives the performance guarantee for this algorithm. Theorem 3. Define Qt = Pd i=1 E [Vt,i| i ∈Dt]. The total expected regret of SLEEPINGCATBANDIT against the best fixed policy is bounded as RT ≤m(log d + 1) η + 2ηMm T X t=1 Qt + dT eM . Proof. First, observe that E ˆℓt,i Ft−1  ≤ ℓt,i as E [Kt,iVt,i| Ft−1, St] ≤ At,i and E [At,iNt,i| Ft−1] = 1 by definition. Thus, we can get E  π( eS)T ˆℓt  ≤E [π(St)Tℓt] by a similar argument that we used in the proof of Theorem 2. After yet another long and tedious calculation (see Appendix C), we can prove E  eV T t−1 ˆℓt 2 Ft−1  ≤2MmQt. (6) The proof is concluded by combining this bound with Lemmas 1 and 2 and the upper bound E [V T t ℓt| Ft−1] ≤E h eV T t−1 ˆℓt Ft−1 i + d eM , which can be proved by following the proof of Theorem 1 in Neu and Bart´ok [18]. Corollary 3. Setting η =  √m(log d+1) 2dT 2/3 and M = 1 √e ·  dT √ 2m(log d+1) 1/3 guarantees that the regret of SLEEPINGCATBANDIT against the best fixed policy is bounded as RT ≤(2mdT)2/3 · (log d + 1)1/3. The proof of the corollary follows from bounding Qt ≤d and plugging the parameters into the bound of Theorem 3. Similarly to the improvement of Corollary 2, it is possible to replace the factor d2/3 by (d/β)1/3 if we assume that ai ≥β for all i and some β > 0. This corollary implies that SLEEPINGCATBANDIT achieves a regret of (2KT)2/3 · (log K + 1)1/3 in the case when S = [K], that is, in the K-armed sleeping bandit problem considered by Kanade et al. [13]. This improves their bound of O((KT)4/5 log T) by a large margin, thanks to the fact that we did not have to explicitly learn the distribution P. 5 Experiments In this section we present the empirical evaluation of our algorithms for bandit and semi-bandit settings, and compare them to its counterparts [13]. We demonstrate that the wasteful exploration of BSFPL does not only result in worse regret bounds but also degrades its empirical performance. For the bandit case, we evaluate SLEEPINGCATBANDIT using the same setting as Kanade et al. [13]. We consider an experiment with T = 10, 000 and 5 arms, each of which are available independenly of each other with probability p. Losses for each arm are constructed as random walks with Gaussian increments of standard deviation 0.002, initialized uniformly on [0, 1]. Losses outside [0, 1] are truncated. In our first experiment (Figure 2, left), we study the effect of changing p on the performance of BSFPL and SLEEPINGCATBANDIT. Notice that when p is very low, there are few or no arms to choose from. In this case the problems are easy by design and all algorithms suffer low regret. As p increases, the policy space starts to blow up and the problem becomes more difficult. When p approaches one, it collapses into the set of single arms and the problem gets easier again. Observe that the behavior of SLEEPINGCATBANDIT follows this trend. On the other hand, the performance of BSFPL steadily decreases with increasing availability. This is due to the explicit exploration rounds in the main phase of BSFPL, that suffers the loss of the uniform policy scaled by the exploration probability. The performance of the uniform policy is plotted for reference. 7 availabity cumulative regret at time T = 10000 sleeping bandits, 5 arms, varying availabity, average over 20 runs 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.05 0.1 0.15 0.2 0.25 BSFPL SleepingCat RandomGuess Figure 2: Left: Multi-arm bandits - varying availabilities. Middle: Shortest paths on a 3 × 3 grid. Right: Shortest paths on a 10 × 10 grid. To evaluate SLEEPINGCATBANDIT in the semi-bandit setting, we consider the shortest path problem on grids of 3 × 3 and 10 × 10 nodes, which amounts to 12 and 180 edges respectively. For each edge, we generate a random-walk loss sequence in the same way as in our first experiment. In each round t, the learner has to choose a path from the lower left corner to the upper right one composed from available edges. The individual availability of each edge is sampled with probability 0.9, independently of the others. Whenever an edge gets disconnected from the source, it becomes unavailable itself, resuling in a quite complicated action-availability distribution. Once a learner chooses a path, the losses of chosen road segments are revealed and the learner suffers their sum. Since [13] does not provide a combinatorial version of their approach, we compare against COMBBSFPL, a straightforward extension of BSFPL. As in BSFPL, we dedicate an initial phase to estimate the availabilities of each component, requiring d oracle calls per step. In the main phase, we follow BSFPL and alternate between exploration and exploitation. In exploration rounds, we test for the reachability of a randomly sampled edge and update the reward estimates as in BSFPL. Figure 2 (middle and right) shows the performance of COMBBSFPL and SLEEPINGCATBANDIT for a fixed loss sequence, averaged over 20 samples of the component availabilities. We also plot the performance of a random policy that follows the perturbed leader with all-zero loss estimates. First observe that the initial exploration phase sets back the performance of COMBBSFPL significantly. The second drawback of COMBBSFPL is the explicit separation of exploration and the exploitation rounds. This drawback is far more apparent when the number of components increases, as it is the case for the 10 × 10 grid graph with 180 components. As COMBBSFPL only estimates the loss of one edge per exploration step, sampling each edge as few as 50 times eats up 9, 000 rounds from the available 10, 000. SLEEPINGCATBANDIT does not suffer from this problem as it uses all its observations in constructing the loss estimates. 6 Conclusions & future work In this paper, we studied the problem of online combinatorial optimization with changing decision sets. Our main contribution is a novel loss-estimation technique that enabled us to prove strong regret bounds under various partial-feedback schemes. In particular, our results largely improve on the best known results for the sleeping bandit problem [13], which suffers large losses from both from an initial exploration phase and from explicit exploration rounds in the main phase. These findings are also supported by our experiments. Still, one might ask if it is possible to efficiently achieve a regret of order √ T under semi-bandit feedback. While the EXP4 algorithm of Auer et al. [2] can be used to obtain such regret guarantee, running this algorithm is out of question as its time and space complexity can be double-exponential in d (see also the comments in [15]). Had we had access to the loss estimates (3), we would be able to control the regret of FPL as the term on the right hand side of Equation (6) could be replaced by md, which is sufficient for obtaining a regret bound of O(m√dT log d). In fact, it seems that learning in the bandit setting requires significantly more knowledge about P than the knowledge of the ai’s. The question if we can extend the CAT technique to estimate all the relevant quantities of P is an interesting problem left for future investigation. Acknowledgements The research presented in this paper was supported by French Ministry of Higher Education and Research, by European Community’s Seventh Framework Programme (FP7/2007-2013) under grant agreement no270327 (CompLACS), and by FUI project Herm`es. 8 References [1] Audibert, J. Y., Bubeck, S., and Lugosi, G. (2014). Regret in online combinatorial optimization. Mathematics of Operations Research. to appear. [2] Auer, P., Cesa-Bianchi, N., Freund, Y., and Schapire, R. E. (2002). The nonstochastic multiarmed bandit problem. SIAM J. Comput., 32(1):48–77. [3] Bubeck, S., Cesa-Bianchi, N., and Kakade, S. M. (2012). Towards minimax policies for online linear optimization with bandit feedback. In COLT 2012, pages 1–14. [4] Cesa-Bianchi, N. and Lugosi, G. (2006). Prediction, Learning, and Games. Cambridge University Press, New York, NY, USA. [5] Cesa-Bianchi, N. and Lugosi, G. (2012). Combinatorial bandits. Journal of Computer and System Sciences, 78:1404–1422. [6] Dani, V., Hayes, T. P., and Kakade, S. (2008). The price of bandit information for online optimization. In NIPS-20, pages 345–352. [7] Freund, Y., Schapire, R., Singer, Y., and Warmuth, M. (1997). Using and combining predictors that specialize. In Proceedings of the 29th Annual ACM Symposium on the Theory of Computing, pages 334–343. ACM Press. [8] Gy¨orgy, A., Linder, T., Lugosi, G., and Ottucs´ak, Gy.. (2007). The on-line shortest path problem under partial monitoring. Journal of Machine Learning Research, 8:2369–2403. [9] Hannan, J. (1957). Approximation to bayes risk in repeated play. Contributions to the theory of games, 3:97–139. [10] Hutter, M. and Poland, J. (2004). Prediction with expert advice by following the perturbed leader for general weights. In ALT, pages 279–293. [11] Jannach, D., Zanker, M., Felfernig, A., and Friedrich, G. (2010). Recommender Systems: An Introduction. Cambridge University Press. [12] Kalai, A. and Vempala, S. (2005). Efficient algorithms for online decision problems. Journal of Computer and System Sciences, 71:291–307. [13] Kanade, V., McMahan, H. B., and Bryan, B. (2009). Sleeping experts and bandits with stochastic action availability and adversarial rewards. In AISTATS 2009, pages 272–279. [14] Kanade, V. and Steinke, T. (2012). Learning hurdles for sleeping experts. In Proceedings of the 3rd Innovations in Theoretical Computer Science Conference (ITCS 12), pages 11–18. ACM. [15] Kleinberg, R. D., Niculescu-Mizil, A., and Sharma, Y. (2008). Regret bounds for sleeping experts and bandits. In COLT 2008, pages 425–436. [16] Koshevoy, G. A. (1999). Choice functions and abstract convex geometries. Mathematical Social Sciences, 38(1):35–44. [17] McMahan, H. B. and Blum, A. (2004). Online geometric optimization in the bandit setting against an adaptive adversary. In COLT 2004, pages 109–123. [18] Neu, G. and Bart´ok, G. (2013). An efficient algorithm for learning with semi-bandit feedback. In ALT 2013, pages 234–248. 9
2014
326
5,432
Learning Multiple Tasks in Parallel with a Shared Annotator Haim Cohen Department of Electrical Engeneering The Technion – Israel Institute of Technology Haifa, 32000 Israel hcohen@tx.technion.ac.il Koby Crammer Department of Electrical Engeneering The Technion – Israel Institute of Technology Haifa, 32000 Israel koby@ee.technion.ac.il Abstract We introduce a new multi-task framework, in which K online learners are sharing a single annotator with limited bandwidth. On each round, each of the K learners receives an input, and makes a prediction about the label of that input. Then, a shared (stochastic) mechanism decides which of the K inputs will be annotated. The learner that receives the feedback (label) may update its prediction rule, and then we proceed to the next round. We develop an online algorithm for multitask binary classification that learns in this setting, and bound its performance in the worst-case setting. Additionally, we show that our algorithm can be used to solve two bandits problems: contextual bandits, and dueling bandits with context, both allow to decouple exploration and exploitation. Empirical study with OCR data, vowel prediction (VJ project) and document classification, shows that our algorithm outperforms other algorithms, one of which uses uniform allocation, and essentially achieves more (accuracy) for the same labour of the annotator. 1 Introduction A triumph of machine learning is the ability to predict many human aspects: is certain mail spam or not, is a news-item of interest or not, does a movie meet one’s taste or not, and so on. The dominant paradigm is supervised learning, in which the main bottleneck is the need to annotate data. A common protocol is problem centric: first collect data or inputs automatically (with low cost), and then pass it on to a user or an expert to be annotated. Annotation can be outsourced to the crowed by a service like Mechanical Turk, or performed by experts as in the Linguistic data Consortium. Then, this data may be used to build models, either for a single task or many tasks. This approach is not making optimal use of the main resource - the annotator - as some tasks are harder than others, yet we need to give the annotator the (amount of) data to be annotated for each task a-priori . Another aspect of this problem is the need to adapt systems to individual users, to this end, such systems may query the user for the label of some input, yet, if few systems will do so independently, the user will be flooded with queries, and will avoid interaction with those systems. For example, sometimes there is a need to annotate news items from few agencies. One person cannot handle all of them, and only some items can be annotated, which ones? Our setting is designed to handle exactly this problem, and specifically, how to make best usage of annotation time. We propose a new framework of online multi-task learning with a shared annotator. Here, algorithms are learning few tasks simultaneously, yet they receive feedback using a central mechanism that trades off the amount of feedback (or labels) each task receives. We derive a specific algorithm based on the good-old Perceptron algorithm, called SHAMPO (SHared Annotator for Multiple PrOblems) for binary classification and analyze it in the mistake bound model, showing that our algorithm may perform well compared with methods that observe all annotated data. We then show how to reduce few contextual bandit problems into our framework, and provide specific bounds for such 1 settings. We evaluate our algorithm with four different datasets for OCR , vowel prediction (VJ) and document classification, and show that it can improve performance either on average over all tasks, or even if their output is combined towards a single shared task, such as multi-class prediction. We conclude with discussion of related work, and few of the many routes to extend this work. 2 Problem Setting We study online multi-task learning with a shared annotator. There are K tasks to be learned simultaneously. Learning is performed in rounds. On round t, there are K input-output pairs (xi,t, yi,t) where inputs xi,t ∈Rdi are vectors, and labels are binary yi,t ∈{−1, +1}. In the general case, the input-spaces for each task may be different. We simplify the notation and assume that di = d for all tasks. Since the proposed algorithm uses the margin that is affected by the vector norm, there is a need to scale all the vectors into a ball. Furthermore, no dependency between tasks is assumed. On round t, the learning algorithm receives K inputs xi,t for i = 1, . . . , K, and outputs K binary-labels ˆyi,t, where ˆyi,t ∈ {−1, +1} is the label predicted for the input xi,t of task i. The algorithm then chooses a task Jt ∈ {1, . . . , K} and receives from an annotator the true-label yJt,t for that task Jt. It does not observe any other label. 1x 2x K x 1 1 ( , ) x y 2 2 ( , ) x y ( , ) K K x y 1,..., K w w 1x 2x K x Jx ( , ) J J x y (a) (b) J w Annotator Annotator Alg. Alg. Figure 1: Illustration of a single iteration of multi-task algorithms (a) standard setting (b) SHAMPO Then, the algorithm updates its models, and proceeds to the next round (and inputs). For easing calculations below, we denote by K indicators Zt = (Z1,t, . . . , ZK,t) the identity of the task which was queried on round t, and set ZJt,t = 1 and Zi,t = 0 for i ̸= Jt. Clearly, P i Zi,t = 1. Below, we define the notation Et−1 [x] to be the conditional expectation E [x|Z1, ...Zt−1] given all previous choices. Illustration of a single iteration of multi-task algorithms is shown in Fig. 1. The top panel shows the standard setting with shared annotator, that labels all inputs, which are fed to the corresponding algorithms to update corresponding models. The bottom panel shows the SHAMPO algorithm, which couples labeling annotation and learning process, and synchronizes a single annotation per round. At most one task performs an update per round (the annotated one). We focus on linear-functions of the form f(x) = sign(p) for a quantity p = w⊤x, w ∈Rd, called the margin. Specifically, the algorithm maintains a set of K weight vectors. On round t, the algorithm predicts ˆyi,t = sign(ˆpi,t) where ˆpi,t = w⊤ i,t−1xi,t. On rounds for which the label of some task Jt is queried, the algorithm, is not updating the models of all other tasks, that is, we have wi,t = wi,t−1 for i ̸= Jt. We say that the algorithm has a prediction mistake in task i if yi,t ̸= ˆyi,t, and denote this event by Mi,t = 1, otherwise, if there is no mistake we set Mi,t = 0. The goal of the algorithm is to minimize the cumulative number of mistakes, P t P i Mi,t. Models are also evaluated using the Hinge-loss. Specifically, let ui ∈Rd be some vector associated with task i. We denote the Hinge-loss of it, with respect to some input-output by, ℓγ,i,t(ui) = γ −yi,tu⊤ i xi,t  +, where, (x)+ = max{x, 0}, and γ > 0 is some parameter. The cumulative loss over all tasks and a sequence of n inputs, is, Lγ,n = Lγ({ui}) = Pn t=1 PK i=1 ℓγ,i,t(ui). We also use the following expected hinge-loss over the random choices of the algorithm, ¯Lγ,n = ¯L{ui} = E hPn t PK i=1 Mi,tZi,tℓγ,i,t(ui) i . We proceed by describing our algorithm and specifying how to choose a task to query its label, and how to perform an update. 3 SHAMPO: SHared Annotator for Multiple Problems We turn to describe an algorithm for multi-task learning with a shared annotator setting, that works with linear models. Two steps are yet to be specified: how to pick a task to be labeled and how to perform an update once the true label for that task is given. To select a task, the algorithm uses the absolute margin |ˆpi,t|. Intuitively, if |ˆpi,t| is small, then there is uncertainty about the labeling of xi,t, and vise-versa for large values of |ˆpi,t|. Similar argument 2 was used by Tong and Koller [22] for picking an example to be labeled in batch active learning. Yet, if the model wi,t−1 is not accurate enough, due to small number of observed examples, this estimation may be rough, and may lead to a wrong conclusion. We thus perform an explorationexploitation strategy, and query tasks randomly, with a bias towards tasks with low |ˆpi,t|. To the best of our knowledge, exploration-exploitation usage in this context of choosing an examples to be labeled (eg. in settings such as semi-supervised learning or selective sampling) is novel and new. We introduce b ≥0 to be a tradeoff parameter between exploration and exploitation and ai ≥0 as a prior for query distribution over tasks. Specifically, we induce a distribution over tasks, Pr [Jt = j]= aj b + |ˆpj,t|−minK m=1 |ˆpm,t| −1 Dt for Dt = K X i=1 ai  b + |ˆpi,t|−min m |ˆpm,t| −1 . (1) Parameters: b, λ, ai ∈R+ for i = 1, . . . , K Initialize: wi,0 = 0 for i = 1, . . . , K for t = 1, 2, ..., n do 1. Observe K instance vectors, xi,t, (i = 1, . . . , K). 2. Compute margins ˆpi,t = w⊤ i,t−1xi,t. 3. Predict K labels, ˆyi,t = sign(ˆpi,t). 4. Draw task Jt with the distribution: Pr [Jt = j] = aj b + |ˆpj,t| −minK m=1 |ˆpm,t| −1 Dt , Dt = X i ai  b + |ˆpi,t| − K min m=1 |ˆpm,t| −1 . 5. Query the true label ,yJt,t ∈{−1, 1}. 6. Set indicator MJt,t = 1 iff yJt,tˆpi,t ≤0 (Error) 7. Set indicator AJt,t = 1 iff 0 < yJt,tˆpi,t ≤λ (Small margin) 8. Update with the perceptron rule: wJt,t = wJt,t−1 + (AJt,t + MJt,t) yJt,t xJt,t (2) wi,t = wi,t−1 for i ̸= Jt end for Output: wi,n for i = 1, . . . , K. Figure 2: SHAMPO: SHared Annotator for Multiple PrOblems. Clearly, Pr [Jt = j] ≥ 0 and P j Pr [Jt = j] = 1. For b = 0 we have Pr [Jt = j] = 1 for the task with minimal margin, Jt = arg minK i=1 |ˆpi,t|, and for b →∞ the distribution is proportional to the prior weights, Pr [Jt = j] = aj/(P i ai). As noted above we denote by Zi,t = 1 iff i = Jt. Since the distribution is invariant to a multiplicative factor of ai we assume 1 ≤ai∀i. The update of the algorithm is performed with the aggressive perceptron rule, that is wJt,t = wJt,t−1 + (AJt,t + MJt,t) yJt,t xJt,t and wi,t = wi,t−1 for i ̸= Jt. we define Ai,t , the aggressive update indicator introducing and the aggressive update threshold, λ ∈ R > 0 such that, Ai = 1 iff 0 < yi,tˆpi,t ≤λ, i.e, there is no mistake but the margin is small, and Ai,t = 0 otherwise. An update is performed if either there is a mistake (MJi,t = 0) or the margin is low (AJi,t = 1). Note that these events are mutually exclusive. For simplicity of presentation we write this update as, wi,t = wi,t−1 +Zi,t (Ai,t +Mi,t)yi,t xi,t. Although this notation uses labels for all-tasks, only the label of the task Jt is used in practice, as for other tasks Zi,t = 0. We call this algorithm SHAMPO for SHared Annotator for Multiple PrOblems. The pseudo-code appears in Fig. 2. We conclude this section by noting that the algorithm can be incorporated with Mercer-kernels as all operations depend implicitly on inner-product between inputs. 4 Analysis The following theorem states that the expected cumulative number of mistakes that the algorithm makes, may not be higher than the algorithm that observes the labels of all inputs. Theorem 1 If SHAMPO algorithm runs on K tasks with K parallel example pair sequences (xi,1, yi,1), ...(xi,n, yi,n) ∈Rd × {−1, 1}, i = 1, ..., K with input parameters 0 ≤b, 0 ≤λ ≤b/2, and prior 1 ≤ai∀i, denote by X = maxi,t ∥xi,t∥, then, for all γ > 0, all ui ∈Rd and all n ≥1 3 there exists 0 < δ ≤PK i=1 ai, such that, E " K X i=1 n X t=1 Mi,t # ≤δ γ " 1 + X2 2b  ¯Lγ,n + 2b + X22 U 2 8γb # +  2λ b −1  E " K X i=1 n X t=1 aiAi,t # . where we denote U 2 = PK i=1 ∥ui∥2. The expectation is over the random choices of the algorithm. Due to lack of space, the proof appears in Appendix A.1 in the supplementary material. Few notes on the mistake bound: First, the right term of the bound is equals zero either when λ = 0 (as Ai,t = 0) or λ = b/2. Any value in between, may yield an strict negative value of this term, which in turn, results in a lower bound. Second, the quantity ¯Lγ,n is non-increasing with the number of tasks. The first terms depends on the number of tasks only via δ ≤P i ai. Thus, if ai = 1 (uniform prior) the quantity δ ≤K is bounded by the number of tasks. Yet, when the hardness of the tasks is not equal or balanced, one may expect δ to be closer to 1 than K, which we found empirically to be true. Additionally, the prior ai can be used to make the algorithm focus on the hard tasks, thereby improving the bound. While δ multiplying the first term can be larger, the second term can be lower. A task i which corresponds to a large value of ai will be updated more in early rounds than tasks with low ai. If more of these updates are aggressive, the second term will be negative and far from zero. One can use the bound to tune the algorithm for a good value of b for the non aggressive case (λ = 0), by minimizing the bound over b. This may not be possible directly since ¯Lγ,n depends implicitly on the value of b1. Alternatively, we can take a loose estimate of ¯Lγ,n, and replace it with Lγ,n (which is ∼K times larger). The optimal value of b can now be calculated, b = X2 2 q 1 + 4γLγ,n U 2X2 . Substituting this value in the bound of Eq. (1) with Lγ,n leads to the following bound, E hPK i=1 Pn t=1 Mi,t i ≤δ γ  Lγ,n + U 2X2 2γ + U 2 2γ q 1 + 4γLγ,n U 2X2  , which has the same dependency in the number of inputs n as algorithm that observes all of them. We conclude this section by noting that the algorithm and analysis can be extended to the case that more than single query is allowed per task. Analysis and proof appears in Appendix A.2 in the supplementary material. 5 From Multi-task to Contextual Bandits Although our algorithm is designed for many binary-classification tasks, it can also be applied in two settings of contextual bandits, when decoupling exploration and exploitation is allowed [23, 3]. In this setting, the goal is to predict a label ˆYt ∈{1, . . . , C} given an input xt. As before, the algorithm works in rounds. On round t the algorithm receives an input xt and gives as an output multicalss label ˆYt ∈{1, . . . , C}. Then, it queries for some information about the label via a single binary “yes-no” question, and uses the feedback to update its model. We consider two forms of questions. Note that our algorithm subsumes past methods since they also allow the introduction of a bias (or prior knowledge) towards some tasks, which in turn, may improve performance. 5.1 One-vs-Rest The first setting is termed one-vs-rest. The algorithm asks if the true label is some label ¯Yt ∈ {1, . . . , C}, possibly not the predicted label, i.e. it may be the case that ¯Yt ̸= ˆYt. Given the response whether ¯Yt is the true label Yt, the algorithm updates its models. The reduction we perform is by introducing K tasks, one per class. The problem of the learning algorithm for task i is to decide whether the true label is class i or not. Given the output of all (binary) classifiers, the algorithm generates a single multi-class prediction to be the single label for which the output of the corresponding binary classifier is positive. If such class does not exist, or there are more than one classes as such, a random prediction is used, i.e., given an input xt we define ˆYt = arg maxi ˆyi,t, where ties are broken arbitrarily. The label to be queried is ¯Yt = Jt, i.e. the problem index that SHAMPO is querying. We analyze the performance of this reduction as a multiclass prediction algorithm. 1Similar issue appears also after the discussion of Theorem 1 in a different context [7]. 4 1 2 3 4 0 2 4 6 8 10 Task # Error Exploit Uniform SHAMPO (a) 4 text classification tasks 1 2 3 4 5 6 7 8 0 2 4 6 8 10 12 14 Task # Error Exploit Uniform SHAMPO (b) 8 text classification tasks 10 −5 10 0 10 5 2 4 6 8 10 12 14 16 18 Error [%] b [log] Aggressive − λ=b Aggrssive − λ=b +prior plain (c) Error vs. b Figure 3: Left and middle: Test error of aggressive SHAMPO on (a) four and (b) eight binary text classification tasks. Three algorithms are evaluated: uniform, exploit, and aggressive SHAMPO. (Right) Mean test error over USPS One-vs-One binary problems vs b of aggressive SHAMPO with prior, aggressive with uniform prior, and non-aggressive with uniform prior. Corollary 2 Assume the SHAMPO algorithm is executed as above with K = C one-vs-rest problems, on a sequence (x1, Y1), ...(xn, Yn) ∈Rd × {1, ..., C}, and input parameter b > 0 and prior 1 ≤ai∀i. Then for all γ > 0 and all ui ∈Rd, there exist 0 < δ ≤PC i=1 ai such that the expected number of multi-class errors is bounded as follows E hP t[[Yt ̸= ˆYt]] i ≤ δ γ  1 + X2 2b  ¯Lγ,n + (2b+X2) 2U 2 8γb  + 2 λ b −1  E hPK i=1 Pn t=1 aiAi,t i , where [[I]] = 1 if the predicate I is true, and zero otherwise. The corollary follows directly from Thm. 1 by noting that, [[Yt ̸= ˆYt]] ≤P i Mi,t. That is, there is a multiclass mistake if there is at least one prediction mistake of one of the one-vs-rest problems. The closest setting is contextual bandits, yet we allow decoupling of exploration and exploitation. Ignoring this decoupling, the Banditron algorithm [17] is the closest to ours, with a regret of O(T 2/3). Hazan et al [16] proposed an algorithm with O( √ T) regret but designed for the log loss, with coefficient that may be very large, and another [9] algorithm has O( √ T) regret with respect to prediction mistakes, yet they assumed stochastic labeling, rather than adversarial. 5.2 One-vs-One In the second setting, termed by one-vs-one, the algorithm picks two labels ¯Y + t , ¯Y − t ∈{1 . . . C}, possibly both not the predicted label. The feedback for the learner is three-fold: it is yJt,t = +1 if the first alternative is the correct label, ¯Y + t = Yt, yJt,t = −1 if the second alternative is the correct label, ¯Y − t = Yt, and it is yJt,t = 0 otherwise (in this case there is no error and we set MJt,t = 0). The reduction we perform is by introducing K = C 2  problems, one per pair of classes. The goal of the learning algorithm for a problem indexed with two labels (y1, y2) is to decide which is the correct label, given it is one of the two. Given the output of all (binary) classifiers the algorithm generates a single multi-class prediction using a tournament in a round-robin approach [15]. If there is no clear winner, a random prediction is used. We now analyze the performance of this reduction as a multiclass prediction algorithm. Corollary 3 Assume the SHAMPO algorithm is executed as above, with K = C 2  one-vs-one problems, on a sequence (x1, Y1), ...(xn, Yn) ∈Rd × {1, ..., C}, and input parameter b > 0 and prior 1 ≤ai∀i . Then for all γ > 0 and all ui ∈Rd, there exist 0 < δ ≤P( C 2) i=1 ai such that the expected number of multi-class errors can be bounded as follows E hP t[[Yt ̸= ˆYt]] i ≤ 2 (( C 2)−1)/2+1  δ γ  1 + X2 2b  ¯Lγ,n + (2b+X2) 2U 2 8γb  + 2 λ b −1  E hPK i=1 Pn t=1 aiAi,t i . The corollary follows directly from Thm. 1 by noting that, [[Yt ̸= ˆYt]] ≤ 2 (( C 2)−1)/2+1 P( C 2) i=1 Mi,t. Note, that the bound is essentially independent of C as the coefficient in the bound is upper bounded by 6 for C ≥3. 5 We conclude this section with two algorithmic modifications, we employed in this setting. Currently, when the feedback is zero, there is no update of the weights, because there are no errors. This causes the algorithm to effectively ignore such examples, as in these cases the algorithm is not modifying any model, furthermore, if such example is repeated, a problem with possibly “0” feedback may be queried again. We fix this issue with one of two modifications: In the first one, if the feedback is zero, we modify the model to reduce the chance that the chosen problem, Jt, would be chosen again for the same input (i.e. not to make the same wrongchoice of choosing irrelevant problem again). To this end, we modify the weights a bit, to increase the confidence (absolute margin) of the model for the same input, and replace Eq. (2) with, wJt,t = wJt,t−1 + [[yJt,t ̸= 0]] yJt,t xJt,t + [[yJt,t = 0]]ηˆyJt,txJt,t , for some η > 0. In other words, if there is a possible error (i.e. yJt,t ̸= 0) the update follows the Perceptron’s rule. Otherwise, the weights are updated such that the absolute margin will increase, as |w⊤ Jt,txJt,t| = |(wJt,t−1 + ηˆyJt,txJt,t)⊤xJt,t| = |w⊤ Jt,t−1xJt,t + ηsign(w⊤ Jt,t−1xJt,t)∥xJt,t∥2| = |w⊤ Jt,t−1xJt,t| + η∥xJt,t∥2 > |w⊤ Jt,t−1xJt,t|. We call this method one-vs-one-weak, as it performs weak updates for zero feedback. The second alternative is not to allow 0 value feedback, and if this is the case, to set the label to be either +1 or −1, randomly. We call this method one-vs-one-random. 6 Experiments 10 −6 10 −4 10 −2 10 0 10 2 10 15 20 25 30 35 b [log] Error [%] total queried (a) Training mistakes vs b (b) Test error vs no. of queries Figure 4: Left: mean of fraction no. of mistakes SHAMPO made during training time on MNIST of all examples and only queried. Right: test error vs no. of queries is plotted for all MNIST one-vs-one problems. We evaluated the SHAMPO algorithm using four datasets: USPS, MNIST (both OCR), Vocal Joystick (VJ, vowel recognition) and document classification. The USPS dataset, contains 7, 291 training examples and 2, 007 test examples, each is a 16 × 16 pixels gray-scale images converted to a 256 dimensional vector. The MNIST dataset with 28 × 28 gray-scale images, contains 60, 000 (10, 000) training (test) examples. In both cases there are 10 possible labels, digits. The VJ tasks is to predict a vowel from eight possible vowels. Each example is a frame of spoken value described with 13 MFCC coefficients transformed into 27 features. There are 572, 911 training examples and 236, 680 test examples. We created binary tasks from these multi-class datasets using two reductions: One-vs-Rest setting and One-vs-One setting. For example, in both USPS and MNIST there are 10 binary one-vs-rest tasks and 45 binary one-vs-one tasks. The NLP document classification include of spam filtering, news items and news-group classification, sentiment classification, and product domain categorization. A total of 31 binary prediction tasks over all, with a total of 252, 609 examples, and input dimension varying between 8, 768 and 1, 447, 866. Details of the individual binary tasks can be found elsewhere [8]. We created an eighth collection, named MIXED, which consists of 40 tasks: 10 random tasks from each one of the four basic datasets (one-vs-one versions). This yielded eight collections (USPS, MNIST and VJ; each as one-vs-rest or one-vs-one), document classification and mixed. From each of these eight collections we generated between 6 to 10 combinations (or problems), each problem was created by sampling between 2 and 8 tasks which yielded a total of 64 multi-task problems. We tried to diversify problems difficulty by including both hard and easy binary classification problems. The hardness of a binary problem is evaluated by the number of mistakes the Perceptron algorithm performs on the problem. We evaluated two baselines as well as our algorithm. Algorithm uniform picks a random task to be queried and updated (corresponding to b →∞), exploit which picks the tasks with the lowest absolute margin (i.e. the “hardest instance”), this combination corresponds to b ≈0 of SHAMPO. We tried for SHAMPO 13 values for b, equally spaced on a logarithmic scale. All algorithms made a single pass over the training data. We ran two version of the algorithm: plain version, without aggressiveness (updates on mistakes only, λ = 0) and an Aggressive version λ = b/2 (we tried lower values of λ as in the bound, but we found that λ = b/2 gives best results), both with uniform prior (ai = 1). We used separate training set and a test set, to build a model and evaluate it. 6 Table 1: Test errors percentage . Scores are shown in parenthesis. Aggressive λ = b/2 Plain Dataset exploit SHAMPO uniform exploit SHAMPO uniform VJ 1 vs 1 5.22 (2.9) 4.57 (1.1) 5.67 (3.9) 5.21 (2.7) 6.93 (4.6) 6.26 (5.8) VJ 1 vs Rest 13.26 (3.5) 11.73 (1.2) 12.43 (2.5) 13.11 (3.0) 14.17 (5.0) 14.71 (5.8) USPS 1 vs 1 3.31 (2.5) 2.73 (1.0) 19.29 (6.0) 3.37 (2.5) 4.83 (4.0) 5.33 (5,0) USPS 1 vs Rest 5.45 (2.8) 4.93 (1.2) 10.12 (6.0) 5.31 (2.0) 6.51 (4.0) 7.06 (5.0) MNIST 1 vs 1 1.08 (2.3) 0.75 (1.0) 5.9 (6.0) 1.2 (2.7) 1.69 (4.1) 1.94 (4.9) MNIST 1 vs Rest 4.74 (2.8) 3.88 (1.0) 10.01 (6.0) 4.44 (2.8) 5.4 (3.8) 6.1 (5.0) NLP documents 19.43 (2.3) 16.5 (1.0) 23.21 (5.0) 19.46 (2.7) 21.54 (4.7) 21.74 (5.3) MIXED 2.75 (2.4) 2.06 (1.0) 13.59 (6.0) 2.78 (2.6) 4.2 (4.3) 4.45 (4.7) Mean score (2.7) (1.1) (5.2) (2.6) (4.3) (5.2) Results are evaluated using 2 quantities. First, the average test error (over all the dataset combinations) and the average score. For each combination we assigned a score of 1 to the algorithm with the lowest test error, and a score of 2, to the second best, and all the way up to a score of 6 to the algorithm with the highest test error. Multi-task Binary Classification : Fig. 3(a) and Fig. 3(b) show the test error of the three algorithms on two of document classification combinations, with four and eight tasks. Clearly, not only SHAMPO performs better, but it does so on each task individually. (Our analysis above bounds the total number of mistakes over all tasks.) Fig. 3(c) shows the average test error vs b using the one-vs-one binary USPS problems for the three variants of SHAMPO: non-aggressive (called plain), aggressive and aggressive with prior.Clearly, the plain version does worse than both the aggressive version and the non-uniform prior version. For other combinations the prior was not always improving results. We hypothesise that this is because our heuristic may yield a bad prior which is not focusing the algorithm on the right (hard) tasks. Results are summarized in Table 1. In general exploit is better than uniform and aggressive is better than non-aggressive. Aggressive SHAMPO yields the best results both evaluated as average (over tasks per combination and over combinations). Remarkably, even in the mixed dataset (where tasks are of different nature: images, audio and documents), the aggressive SHAPO improves over uniform (4.45% error) and the aggressive-exploit baseline (2.75%), and achieves a test error of 2.06%. Next, we focus on the problems that the algorithm chooses to annotate on each iteration for various values of b. Fig. 4(a) shows the total number of mistakes SHAMPO made during training time on MNIST , we show two quantities: fraction of mistakes over all training examples (denoted by “total” - blue) and fraction of mistakes over only queried examples (denoted by “queried” - dashed red). In pure exploration (large b) both quantities are the same, as the choice of problem to be labeled is independent of the problem and example, and essentially the fraction of mistakes in queried examples is a good estimate of the fraction of mistakes over all examples. The other extreme is when performing pure exploitation (low b), here the fraction of mistakes made on queried examples went up, while the overall fraction of mistakes went down. This indicates that the algorithm indeed focuses its queries on the harder inputs, which in turn, improves overall training mistake. There is a sweet point b ≈0.01 for which SHAMPO is still focusing on the harder examples, yet reduces the total fraction of training mistakes even more. The existence of such tradeoff is predicted by Thm. 1. Another perspective of the phenomena is that for values of b ≪∞SHAMPO focuses on the harder examples, is illustrated in Fig. 4(b) where test error vs number of queries is plotted for each problem for MNIST. We show three cases: uniform, exploit and a mid-value of b ≈0.01 which tradeoffs exploration and exploitation. Few comments: First, when performing uniform querying, all problems have about the same number of queries (266), close to the number of examples per problem (12, 000), divided by the number of problems (45). Second, when having a tradeoff between exploration and exploitation, harder problems (as indicated by test error) get more queries than easier problems. For example, the four problems with test error greater than 6% get at least 400 queries, which is about twice the number of queries received by each of the 12 problems with test error less than 1%. Third, as a consequence, SHAMPO performs equalization, giving the harder problems more labeled data, and as a consequence, reduces the error of these problems, however, is not increasing the error of the easier problems which gets less queries (in fact it reduces the test error of all 45 problems!). The tradeoff mechanism of SHAMPO, reduces the test error of each problem 7 by more than 40% compared to full exploration. Fourth, exploits performs similar equalization, yet in some hard tasks it performs worse than SHAMPO. This could be because it overfits the training data, by focusing on hard-examples too much, as SHAMPO has a randomness mechanism. Indeed, Table 1 shows that aggressive SHAMPO outperforms better alternatives. Yet, we claim that a good prior may improve results. We compute prior over the 45 USPS tasks, by running the perceptron algorithm on 1000 examples and computing the number of mistakes. We set the prior to be proportional to this number. We then reran aggressive SHAMPO with prior, comparing it to aggressive SHAMPO with no prior (i.e. ai = 1). Aggressive SHAMO with prior achieves average error of 1.47 (vs. 2.73 with no prior) on 1-vs-1 USPS and 4.97 (vs 4.93) on one-vs-rest USPS, with score rank of 1.0 (vs 2.9) and 1.7 (vs 2.0) respectively. Fig. 3(c) shows the test error for a all values of b we evaluated. A good prior is shown to outperform the case ai = 1 for all values of b. Reduction of Multi-task to Contextual Bandits Next, we evaluated SHAMPO as a contextual bandit algorithm, by breaking a multi-class problem into few binary tasks, and integrating their output into a single multi-class problem. We focus on the VJ data, as there are many examples, and linear models perform relatively well [18]. We implemented all three reductions mentioned in Sec. 5.2, namely, one-vs-rest, one-vs-one-random which picks a random label if the feedback is zero, one-vs-one-weak (which performs updates to increase confidence when the feedback is zero), where we set η = 0.2, and the Banditron algorithm [17]. The one-vs-rest reduction and the Banditron have a test error of about 43.5%, and the one-vs-one-random of about 42.5%. Finally, one-vs-oneweak achieves an error of 39.4%. This is slightly worst than PLM [18] with test error of 38.4% (and higher than MLP with 32.8%), yet all of these algorithms observe only one bit of feedback per example, while both MLP and PLM observe 3 bits (as class identity can be coded with 3 bits for 8 classes). We claim that our setting can be easily used to adapt a system to individual user, as we only need to assume the ability to recognise three words, such as three letters. Given an utterance of the user, the system may ask: “Did you say (a) ’a’ like ’bad’ (b) ’o’ like in ’book’) (c) none”. The user can communicate the correct answer with no need for a another person to key in the answer. 7 Related Work and Conclusion In the past few years there is a large volume of work on multi-task learning, which clearly we can not cover here. The reader is referred to a recent survey on the topic [20]. Most of this work is focused on exploring relations between tasks, that is, find similarities dissimilarities between tasks, and use it to share data directly (e.g. [10]) or model parameters [14, 11, 2]. In the online settings there are only a handful of work on multi-task learning. Dekel et al [13] consider the setting where all algorithms are evaluated using a global loss function, and all work towards the shared goal of minimizing it. Logosi et al [19] assume that there are constraints on the predictions of all learners, and focus in the expert setting. Agarwal et al [1] formalize the problem in the framework of stochastic convex programming with few matrix regularization, each captures some assumption about the relation between the models. Cavallanti et al [4] and Cesa-Bianci et al [6] assume a known relation between tasks which is exploited during learning. Unlike these approaches, we assume the ability to share an annotator rather than data or parameters, thus our methods can be applied to problems that do not share a common input space. Our analysis is similar to that of Cesa-Bianchi et al [7], yet they focus in selective sampling (see also [5, 12]), that is, making individual binary decisions of whether to query, while our algorithm always query, and needs to decide for which task. Finally, there have been recent work in contextual bandits [17, 16, 9], each with slightly different assumptions. To the best of our knowledge, we are the first to consider decoupled exploration and exploitation in this context. Finally, there is recent work in learning with relative or preference feedback in various settings [24, 25, 26, 21]. Unlike this work, our work allows again decoupled exploitation and exploration, and also non-relevant feedback. To conclude, we proposed a new framework for online multi-task learning, where learners share a single annotator. We presented an algorithm (SHAMPO) that works in this settings and analyzed it in the mistake-bound model. We also showed how learning in such a model can be used to learn in contextual-bandits setting with few types of feedback. Empirical results show that our algorithm does better for the same price. It focuses the annotator on the harder instances, and is improving performance in various tasks and settings. We plan to integrate other algorithms to our framework, extend it to other settings, investigate ways to generate good priors, and reduce multi-class to binary also via error-correcting output-codes. 8 References [1] Alekh Agarwal, Alexander Rakhlin, and Peter Bartlett. Matrix regularization techniques for online multitask learning. Technical Report UCB/EECS-2008-138, EECS Department, University of California, Berkeley, Oct 2008. [2] Andreas Argyriou, Theodoros Evgeniou, and Massimiliano Pontil. Convex multi-task feature learning. Machine Learning, 73(3):243–272, 2008. [3] Orly Avner, Shie Mannor, and Ohad Shamir. Decoupling exploration and exploitation in multi-armed bandits. In ICML, 2012. [4] Giovanni Cavallanti, Nicol`o Cesa-Bianchi, and Claudio Gentile. Linear algorithms for online multitask classification. Journal of Machine Learning Research, 11:2901–2934, 2010. [5] Nicolo Cesa-Bianchi, Claudio Gentile, and Francesco Orabona. Robust bounds for classification via selective sampling. In ICML 26, 2009. [6] Nicol`o Cesa-Bianchi, Claudio Gentile, and Luca Zaniboni. Incremental algorithms for hierarchical classification. The Journal of Machine Learning Research, 7:31–54, 2006. [7] Nicol`o Cesa-Bianchi, Claudio Gentile, and Luca Zaniboni. Worst-case analysis of selective sampling for linear classification. The Journal of Machine Learning Research, 7:1205–1230, 2006. [8] Koby Crammer, Mark Dredze, and Fernando Pereira. Confidence-weighted linear classification for text categorization. J. Mach. Learn. Res., 98888:1891–1926, June 2012. [9] Koby Crammer and Claudio Gentile. Multiclass classification with bandit feedback using adaptive regularization. Machine Learning, 90(3):347–383, 2013. [10] Koby Crammer and Yishay Mansour. Learning multiple tasks using shared hypotheses. In Advances in Neural Information Processing Systems 25. 2012. [11] Hal Daum´e, III, Abhishek Kumar, and Avishek Saha. Frustratingly easy semi-supervised domain adaptation. In DANLP 2010, 2010. [12] Ofer Dekel, Claudio Gentile, and Karthik Sridharan. Robust selective sampling from single and multiple teachers. In COLT, pages 346–358, 2010. [13] Ofer Dekel, Philip M. Long, and Yoram Singer. Online multitask learning. In COLT, pages 453–467, 2006. [14] Theodoros Evgeniou and Massimiliano Pontil. Regularized multi–task learning. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, KDD ’04, pages 109–117, New York, NY, USA, 2004. ACM. [15] Johannes F¨urnkranz. Round robin classification. Journal of Machine Learning Research, 2:721–747, 2002. [16] Elad Hazan and Satyen Kale. Newtron: an efficient bandit algorithm for online multiclass prediction. Advances in Neural Information Processing Systems (NIPS), 2011. [17] Sham M Kakade, Shai Shalev-Shwartz, and Ambuj Tewari. Efficient bandit algorithms for online multiclass prediction. In Proceedings of the 25th international conference on Machine learning, pages 440– 447. ACM, 2008. [18] Hui Lin, Jeff Bilmes, and Koby Crammer. How to lose confidence: Probabilistic linear machines for multiclass classification. In Tenth Annual Conference of the International Speech Communication Association, 2009. [19] G´abor Lugosi, Omiros Papaspiliopoulos, and Gilles Stoltz. Online multi-task learning with hard constraints. In COLT, 2009. [20] Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering, 22(10):1345–1359, 2010. [21] Pannagadatta K. Shivaswamy and Thorsten Joachims. Online learning with preference feedback. CoRR, abs/1111.0712, 2011. [22] Simon Tong and Daphne Koller. Support vector machine active learning with application sto text classification. In ICML, pages 999–1006, 2000. [23] Jia Yuan Yu and Shie Mannor. Piecewise-stationary bandit problems with side observations. In ICML, 2009. [24] Yisong Yue, Josef Broder, Robert Kleinberg, and Thorsten Joachims. The k-armed dueling bandits problem. In COLT, 2009. [25] Yisong Yue, Josef Broder, Robert Kleinberg, and Thorsten Joachims. The k-armed dueling bandits problem. J. Comput. Syst. Sci., 78(5):1538–1556, 2012. [26] Yisong Yue and Thorsten Joachims. Beat the mean bandit. In ICML, pages 241–248, 2011. 9
2014
327
5,433
A Complete Variational Tracker Ryan Turner Northrop Grumman Corp. ryan.turner@ngc.com Steven Bottone Northrop Grumman Corp. steven.bottone@ngc.com Bhargav Avasarala Northrop Grumman Corp. bhargav.avasarala@ngc.com Abstract We introduce a novel probabilistic tracking algorithm that incorporates combinatorial data association constraints and model-based track management using variational Bayes. We use a Bethe entropy approximation to incorporate data association constraints that are often ignored in previous probabilistic tracking algorithms. Noteworthy aspects of our method include a model-based mechanism to replace heuristic logic typically used to initiate and destroy tracks, and an assignment posterior with linear computation cost in window length as opposed to the exponential scaling of previous MAP-based approaches. We demonstrate the applicability of our method on radar tracking and computer vision problems. The field of tracking is broad and possesses many applications, particularly in radar/sonar [1], robotics [14], and computer vision [3]. Consider the following problem: A radar is tracking a flying object, referred to as a target, using measurements of range, bearing, and elevation; it may also have Doppler measurements of radial velocity. We would like to construct a track which estimates the trajectory of the object over time. The Kalman filter [16], or a more general state space model, is used to filter out measurement errors. The key difference between tracking and filtering is the presence of clutter (noise measurements) and missed detections of true objects. We must determine which measurement to “plug in” to the filter before applying it; this is known as data association. Additionally complicating the situation is that we may be in a multi-target tracking scenario in which there are multiple objects to track and we do not know which measurement originated from which object. There is a large body of work on tracking algorithms given its standing as a long-posed and important problem. Algorithms vary primarily on their approach to data association. The dominant approach uses a sliding window MAP estimate of the measurement-to-track assignment, in particular the multiple hypothesis tracker (MHT) [1]. In the standard MHT, at every frame the algorithm finds the most likely matching of measurements to tracks, in the form of an assignment matrix, under a one-to-one constraint (see Figure 1). One track can only result in one measurement, and vice versa, which we refer to as framing constraints. As is typical in MAP estimation, once an assignment is determined, the filters are updated and the tracker proceeds as if these assignments were known to be correct. The one-to-one constraint makes MAP estimation a bipartite matching task where algorithms exist to solve it exactly in polynomial time in the number of tracks NT [15]. However, the multi-frame MHT finds the joint MAP assignment over multiple frames, in which case the assignment problem is known to be NP-hard, although good approximate solvers exist [20]. Track Swap clutter (birds) track 1 (747) track 2 (777) track 3 (Cesna) Z1 Z2 Z3 Zk X1 X2 X3 Xk A1 A2 A3 … Ak S1 S2 S3 … Sk Meta-states Assignment Matrices (all) Track States Measurements Figure 1: Simple scenario with a track swap: filtered state estimates ∗, associated measurements +, and clutter ·; and corresponding graphical model. Note that Xk is a matrix since it contains state vectors for all three tracks. 1 Despite the complexity of the MHT, it only finds a sliding window MAP estimate of measurementto-track assignments. If a clutter measurement is by chance associated with a track for the duration of a window then the tracker will assume with certainty that the measurement originated from that track, and never reconsider despite all future evidence to the contrary. If multiple clutter (or otherwise incorrect) measurements are associated with a track, then it may veer “off into space” and result in spurious tracks. Likewise, an endemic problem in tracking is the issue of track swaps, where two trajectories can cross and get mixed up as shown in Figure 1. Alternatives to the MAP approach include the probabilistic MHT (PMHT) [9, Ch. 4] and probabilistic data association (PDA). However, the PMHT drops the one-to-one constraint in data association and the PDA only allows for a single target. This led to the development of the joint PDA (JPDA) algorithm for multiple targets, which utilizes heuristic calculations of the assignment weights and does not scale to multiple frame assignment. Particle filter implementations of the JPDA have tried to alleviate these issues, but they have not been adopted into real-time systems due to their inefficiency and lack of robustness. The probability hypothesis density (PHD) filter [19] addresses many of these issues, but only estimates the intensity of objects and does not model full trajectories; this is undesirable since the identity of an object is required for many applications including the examples in this paper. L´azaro-Gredilla et al. [18] made the first attempt at a variational Bayes (VB) tracker. In their approach every trajectory follows a Gaussian process (GP); measurements are thus modeled by a mixture of GPs. We develop additional VB machinery to retain the framing constraints, which are dropped in L´azaro-Gredilla et al. [18] despite being viewed as important in many systems. Secondly, our algorithm utilizes a state space approach (e.g. Kalman filters) to model tracks, providing linear rather than cubic time complexity in track length. Hartikainen and S¨arkk¨a [11] showed by an equivalence that there is little loss of modeling flexibility by taking a state space approach over GPs. Most novel tracking algorithms neglect the critical issue of track management. Many tracking algorithms unrealistically assume that the number of tracks NT is known a priori and fixed. Additional “wrapper logic” is placed around the trackers to initiate and destroy tracks. This logic involves many heuristics such as M-of-N logic [1, Ch. 3]. Our method replaces these heuristics in a model-based manner to make significant performance gains. We call our method a complete variational tracker as it simultaneously does inference for track management, data association, and state estimation. The outline of the paper is as follows: We first describe the full joint probability distribution of the tracking problem in Section 1. This includes how to solve the track management problem by augmenting tracks with an active/dormant state to address the issue of an unknown number of tracks. By studying the full joint we develop a new conjugate prior on assignment matrices in Section 2. Using this new formulation we develop a variational algorithm for estimating the measurement-totrack assignments and track states in Section 3. To retain the framing constraints and efficiently scale in tracks and measurements, we modify the variational lower bound in Section 4 using a Bethe entropy approximation. This results in a loopy belief propagation (BP) algorithm being used as a subroutine in our method. In Sections 5–6 we show the improvements our method makes on a difficult radar tracking example and a real data computer vision problem in sports. Our paper presents the following novel contributions: First, we develop the first efficient deterministic approximate inference algorithm for solving the full tracking problem, which includes the framing constraints and track management. The most important observation is that the VB assignment posterior has an induced factorization over time with regard to assignment matrices. Therefore, the computational cost of our variational approach is linear in window length as opposed to the exponential cost of the MAP approach. The most astounding aspect is that by introducing a weaker approximation (VB factorization vs MAP) we lower the computational cost from exponential to linear; this is a truly rare and noteworthy example. Second, in the process, we develop new approximate inference methods on assignment matrices and a new conjugate assignment prior (CAP). We believe these methods have much larger applicability beyond our current tracking algorithm. Third, we develop a process to handle the track management problem in a model-based way. 1 Model Setup for the Tracking Problem In this section we describe the full model used in the tracking problem and develop an unambiguous notation. At each time step k ∈N1, known as a frame, we observe NZ(k) ∈N0 measurements, in a matrix Zk = {zj,k}NZ(k) j=1 , from both real targets and clutter (spurious measurements). In the 2 radar example zj,k ∈Z is a vector of position measurements in R3. In data association we estimate the assignment matrices A, where Aij = 1 if and only if track i is associated with measurement j. Recall that each track is associated with at most one measurement, and vice versa, implying: NT X i=0 Aij = 1 , j ∈1:NZ , NZ X j=0 Aij = 1 , i ∈1:NT , A00 = 0 . (1) The zero indices of A ∈{0, 1}NT +1×NZ+1 are the “dummy row” and “dummy column” to represent the assignment of a measurement to clutter and the assignment of a track to a missed detection. Distribution on Assignments Although not explicitly stated in the literature, a careful examination of the cost functions used in the MAP optimization in MHT yields a particular and intuitive prior on the assignment matrices. The number of tracks NT is assumed known a priori and NZ is random. The corresponding generative process on assignment matrices is as follows: 1) Start with a one-to-one mapping from measurements to tracks: A ←INT ×NT . 2) Each track is observed with probability PD ∈[0, 1]NT . Only keep the columns of detected tracks: A ←A(·, d), di ∼Bernoulli(PD(i)). 3) Sample a Poisson number of clutter measurements (columns): A ←[A , 0NT ×Nc], Nc ∼Poisson(λ). 4) Use a random permutation vector π to make the measurement order arbitrary: A ←A(·, π). 5) Append a dummy row and column on A to satisfy the summation constraints (1). This process gives the following normalized prior on assignments: P(A|PD) = λNc exp(−λ)/NZ! NT Y i=1 PD(i)di(1 −PD(i))1−di . (2) Note that the detections d, NZ, and clutter measurement count Nc are deterministic functions of A. Track Model We utilize a state space formulation over K time steps. The latent states x1:K ∈X K follow a Markov process, while the measurements z1:K ∈ZK are iid conditional on the track state: p(z1:K, x1:K) = p(x1) K Y k=2 p(xk|xk−1) K Y k=1 p(zk|xk) , (3) where we have dropped the track and measurements indices i and j. Although more general models are possible, within this paper each track independently follows a linear system (i.e. Kalman filter): p(xk|xk−1) = N(xk|Fxk−1, Q) , p(zk|xk) = N(zk|Hxk, R) . (4) Track Meta-states We address the track management problem by augmenting track states with a two-state Markov model with an active/dormant meta-state sk in a 1-of-N encoding: P(s1:K) = P(s1) K Y k=2 P(sk|sk−1) , sk ∈{0, 1}NS . (5) This effectively allows us to handle an unknown number of tracks by making NT arbitrarily large; PD is now a function of s with a very small PD in the dormant state and a larger PD in the active state. Extensions with a larger number of states NS are easily implementable. We refer to the collection of track meta-states over all tracks at frame k as Sk := {si,k}NT i=1; likewise, Xk := {xi,k}NT i=1. Full Model We combine the assignment process and track models to get the full model joint: p(Z1:K, X1:K, A1:K, S1:K) = K Y k=1 p(Zk|Xk, Ak)p(Xk|Xk−1)P(Sk|Sk−1)P(Ak|Sk) (6) = K Y k=1 P(Ak|Sk) · NT Y i=1 p(xi,k|xi,k−1)P(si,k|si,k−1)· NZ(k) Y j=1 p0(zj,k)Ak 0j NT Y i=1 p(zj,k|xi,k, Ak ij = 1)Ak ij , where p0 is the clutter distribution, which is often a uniform distribution. The traditional goal in tracking is to compute p(Xk|Z1:k), the exact computation of which is intractable due to the “combinatorial explosion” in summing out the assignments A1:k. The MHT MAP-based approach tackles this with P(Ak1:k2|Z1:k) ≈I{Ak1:k2 = ˆAk1:k2} for a sliding window w = k2 −k1 + 1. Clearly an approximation is needed, but we show how to do much better than the MAP approach of the MHT. This motivates the next section where we derive a conjugate prior on the assignments A1:k, which is useful for improving upon MAP; and we cast (2) as a special case of this distribution. 3 2 The Conjugate Assignment Prior Given that we must compute the posterior P(A|Z),1 it is natural to ask what conjugate priors on A are possible. Deriving approximate inference procedures is often greatly simplified if the prior on the parameters is conjugate to the complete data likelihood: p(Z, X|A) [2]. We follow the standard procedure for deriving the conjugate prior for an exponential family (EF) complete likelihood: p(Z, X|A) = NZ Y j=1 p0(zj)A0j NT Y i=1 p(zj|xi, Aij = 1)Aij NT Y i=1 p(xi) = NT Y i=1 p(xi) exp(1⊤(A ⊙L)1) , Lij := log p(zj|xi, Aij = 1) , Li0 := 0 , L0j := log p0(zj) , (7) where we have introduced the matrix L ∈RNT +1×NZ+1 to represent log likelihood contributions from various assignments. Therefore, we have the following EF quantities [4, Ch. 2.4]: base measure h(Z, X) = QNT i=1 p(xi), partition function g(A) = 1, natural parameters η(A) = vec A, and sufficient statistics T(Z, X) = vec L. This implies the conjugate assignments prior (CAP) for P(A|χ): CAP(A|χ) := Z(χ)−1I{A ∈A} exp(1⊤(χ ⊙A)1) , Z(χ) := X A∈A exp(1⊤(χ ⊙A)1) , (8) where A is the set of all assignment matrices that obey the one-to-one constraints (1). Note that χ is a function of the track meta-states S. We recover the assignment prior of (2) in the form of the CAP distribution (8) via the following parameter settings, with σ(·) denoting the logistic, χij = log  PD(i) (1 −PD(i))λ  = σ−1(PD(i)) −log λ , i ∈1:NT , j ∈1:NZ , χ0j = χi0 = 0 . (9) Due to the symmetries in the prior of (9) we can analytically normalize (8) in this special case: Z(χ)−1 = P(A1:NT ,1:NZ = 0) = Poisson(NZ|λ) NT Y i=1 (1 −PD(i)) . (10) Given that the dummy row and columns of χ are zero in (9), equation (10) is clearly the only way to get (8) to match (2) for the 0 assignment case. Although the conjugate prior (8) allows us to “compute” the posterior, χposterior = χprior + L, computing E[A] or Z(χ) remains difficult in general. This will cause problems in Section 3, but be ameliorated in Section 4 by a slight modification of the variational objective. One insight into the partition function Z(χ) is that if we slightly change the constraints in A so that all the rows and columns must sum to one, i.e. we do not use a dummy row or column and A becomes the set of permutation matrices, then Z(χ) is equal to the matrix permanent of exp(χ), which is #P-complete to compute [24]. Although the matrix permanent is #P-complete, accurate and computationally efficient approximations exist, some based on belief propagation [25; 17]. 3 Variational Formulation As explained in Section 1, exact inference on the full model in (6) is intractable, and as promised we show how to perform better inference than the existing solution of sliding window MAP. Our variational tracker enforces the factorization constraint that the posterior factorizes across assignment matrices and latent track states: p(A1:K, X1:K, S1:K|Z1:K) ≈q(A1:K, X1:K, S1:K) = q(A1:K)q(X1:K, S1:K) . (11) In some sense we can think of A as the “parameters” with X and S as the “latent variables” and use the common variational practice of factorizing these two groups of variables. This gives the variational lower bound L(q): L(q) = Eq[log p(Z1:K, X1:K, A1:K, S1:K)] + H[q(X1:K, S1:K)] + H[q(A1:K)] , (12) 1In this section we drop the frame index k and implicitly condition on meta-states Sk for brevity. 4 where H[·] denotes the Shannon entropy. From inspecting the VB lower bound (12) and (6) we arrive at the following induced factorizations without forcing further factorization upon (11): q(A1:K) = K Y k=1 q(Ak) , q(X1:K, S1:K) = NT Y i=1 q(xi,·)q(si,·) . (13) In other words, the approximate posterior on assignment matrices factorizes across time; and the approximate posterior on latent states factorizes across tracks. State Posterior Update Based on the induced factorizations in (13) we derive the updates for the track states xi,· and meta-states si,· separately. Additionally, we derive the updates for each track separately. We begin with the variational updates for q(xi,·) using the standard VB update rules [4, Ch. 10] and (6), denoting equality to an additive constant with c=, log q(xi,·) c= log p(xi,·) + K X k=1 NZ(k) X j=1 E[Ak ij] log N(zj,k|Hxi,k, R) (14) =⇒q(xi,·) ∝p(xi,·) K Y k=1 NZ(k) Y j=1 N(zj,k|Hxi,k, R/E[Ak ij]) . (15) Using the standard product of Gaussians formula [6] this is proportional to q(xi,·) ∝p(xi,·) K Y k=1 N(˜zi,k|Hxi,k, R/E[di,k]) , ˜zi,k := 1 E[di,k] NZ X j=1 E[Ak ij]zj,k , (16) and recall that E[di,k] = 1 −E[Ak i0] = PNZ j=1 E[Ak ij]. The form of the posterior q(xi,·) is equivalent to a linear dynamical system with pseudo-measurements ˜zi,k and non-stationary measurement covariance R/E[di,k]. Therefore, q(xi,·) is simply implemented using a Kalman smoother [22]. Meta-state Posterior Update We next consider the posterior on the track meta-states: log q(si,·) c= log P(si,·) + K X k=1 Eq(Ak)[log P(Ak|Sk)] c= log P(si,·) + K X k=1 s⊤ i,kℓi,k , (17) ℓi,k(s) := E[di,k] log(PD(s)) + (1 −E[di,k]) log(1 −PD(s)) , s ∈1:NS (18) =⇒q(si,·) ∝P(si,·) K Y k=1 exp(s⊤ i,kℓi,k) , (19) where (18) follows from (2). If P(si,·) follows a Markov chain then the form for q(si,·) is the same as a hidden Markov model (HMM) with emission log likelihoods ℓi,k ∈[R−]NS. Therefore, the meta-state posterior q(si,·) update is implemented using the forward-backward algorithm [21]. Like the MHT, our algorithm also works in an online fashion using a (much larger) sliding window. Assignment Matrix Update The reader can verify using (7)–(9) that the exact updates under the lower bound L(q) (12) yields a product of CAP distributions: q(A1:K) = K Y k=1 CAP(Ak|Eq(Xk)[Lk] + Eq(Sk)[χk]) . (20) This poses a challenging problem, as the state posterior updates of (16) and (19) require Eq(Ak)[Ak]; since q(Ak) is a CAP distribution we know from Section 2 its expectation is difficult to compute. 4 The Assignment Matrix Update Equations In this section we modify the variational lower bound (12) to obtain a tractable algorithm. The resulting algorithm uses loopy belief propagation to compute Eq(Ak)[Ak] for use in (16) and (19). 5 We first note that the CAP distribution (8) is naturally represented as a factor graph: CAP(A|χ) ∝ NT Y i=1 f R i (Ai·) NZ Y j=1 f C j (A·j) NT Y i=0 NZ Y j=0 f S ij(Aij) , (21) with f R i (v) := I{PNZ j=0 vj = 1} (R for row factors), f C j (v) := I{PNT i=0 vi = 1} (C for column factors), and f S ij(v) := exp(χijv). We use reparametrization methods (see [10]) to convert (21) to a pairwise factor graph, where derivation of the Bethe free energy is easier. The Bethe entropy is: Hβ[q(A)] := NT X i=1 NZ X j=0 H[q(ri, Aij)] + NZ X j=1 NT X i=0 H[q(cj, Aij)] − NT X i=1 NZH[q(ri)] − NZ X j=1 NT H[q(cj)] − NT X i=1 NZ X j=1 H[q(Aij)] (22) = NT X i=1 H[q(Ai·)] + NZ X j=1 H[q(A·j)] − NT X i=1 NZ X j=1 H[q(Aij)] , (23) where the pairwise conversion used constrained auxiliary variables ri := Ai· and cj := A·j; and used the implied relations H[q(ri, Aij)] = H[q(ri)] + H[q(Aij|ri)] = H[q(ri)] = H[q(Ai·)]. We define an altered variational lower bound Lβ(q), which merely replaces the entropy H[q(Ak)] with Hβ[q(Ak)].2 Note that Lβ(q) c= L(q) with respect to q(X1:K, S1:K), which implies the state posterior updates under the old bound L(q) in (16) and (19) remain unchanged with the new bound Lβ(q). To get the new update equations for q(Ak) we examine Lβ(q) in terms of q(A1:K): Lβ(q) c= Eq[log p(Z1:K|X1:K, A1:K)] + Eq[log P(A1:K|S1:K)] + K X k=1 Hβ[q(Ak)] (24) c= K X k=1 Eq(Ak)[1⊤(Ak ⊙(Eq(Xk)[Lk] + Eq(Sk)[χk]))1] + K X k=1 Hβ[q(Ak)] (25) c= K X k=1 Eq(Ak)[log CAP(Ak|Eq(Xk)[Lk] + Eq(Sk)[χk])] + Hβ[q(Ak)] . (26) This corresponds to the Bethe free energy of the factor graph described in (21), with E[Lk] + E[χk] as the CAP parameter [26; 12]. Therefore, we can compute E[Ak] using loopy belief propagation. Loopy BP Derivation We define the key (row/column) quantities for the belief propagation: µR ij := msgf R i →Aij , µC ij := msgf C j →Aij , νR ij := msgAij→f R i , νC ij := msgAij→f C j , where all messages form functions in {0, 1} →R+. Using the standard rules of BP we derive: νR ij(x) = µC ij(x)f S ij(x) , µR ij(1) = Y k̸=j νR ik(0) , µR ij(0) = X l̸=j νR il (1) Y k̸=j,l νR ik(0) , (27) where we have exploited that there is only one nonzero value in the row Ai,·. Notice that µR ij(1) = NZ Y k=0 νR ik(0)  νR ij(0) =⇒˜µR ij := µR ij(0) µR ij(1) = NZ X l=0 νR il (1) νR il (0) −νR ij(1) νR ij(0) ∈R+ , (28) where we have pulled µR ij(1) out of (27). We write the ratio of messages to row factors νR as ˜νR ij := νR ij(1)/νR ij(0) = (µC ij(1)/µC ij(0)) exp(χij) ∈R+ . (29) We symmetrically apply (27)–(29) to the column (i.e. C) messages ˜µC ij and ˜νC ij. As is common in binary graphs, we summarize the entire message passing update scheme in terms of message ratios: ˜µR ij = NZ X l=0 ˜νR il −˜νR ij , ˜νR ij = exp(χij) ˜µC ij , ˜µC ij = NT X l=0 ˜νC lj −˜νC ij , ˜νC ij = exp(χij) ˜µR ij . (30) Finally, we compute the marginal distributions E[Aij] by normalizing the product of the incoming messages to each variable: E[Aij] = P(Aij = 1) = σ(χij −log ˜µR ij −log ˜µC ij). 2In most models Hβ[·] ≈H[·], but without proof we always observe Hβ[·] ≤H[·]; so Lβ is a lower bound. 6 track 1 track 2 track 3 (a) Radar Example PA S C 0 20 40 60 80 100 Performance (%) (b) SIAP Metrics ARI NC−ARI 0−1 0 0.2 0.4 0.6 0.8 1 Performance (c) Assignment Accuracy Figure 2: Left: The output of the trackers on the radar example. We show the true trajectories (red ·), 2D MHT (solid magenta), 3D MHT (solid green), and OMGP (cyan ∗). The state estimates for the VB tracker when active (black ◦) and dormant (black ×) are shown, where a ≥90% threshold on the meta-state s is used to deem a track active for plotting. Center: SIAP metrics for N = 100 realizations of the scenario on the left with 95% error bars. We show positional accuracy (i.e. RMSE) (PA, lower better), spurious tracks (S, lower better), and track completeness (C, higher better). The bars are in order: VB tracker (blue), 3D MHT (cyan), 2D MHT (yellow), and OMGP (red). The PA has been rescaled relative to OMGP so all metrics are in %. Right: Same as center but looking at assignment accuracy on ARI (higher better), no clutter (NC) ARI (higher better), and 0-1 loss (lower better) for classifying measurements as clutter. 5 Radar Tracking Example We borrow the radar tracking example of the OMGP paper [18]. We have made the example more realistic by adding clutter λ = 8 and missed detections PD = 0.5, which were omitted in [18]; and also used N = 100 realizations to get confidence intervals on the results. We also compare with the 2D and 3D (i.e. multi-frame) MHT trackers as a baseline as they are the most widely used methods in practice. The OMGP requires the number of tracks NT to be specified in advance, so we provided it with the true number of tracks, which should have given it an extra advantage. The trackers were evaluated using the SIAP metrics, which are the standard evaluation metrics in the field [7]. We also use the adjusted Rand index (ARI) [13] to compare the accuracy of the assignments made by the algorithms; the “no clutter” ARI (which ignores clutter) and the 0-1 loss for classifying measurements as clutter also serve as assignment metrics. In Figure 2(a) both OMGP and 2D MHT miss the real tracks and create spurious tracks from clutter measurements. The 3D MHT does better, but misses the western portion of track 3 and makes a swap between track 1 and 3 at their intersection. By contrast, the VB tracker gets the scenario almost perfect, except for a small bit of the southern portion of track 2. In that area, VB designates the track as dormant, acknowledging that the associated measurements are likely clutter. This replaces the notion of a “confirmed” track in the standard tracking literature with a model-based method, and demonstrates the advantages of using a principled and model-based paradigm for the track management problem. This is quantitatively shown over repeated trials in Figure 2(b) in terms of positional error; even more striking are illustrations of the near lack of spurious tracks in VB and much higher completeness than the competing methods. We also show that the assignments are much more accurate in Figure 2(c). To check the statistical significance of our results we used a paired t-test to compare the difference between VB and the second best method, the 3D MHT. Both the SIAP and assignment metrics all have p ≤10−4. 6 Real Data: Video Tracking in Sports We use the VS-PETS 2003 soccer player data set as a real data example to validate our method. The data set is a 2500 frame video of players moving around a soccer field, with annotated ground truth; the variety of player interactions make it a challenging test case for multi-object tracking algorithms. To demonstrate the robustness of our tracker to correct a detector provided minimal training examples, we used multi-scale histogram of oriented gradients (HOG) features from 50 positive and 50 negative examples of soccer players to train a sliding window support vector machine (SVM) [23]. HOG features have been shown to work particularly well for pedestrian detection on the Caltech and INRIA data sets, and thus used for this example [8]. For each frame, the center of each bounding box is provided as the only input to our tracker. Despite modest detection rates from HOG-SVM, our tracker is still capable of separating clutter and dealing with missed detections. 7 (a) Soccer Tracking Problem ARI NC−ARI 0−1 0 0.2 0.4 0.6 0.8 1 Performance (b) Soccer Assignment Metrics Figure 3: Left: Example from soccer player tracking. We show the filtered state estimates of the MHT (magenta ·) and VB tracker (cyan ◦) for the last 25 frames as well as the true positions (black). The green boxes show the detection of the HOG-SVM for the current frame. Right: Same as Figure 2(c) but for the soccer data. Methods in order: VB-DP (dark blue), VB (light blue), 3D MHT (green), 2D MHT (orange), and OMGP (red). Soccer data source: http://www.cvg.rdg.ac.uk/slides/pets.html. We modeled player motion using (4) with F and Q derived from an NCV model [1, Ch. 1.5]. The parameters for the NCV, R, PD, λ, and the track meta-state parameters were trained by optimizing the variational lower bound Lβ on the first 1000 frames, although the algorithm did not appear sensitive to these parameters. We additionally show an extension to the VB tracker with nonparametric clutter map learning; we learned the clutter map by passing the training measurements into a VB Dirichlet process (DP) mixture [5] with their probability of being clutter under q(A) as weights. The resulting posterior predictive distribution served as p0 in the test phase; we refer to this method as the VB-DP tracker. We split the remainder of the data into 70 sequences of K = 20 frames for a test set. Due to the nature of this example, we evaluate the batch accuracy of assigning boxes to the correct players. This demonstrates the utility of our algorithm for building a database of player images for later processing and other applications. In Figure 3(b) we show the ARI and related assignment metrics for VB-DP, VB, 2D MHT, 3D MHT, and OMGP. Note that the ARI only evaluates the accuracy of the MAP assignment estimate of VB; VB additionally provides uncertainty estimates on the assignments, unlike the MHT. VB manages to increase the no clutter ARI to 0.95 ± 0.01 from 0.86 ± 0.01 for 3D MHT; and decrease the 0-1 clutter loss to 0.18 ± 0.01 from 0.21 ± 0.01 for OMGP. Using the nonparametric clutter map lowered the 0-1 loss to 0.016 ± 0.005 and increased the ARI to 0.94±0.01 (vs. 0.76±0.01 for the 2D and 3D MHT) as the VB-DP tracker knew certain areas, such as the post in the lower right, were more prone to clutter. As in the radar example the VB vs. MHT and VB vs. OMGP improvements are significant at p ≤10−4. The poor NC-ARI of OMGP is likely due to its lack of framing constraints, ignoring prior information on the assignments. Furthermore, in Figure 3(a) we plot filtered state estimates for the (non-DP) VB tracker; we again use the ≥90% meta-state threshold as a “confirmed track.” We see that the MHT is tricked by the various false detections from HOG-SVM and has spurious tracks across the field; the VB tracker “introspectively” knows when a track is unlikely to be real. While both the MHT and VB detect the referee in the upper right of the frame, the VB tracker quickly sets this track to dormant when he leaves the frame. The MHT temporarily extrapolates the track into the field before destroying it. 7 Conclusions The model-based manner of handling the track management problem shows clear advantages and may be the path forward for the field, which can clearly benefit from algorithms that eliminate arbitrary tuning parameters. Our method may be desirable even in tracking scenarios under which a full posterior does not confer advantages over a point estimate. We improve accuracy and reduce the exponential cost of the MAP approach to linear, which is a result of the induced factorizations of (13). We have also incorporated the often neglected framing constraints into our variational algorithm, which fits nicely with loopy belief propagation methods. Other areas, such as more sophisticated meta-state models, provide opportunities to extend this work into more applications of tracking and prove it as a general method and alternative to dominant approaches such as the MHT. 8 References [1] Bar-Shalom, Y., Willett, P., and Tian, X. (2011). Tracking and Data Fusion: A Handbook of Algorithms. YBS Publishing. [2] Beal, M. and Ghahramani, Z. (2003). The variational Bayesian EM algorithm for incomplete data: with application to scoring graphical model structures. In Bayesian Statistics, volume 7, pages 453–464. [3] Benfold, B. and Reid, I. (2011). Stable multi-target tracking in real-time surveillance video. In Computer Vision and Pattern Recognition (CVPR), 2011 IEEE Conference on, pages 3457–3464. IEEE. [4] Bishop, C. M. (2007). Pattern Recognition and Machine Learning. Springer. [5] Blei, D. M., Jordan, M. I., et al. (2006). Variational inference for Dirichlet process mixtures. Bayesian analysis, 1(1):121–143. [6] Bromiley, P. (2013). Products and convolutions of Gaussian probability density functions. Tina-Vision Memo 2003-003, University of Manchester. [7] Byrd, E. (2003). Single integrated air picture (SIAP) attributes version 2.0. Technical Report 2003-029, DTIC. [8] Dalal, N. and Triggs, B. (2005). Histograms of oriented gradients for human detection. In Computer Vision and Pattern Recognition (CVPR), 2005 IEEE Conference on, pages 886–893. [9] Davey, S. J. (2003). Extensions to the probabilistic multi-hypothesis tracker for improved data association. PhD thesis, The University of Adelaide. [10] Eaton, F. and Ghahramani, Z. (2013). Model reductions for inference: Generality of pairwise, binary, and planar factor graphs. Neural Computation, 25(5):1213–1260. [11] Hartikainen, J. and S¨arkk¨a, S. (2010). Kalman filtering and smoothing solutions to temporal Gaussian process regression models. In Machine Learning for Signal Processing (MLSP), pages 379–384. IEEE. [12] Heskes, T. (2003). Stable fixed points of loopy belief propagation are minima of the Bethe free energy. In Advances in Neural Information Processing Systems 15, pages 359–366. MIT Press. [13] Hubert, L. and Arabie, P. (1985). Comparing partitions. Journal of classification, 2(1):193–218. [14] Jensfelt, P. and Kristensen, S. (2001). Active global localization for a mobile robot using multiple hypothesis tracking. Robotics and Automation, IEEE Transactions on, 17(5):748–760. [15] Jonker, R. and Volgenant, A. (1987). A shortest augmenting path algorithm for dense and sparse linear assignment problems. Computing, 38(4):325–340. [16] Kalman, R. E. (1960). A new approach to linear filtering and prediction problems. Transactions of the ASME — Journal of Basic Engineering, 82(Series D):35–45. [17] Lau, R. A. and Williams, J. L. (2011). Multidimensional assignment by dual decomposition. In Intelligent Sensors, Sensor Networks and Information Processing (ISSNIP), 2011 Seventh International Conference on, pages 437–442. IEEE. [18] L´azaro-Gredilla, M., Van Vaerenbergh, S., and Lawrence, N. D. (2012). Overlapping mixtures of Gaussian processes for the data association problem. Pattern Recognition, 45(4):1386–1395. [19] Mahler, R. (2003). Multitarget Bayes filtering via first-order multitarget moments. Aerospace and Electronic Systems, IEEE Transactions on, 39(4):1152–1178. [20] Poore, A. P., Rijavec, N., Barker, T. N., and Munger, M. L. (1993). Data association problems posed as multidimensional assignment problems: algorithm development. In Optical Engineering and Photonics in Aerospace Sensing, pages 172–182. International Society for Optics and Photonics. [21] Rabiner, L. (1989). A tutorial on hidden Markov models and selected applications in speech recognition. Proceedings of the IEEE, 77(2):257–286. [22] Rauch, H. E., Tung, F., and Striebel, C. T. (1965). Maximum likelihood estimates of linear dynamical systems. AIAA Journal, 3(8):1445–1450. [23] Sch¨olkopf, B. and Smola, A. J. (2001). Learning with Kernels: Support Vector Machines, Regularization, Optimization, and Beyond. The MIT Press, Cambridge, MA, USA. [24] Valiant, L. G. (1979). The complexity of computing the permanent. Theoretical computer science, 8(2):189–201. [25] Watanabe, Y. and Chertkov, M. (2010). Belief propagation and loop calculus for the permanent of a non-negative matrix. Journal of Physics A: Mathematical and Theoretical, 43(24):242002. [26] Yedidia, J. S., Freeman, W. T., and Weiss, Y. (2001). Bethe free energy, Kikuchi approximations, and belief propagation algorithms. In Advances in Neural Information Processing Systems 13. 9
2014
328
5,434
Low-dimensional models of neural population activity in sensory cortical circuits Evan Archer1,2, Urs K¨oster3, Jonathan Pillow4, Jakob H. Macke1,2 1Max Planck Institute for Biological Cybernetics, T¨ubingen 2Bernstein Center for Computational Neuroscience, T¨ubingen 3Redwood Center for Theoretical Neuroscience, University of California at Berkeley 4Princeton Neuroscience Institute, Department of Psychology, Princeton University evan.archer@tuebingen.mpg.de, urs@nervanasys.com pillow@princeton.edu, jakob@tuebingen.mpg.de Abstract Neural responses in visual cortex are influenced by visual stimuli and by ongoing spiking activity in local circuits. An important challenge in computational neuroscience is to develop models that can account for both of these features in large multi-neuron recordings and to reveal how stimulus representations interact with and depend on cortical dynamics. Here we introduce a statistical model of neural population activity that integrates a nonlinear receptive field model with a latent dynamical model of ongoing cortical activity. This model captures temporal dynamics and correlations due to shared stimulus drive as well as common noise. Moreover, because the nonlinear stimulus inputs are mixed by the ongoing dynamics, the model can account for a multiple idiosyncratic receptive field shapes with a small number of nonlinear inputs to a low-dimensional dynamical model. We introduce a fast estimation method using online expectation maximization with Laplace approximations, for which inference scales linearly in both population size and recording duration. We test this model to multi-channel recordings from primary visual cortex and show that it accounts for neural tuning properties as well as cross-neural correlations. 1 Introduction Neurons in sensory cortices organize into highly-interconnected circuits that share common input, dynamics, and function. For example, across a cortical column, neurons may share stimulus dependence as a result of sampling the same location of visual space, having similar orientation preference [1] or receptive fields with shared sub-units [2]. As a result, a substantial fraction of stimulus-information can be redundant across neurons [3]. Recent advances in electrophysiology and functional imaging allow us to simultaneously probe the responses of the neurons in a column. However, the high dimensionality and (relatively) short duration of the resulting data renders analysis a difficult statistical problem. Recent approaches to modeling neural activity in visual cortex have focused on characterizing the responses of individual neurons by linearly projecting the stimulus on a small feature subspace that optimally drives the cell [4, 5]. Such “systems-identification” approaches seek to describe the stimulusselectivity of single neurons separately, treating each neuron as an independent computational unit. Other studies have focused on providing probabilistic models of the dynamics of neural populations, seeking to elucidate the internal dynamics underlying neural responses [6, 7, 8, 9, 10, 11]. These approaches, however, typically do not model the effect of the stimulus (or do so using only a linear stimulus drive). To realize the potential of modern recording technologies and to progress our un1 derstanding of neural population coding, we need methods for extracting both the features that drive a neural population and the resulting population dynamics [12]. We propose the Quadratic Input Latent Dynamical System (QLDS) model, a statistical model that combines a low-dimensional representation of population dynamics [9] with a low-dimensional description of stimulus selectivity [13]. A low-dimensional dynamical system governs the population response, and receives a nonlinear (quadratic) stimulus-dependent input. We model neural spike responses as Poisson (conditional on the latent state), with exponential firing rate-nonlinearities. As a result, population dynamics and stimulus drive interact multiplicatively to modulate neural firing. By modeling dynamics and stimulus dependence, our method captures correlations in response variability while also uncovering stimulus selectivity shared across a population. stimulus ... quadratic linear filters population spike response intrinsic noise linear update linear dynamics + A nonlinear function noise Figure 1: Schematic illustrating the Quadratic input latent dynamical system model (QLDS). The sensory stimulus is filtered by multiple units with quadratic stimulus selectivity (only one of which is shown) which model the feed-forward input into the population. This stimulus-drive provides input into a multi-dimensional linear dynamical system model which models recurrent dynamics and shared noise within the population. Finally, each neuron yi in the population is influenced by the dynamical system via a linear readout. QLDS therefore models both the stimulus selectivity as well as the spatio-temporal correlations of the population. 2 The Quadratic Input Latent Dynamical System (QLDS) model 2.1 Model We summarize the collective dynamics of a population using a linear, low-dimensional dynamical system with an n-dimensional latent state xt. The evolution of xt is given by xt = Axt−1 + fφ(ht) + ϵt, (1) where A is the n × n dynamics matrix and ϵ is Gaussian innovation noise with covariance matrix Q, ϵt ∼N(0, Q). Each stimulus ht drives some dimensions of xt via a nonlinear function of the stimulus, fφ, with parameters φ, where the exact form of f(·) will be discussed below. The log firing rates zt of the population couple to the latent state xt via a loading matrix C, zt = Cxt + D ∗st + d. (2) Here, we also include a second external input st, which is used to model the dependence of the firing rate of each neuron on its own spiking history [14]. We define D ∗st to be that vector whose k-th element is given by (D ∗st)k ≡PNs i=1 Dk,isk,t−i. D therefore models single-neuron properties that are not explained by shared population dynamics, and captures neural properties such as burstiness or refractory periods. The vector d represents a constant, private spike rate for each neuron. The vector xt represents the n-dimensional state of m neurons. Typically n < m, so the model parameterizes a low-dimensional dynamics for the population. We assume that, conditional on zt, the observed activity yt of m neurons is Poisson-distributed, yk,t ∼Poisson(exp(zk,t)). (3) While the Poisson likelihood provides a realistic probabilistic model for the discrete nature of spiking responses, it makes learning and inference more challenging than it would be for a Gaussian model. As we discuss in the subsequent section, we rely on computationally-efficient approximations to perform inference under the Poisson observation model for QLDS. 2 2.2 Nonlinear stimulus dependence Individual neurons in visual cortex respond selectively to only a small subset of stimulus features [4, 15]. Certain subpopulations of neurons, such as in a cortical column, share substantial receptive field overlap. We model such a neural subpopulation as sensitive to stimulus variation in a linear subspace of stimulus space, and seek to characterize this subspace by learning a set of basis vectors, or receptive fields, wi. In QLDS, a subset of latent states receives a nonlinear stimulus drive, each of which reflects modulation by a particular receptive field wi. We consider three different forms of stimulus model: a fully linear model, and two distinct quadratic models. Although it is possible to incorporate more complicated stimulus models within the QLDS framework, the quadratic models’ compact parameterization and analytic elegance make them both flexible and computationally tractable. What’s more, quadratic stimulus models appear in many classical models of neural computation, e.g. the Adelson-Bergen model for motion-selectivity [16]; quadratic models are also sometimes used in the classification of simple and complex cells in area V1 [4]. We express our stimulus model by the function fφ(ht), where φ represents the set of parameters describing the stimulus filters wi and mixing parameters ai, bi and ci (in the case of the quadratic models). When fB(ht) is identically 0 (no stimulus input), the QLDS with Poisson observations reduces to what has been previously studied as the Poisson Latent Dynamical System (PLDS) [17, 18, 9]. We briefly review three stimulus models we consider, and discuss their computational properties. Linear: The simplest stimulus model we consider is a linear function of the stimulus, f(ht) = Bht, (4) where the rows of B as linear filters, and φ = {B}. This baseline model is identical to [18, 9] and captures simple cell-like receptive fields since the input to latent states is linear and the observation process is generalized linear. Quadratic: Under the linear model, latent dynamics receive linear input from the stimulus along a single filter dimension, wi. In the quadratic model, we permit the input to each state to be a quadratic function of wi. We describe the quadratic by including three additional parameters per latent dimension, so that the stimulus drive takes the form fB,i(ht) = ai wT i ht 2 + bi wT i ht  + ci. (5) Here, the parameters φ = {wi, ai, bi, ci : i = 1, . . . , m} include multiple stimulus filters wi and quadratic parameters (ai, bi, ci). Equation 5 might result in a stimulus input that has non-zero mean with respect to the distribution of the stimulus ht, which may be undesirable. Given the covariance of ht, it is straightforward to constrain the input to be zero-mean by setting ci = −aiwT i Σwi, where Σ is the covariance of ht and we assume the stimulus to have zero mean as well. The quadratic model enables QLDS to capture phase-invariant responses, like those of complex cells in area V1. Quadratic with multiplicative interactions: In the above model, there are no interactions between different stimulus filters, which makes it difficult to model suppressive or facilitating interactions between features [4]. Although contributions from different filters combine in the dynamics of x, any interactions are linear. Our third stimulus model allows for multiplicative interactions between r < m stimulus filters, with the i-th dimension of the input given by fφ,i(ht) = r X j=1 ai,j wi Tht  wT j ht  + bi wi Tht  + ci. Again, we constrain this function to have zero mean by setting ci = −Pr j=1 ai,j wT i Σwj  . 2.3 Learning & Inference We learn all parameters via the expectation-maximization (EM) algorithm. EM proceeds by alternating between expectation (E) and maximization (M) steps, iteratively maximizing a lower-bound to the log likelihood [19]. In the E-step, one infers the distribution over trajectories xt, given data and the parameter estimates from the previous iteration. In the M-step, one updates the current parameter estimates by maximizing the expectation of the log likelihood, a lower bound on the log likelihood. EM is a standard method for fitting latent dynamical models; however, the Poisson observation model complicates computation and requires the use of approximations. 3 E-step: With Gaussian latent states xt, posterior inference amounts to computing the posterior means µt and covariances Qt of the latent states, given data and current parameters. With Poisson observations exact inference becomes intractable, so that approximate inference has to be used [18, 20, 21, 22]. Here, we apply a global Laplace approximation [20, 9] to efficiently (linearly in experiment duration T) approximate the posterior distribution by a Gaussian. We note that each fB(ht) in the E-step is deterministic, making posterior inference identical to standard PLDS models. We found a small number of iterations of Newton’s method sufficient to perform the E-step. M-step: In the M-step, each parameter is updated using the means µt and covariances Qt inferred in the E-step. Given µt and Qt, the parameters A and Q have closed-form update rules that are derived in standard texts [23]. For the Poisson likelihood, the M-step requires nonlinear optimization to update the parameters C, D and d [18, 9]. While for linear stimulus functions fφ(ht) the Mstep has a closed-form solution, for nonlinear stimulus functions we optimize φ numerically. The objective function for φ given by g(φ) = −1 2 T X t=2  (µt −Aµt−1 −fφ(ht))TQ−1(µt −Aµt−1 −fφ(ht))  + const., where µt = E[xt|yt−1, ht]. If φ is represented as a vector concatenating all of its parameters, the gradient of g(φ) takes the form ∂g(φ) ∂φ = −Q−1 T X t=2 (µt −Aµt−1 −fφ(ht))∂f(ht) ∂φ . (6) For the quadratic nonlinearity, the gradients with respect to f(ht) take the form ∂f(ht) ∂wi = 2 h ai  ht Twi  + bi i ht T, ∂f(ht) ∂ai =  ht Twi 2 , (7) ∂f(ht) ∂bi = ht Twi, ∂f(ht) ∂ci = 1. (8) Gradients for the quadratic model with multiplicative interactions take a similar form. When constrained to be 0-mean, the gradient for ci disappears, and is replaced by an additional term in the gradients for a and wi (arising from the constraint on c). We found both computation time and quality of fit for QLDS to depend strongly upon the optimization procedure used. For long time series, we split the data into small minibatches. The QLDS E-step and M-step each naturally parallelize across minibatches. Neurophysiological experiments are often naturally segmented into separate trials across different stimuli and experimental conditions, making it possible to select minibatches without boundary effects. 3 Application to simulated data We illustrate the properties of QLDS using a simulated population recording of 100 neurons, each responding to a visual stimulus of binary, white spatio-temporal noise of dimensionality 240. We simulated a recording with T = 50000 samples and a 10-dimensional latent dynamical state. Five of the latent states received stimulus input from a bank of 5 stimulus filters (see Fig. 2A, top row), and the remaining latent dimensions only had recurrent dynamics and noise. We aimed to approximate the properties of real neural populations in early sensory cortex. In particular, we set the dynamics matrix A by fitting the model to a single neuron recording from V1 [4]. When fitting the model, we assumed the same dimensionalities (10 latent states, 5 stimulus inputs) as those used to generate the data. We ran 100 iterations of EM, which—-for the recording length and dimensionality of this system—took about an hour on a 12–core intel Xeon CPU at 3.5GHz. The model recovered by EM matched the statistics of the true model well. Linear dynamical system and quadratic models of stimulus selectivity both commonly have invariances that render a particular parameterization unidentifiable [4, 15], and QLDS is no exception: the latent state (and its parameters) can be rotated without changing the model’s properties. Hence it is possible only to compare the subspace recovered by the model, and not the individual filters. In order to visualize subspace recovery, we computed the best ℓ2 approximation of the 5 “true” filters in the subspace spanned by 4 A C D E F B Total correlations 20 40 60 80 100 20 40 60 80 100 −0.2 −0.1 0 0.1 0.2 Stimulus correlations 20 40 60 80 100 20 40 60 80 100 −0.2 −0.1 0 0.1 0.2 Noise correlations 20 40 60 80 100 20 40 60 80 100 −0.2 −0.1 0 0.1 0.2 true fit true fit true fit 0 0.1 0.2 −0.05 0 0.05 0.1 0.15 0.2 noise vs stimulus correlations stimulus correlation noise correlation 0.2 0.4 0.6 0.8 −0.5 0 0.5 eigenvalues of A real imaginary 0 20 40 60 0.1 0.2 0.3 0.4 true fit probability synchronous spikes Figure 2: Results on simulated data. Low-dimensional subspace recovery from a population of 100 simulated neurons in response to a white noise stimulus. (A) Simulated neurons receive shared input from 5 spatio-temporal receptive fields (top row). QLDS recovers a subspace capable of representing the original 5 filters (bottom row). (B) QLDS permits a more compact representation than the conventional approach of mapping receptive fields for each neuron. For comparison with the representation in panel A, we here show the spike-triggered averages of the first 60 neurons in the population. (C) QLDS also models shared variability across neurons, as visualised here by the three different measures of correlation. Top: Total correlation coefficients between each pair of neurons. Values below the diagonal are from the simulated data, above the diagonal correspond to correlations recovered by the model. Center: Stimulus correlations Bottom: Noise correlations. (D) Eigenvalues of dynamics matrix A (black is ground truth, red is estimated). (E) In this model, stimulus and noise correlations are dependent on each other, for the parameters chosen in this stimulation, there is a linear relationship between them. (F) Distribution of population spike counts, i.e. total number of spikes in each time bin across the population. Population Size (# Cells) reconstruction performance vs population size reconstruction performance vs experiment length linear quadratic A B quadratic cross Experiment length (# samples) 5000 10000 15000 −5 −4 −3 −2 −1 0 1 2 MSE (log scale) 200 400 600 800 1000 −4 −3 −2 −1 0 1 MSE (log scale) Figure 3: Recovery of stimulus subspace as a function of population size (A) and experiment duration (B). Each point represents the best filter reconstruction performance of QLDS over 20 distinct simulations from the same “true” model, each initialized randomly and fit using the same number of EM iterations. Models were fit with each of three distinct stimulus nonlinearities, linear s (blue), quadratic (green), and quadratic with multiplicative interactions (red). Stimulus input of the “true” was a quadratic with multiplicative interactions, and therefore we expect only the multiplicative model (red) to each low error rates. the estimated ˆwi (see Fig. 2 A bottom row). In QLDS, different neurons share different filters, and therefore these 5 filters provide a compact description of the stimulus selectivity of the population [24]. In contrast, for traditional single-neuron analyses [4] ‘fully-connected’ models such as GLMs [14] one would estimate the receptive fields of each of the 100 filters in the population, resulting in a much less compact representation with an order of magnitude more parameters for the stimulus-part alone (see Fig. 2B). 5 QLDS captures both the stimulus-selectivity of a population and correlations across neurons. In studies of neural coding, correlations between neurons (Fig. 2C, top) are often divided into stimuluscorrelations and noise-correlations. Stimulus correlations capture correlations explainable by similarity in stimulus dependence (and are calculated by shuffling trials), whereas noise-correlations capture correlations not explainable by shared stimulus drive (which are calculated by correlating residuals after subtracting the mean firing rate across multiple presentations of the same stimulus). The QLDS-model was able to recover both the total, stimulus and noise correlations in our simulation (Fig. 2C), although it was fit only to a single recording without stimulus repeats. Finally, the model also recovered the eigenvalues of the dynamics (Fig. 2D), the relationship between noise and stimulus correlations (Fig. 2E) and the distribution of population spike counts (Fig. 2F). We assume that all stimulus dependence is captured by the subspace parameterized by the filters of the stimulus model. If this assumption holds, increasing the size of the population increases statistical power and makes identification of the stimulus selectivity easier rather than harder, in a manner similar to that of increasing the duration of the experiment. To illustrate this point, we generated multiple data-sets with larger population sizes, or with longer recording times, and show that both scenarios lead to improvements in subspace-recovery (see Fig. 3). 4 Applications to Neural Data Cat V1 with white noise stimulus We evaluate the performance of the QLDS on multi-electrode recordings from cat primary visual cortex. Data were recorded from anaesthetized cats in response to a single repeat of a 20 minute long, full-field binary noise movie, presented at 30 frames per second, and 60 repeats of a 30s long natural movie presented at 150 frames per second. Spiking activity was binned at the frame rate (33 ms for noise, 6.6 ms for natural movies). For noise, we used the first 18000 samples for training, and 5000 samples for model validation. For the natural movie, 40 repeats were used for training and 20 for validation. Silicon polytrodes (Neuronexus) were employed to record multi-unit activity (MUA) from a single cortical column, spanning all cortical layers with 32 channels. Details of the recording procedure are described elsewhere [25]. For our analyses, we used MUA without further spike-sorting from 22 channels for noise data and 25 channels for natural movies. We fit a QLDS with 3 stimulus filters, and in each case a 10-dimensional latent state, i.e. 7 of the latent dimensions received no stimulus drive. Spike trains in this data-set exhibited “burst-like” events in which multiple units were simultaneously active (Fig. 4A). The model captured these events by using a dimension of the latent state with substantial innovation noise, leading substantial variability in population activity across repeated stimulus presentations. We also calculated pairwise (time-lagged) cross-correlations for each unit pair, as well as the auto-correlation function for each unit in the data (Fig. 4B, 7 out of 22 neurons shown, results for other units are qualitatively similar.). We found that samples from the model (Fig. 4B, red) closely matched the correlations of the data for most units and unit-pairs, indicating the QLDS provided an accurate representation of the spatio-temporal correlation structure of the population recording. The instantaneous correlation matrix across all 22 cells was very similar between the physiological and sampled data (Fig. 4C). We note that receptive fields (Fig. 4F) in this data did not have spatio-temporal profiles typical of neurons in cat V1 (this was also found when using conventional analyses such as spike-triggered covariance). Upon inspection, this was likely a consequence of an LGN afferent also being included in the raw MUA. In our analysis, a 3-feature model captured stimulus correlations (in held out data) more accurately than 1- and 2- filter models. However, 10-fold cross validation revealed that 2- and 3- filter models do not improve upon a 1-filter model in terms of one-step-ahead prediction performance (i.e. trying to predict neural activity on the next time-step using past observations of population activity and the stimulus). Macaque V1 with drifting grating stimulus: We wanted to evaluate the ability of the model to capture the correlation structure (i.e. noise and signal correlations) of a data-set containing multiple repetitions of each stimulus. To this end, we fit QLDS with a Poisson observation model to the population activity of 113 V1 neurons from an anaesthetized macaque, as described in [26]. Drifting grating stimuli were presented for 1280ms, followed by a 1280ms blank period, with each of 72 grating orientations repeated 50 times. We fit a QLDS with a 20-dimensional latent state and 15 stimulus filters, where the stimulus was paramterized as a set of phase-shifted sinusoids at the appropriate spatial and temporal frequency (making ht 112-dimensional). We fit the QLDS to 35 repeats, 6 5 10 15 20 −1 −0.5 0 0.5 1 5 10 15 20 true fit Total correlations C B D E A F 0.4 0.6 0.8 0.2 0.4 0.6 0.8 noise vs stimulus correlation stimulus correlation noise correlation data 5 10 15 20 Simulated repeats to identical noise stimulus 5 10 15 20 time (s) 5 10 15 20 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 −20 0 20 0 0.2 0.4 0 0.5 1 −0.5 0 0.5 eigenvalues of A real imaginary feature 1 feature 2 −165ms feature 3 −132ms −99ms −66ms −33ms 0ms 10 20 30 40 50 60 70 80 90 10 20 30 40 50 60 70 80 90 Figure 4: QLDS fit to V1 cells with noise stimuli. We fit QLDS to T = 18000 samples of 22 neurons responding to a white noise stimulus, data binned at 33 ms. We used the quadratic with multiplicative interactions as the stimulus nonlinearity. The QLDS has a 10-dimensional latent state with 3 stimulus inputs. All results shown here are compared against T = 5000 samples of test-data, not used to train the model. (A) Top row: Rasters from recordings from 22 cells in cat visual cortex, where cell index appears on the y axis, and time in seconds on the x. Second and third row: Two independent samples from the QLDS model responding to the same noise stimuli. Note that responses are highly variable across trials. (B) Auto- and cross-correlations for data (black) and model (red) cells. For the model, we average across 60 independent samples, thickness of red curves reflects 1 standard deviation from the mean. Panel (i, j) corresponds to cross-correlation between units with indices i and j, panels along the diagonal show auto-correlations. (C) Total correlations for the true (lower diagonal) and model (upper diagonal) populations. (D) Noise correlations scattered against stimulus correlations for the model. As we did not have repeat data for this population, we were not able to reliably estimate noise correlations, and thereby evaluate the accuracy of this model-based prediction. (E) Eigenvalues of the dynamics matrix A. (F) Three stimulus filters recovered by QLDS. We selected the 3-filter QLDS by inspection, having observed that fitting with larger number of stimulus filters did not improve the fit. We note that although two of the filters appear similar, that they drive separate latent dimensions with distinct mixing weights ai, bi and ci. and held out 15 for validation. The QLDS accurately captured the stimulus and noise correlations of the full population (Fig. 5A). Further, a QLDS with 15 shared receptive fields captured simple and complex cell behavior of all 113 cells, as well as response variation across orientation (Fig. 5B). 5 Discussion We presented QLDS, a statistical model for neural population recordings from sensory cortex that combines low-dimensional, quadratic stimulus dependence with a linear dynamical system model. The stimulus model can capture simple and complex cell responses, while the linear dynamics capture temporal dynamics of the population and shared variability between neurons. We applied QLDS to population recordings from primary visual cortex (V1). The cortical microcircuit in V1 consists of highly-interconnected cells that share receptive field properties such as orientation preference [27], with a well-studied laminar organization [1]. Layer IV cells have simple cell receptive field properties, sending excitatory connections to complex cells in the deep and superficial layers. Quadratic 7 Stimulus correlations 20 40 60 80 100 20 40 60 80 100 −1 −0.5 0 0.5 1 cell index cell index 20 40 60 80 100 Noise correlations −0.1 −0.05 0 0.05 0.1 model data model data 0.2 0.4 0.6 spike rate 0 0 0.2 0.4 0.6 500 1000 1500 time (ms) spike rate 500 1000 1500 time (ms) 500 1000 1500 time (ms) 500 1000 1500 time (ms) 500 1000 1500 time (ms) 500 1000 1500 time (ms) 0 degrees 45 degrees 90 degrees 135 degrees 180 degrees 225 degrees Cell 49 Cell 50 stimulus of A B Figure 5: QLDS fit to 113 V1 cells across 35 repeats of each of 72 grating orientations. (A) Comparison of total correlations in the data and generated from the model, (B) For two cells (cells 49 and 50, using the index scheme from A) and 6 orientations (0, 45, 90, 135, 180, and 225 degrees), we show the posterior mean prediction performance (red traces) in in comparison to the average across 15 held-out trials (black traces). In each block, we show predicted and actual spike rate (y-axis) over time binned at 10 ms (x-axis). Stimulus offset is denoted by a vertical blue line. stimulus models such as the classical “energy model” [16] of complex cells reflect this structure. The motivation of QLDS is to provide a statistical description of receptive fields in the different cortical layers, and to parsimoniously capture both stimulus dependence and correlations across an entire population. Another prominent neural population model is the GLM (Generalized Linear Model, e.g. [14]; or the “common input model”, [28]), which includes a separate receptive field for each neuron, as well as spike coupling terms between neurons. While the GLM is a successful model of a population’s statistical response properties, its fully–connected parameterization scales quadratically with population size. Furthermore, the GLM supposes direct couplings between pairs of neurons, while monosynaptic couplings are statistically unlikely for recordings from a small number of neurons embedded in a large network. In QLDS, latent dynamics mediate both stimulus and noise correlations. This reflects the structure of the cortex, where recurrent connectivity gives rise to both stimulus-dependent and independent correlations. Without modeling a separate receptive field for each neuron, the model complexity of QLDS grows only linearly in population size, rather than quadratically as in fully-connected models such as the GLM [14]. Conceptually, our modeling approach treats the entire recorded population as a single “computational unit”, and aims to characterize its joint feature-selectivity and dynamics. Neurophysiology and neural coding are progressing toward recording and analyzing datasets of ever larger scale. Population-level parameterizations, such as QLDS, provide a scalable strategy for representing and analyzing the collective computational properties of neural populations. Acknowledgements We are thankful to Arnulf Graf and the co-authors of [26] for sharing the data used in Fig. 5, and to Memming Park for comments on the manuscript. JHM and EA were funded by the German Federal Ministry of Education and Research (BMBF; FKZ: 01GQ1002, Bernstein Center T¨ubingen) and the Max Planck Society, and UK by National Eye Institute grant #EY019965. Collaboration between EA, JP and JHM initiated at the ‘MCN’ Course at the Marine Biological Laboratory, Woods Hole. 8 References [1] D. Hubel and T. Wiesel, “Receptive fields, binocular interaction and functional architecture in the cat’s visual cortex,” J Physiol, pp. 106–154, 1962. [2] S. L. Smith and M. H¨ausser, “Parallel processing of visual space by neighboring neurons in mouse visual cortex,” Nature Neurosci, vol. 13, no. 9, pp. 1144–9, 2010. [3] D. S. Reich, F. Mechler, and J. D. Victor, “Independent and redundant information in nearby cortical neurons,” Science, vol. 294, pp. 2566–2568, 2001. [4] N. C. Rust, O. Schwartz, J. A. Movshon, and E. P. Simoncelli, “Spatiotemporal elements of macaque v1 receptive fields,” Neuron, vol. 46, no. 6, pp. 945–56, 2005. [5] T. O. Sharpee, “Computational identification of receptive fields,” Annu Rev Neurosci, vol. 36, pp. 103–20, 2013. [6] M. M. Churchland, B. M. Yu, M. Sahani, and K. V. Shenoy, “Techniques for extracting single-trial activity patterns from large-scale neural recordings,” vol. 17, no. 5, pp. 609–618, 2007. [7] B. M. Yu, J. P. Cunningham, G. Santhanam, S. I. Ryu, K. V. Shenoy, and M. Sahani, “Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity,” vol. 102, no. 1, pp. 614–635, 2009. [8] W. Truccolo, L. R. Hochberg, and J. P. Donoghue, “Collective dynamics in human and monkey sensorimotor cortex: predicting single neuron spikes,” Nat Neurosci, vol. 13, no. 1, pp. 105–111, 2010. [9] J. H. Macke, L. B¨using, J. P. Cunningham, B. M. Yu, K. V. Shenoy, and M. Sahani., “Empirical models of spiking in neural populations,” in Adv in Neural Info Proc Sys, vol. 24, 2012. [10] D. Pfau, E. A. Pnevmatikakis, and L. Paninski, “Robust learning of low-dimensional dynamics from large neural ensembles,” in Adv in Neural Info Proc Sys, pp. 2391–2399, 2013. [11] V. Mante, D. Sussillo, K. V. Shenoy, and W. T. Newsome, “Context-dependent computation by recurrent dynamics in prefrontal cortex,” Nature, vol. 503, pp. 78–84, Nov. 2013. [12] A. Fairhall, “The receptive field is dead. long live the receptive field?,” Curr Opin Neurobiol, vol. 25, pp. ix–xii, 2014. [13] I. M. Park, E. W. Archer, N. Priebe, and J. W. Pillow, “Spectral methods for neural characterization using generalized quadratic models,” in Adv in Neural Info Proc Sys 26, pp. 2454–2462, 2013. [14] J. W. Pillow, J. Shlens, L. Paninski, A. Sher, A. M. Litke, E. J. Chichilnisky, and E. P. Simoncelli, “Spatiotemporal correlations and visual signalling in a complete neuronal population,” Nature, vol. 454, no. 7207, pp. 995–999, 2008. [15] J. W. Pillow and E. P. Simoncelli, “Dimensionality reduction in neural models: an information-theoretic generalization of spike-triggered average and covariance analysis,” J Vis, vol. 6, no. 4, pp. 414–28, 2006. [16] E. H. Adelson and J. R. Bergen, “Spatiotemporal energy models for the perception of motion,” J Opt Soc Am A, vol. 2, no. 2, pp. 284–99, 1985. [17] A. C. Smith and E. N. Brown, “Estimating a state-space model from point process observations,” vol. 15, no. 5, pp. 965–991, 2003. [18] J. E. Kulkarni and L. Paninski, “Common-input models for multiple neural spike-train data,” Network, vol. 18, no. 4, pp. 375–407, 2007. [19] A. P. Dempster, N. M. Laird, and D. B. Rubin, “Maximum likelihood from incomplete data via the em algorithm,” J R Stat Soc Ser B, vol. 39, no. 1, pp. 1–38, 1977. [20] L. Paninski, Y. Ahmadian, D. Ferreira, S. Koyama, K. Rahnama Rad, M. Vidne, J. Vogelstein, and W. Wu, “A new look at state-space models for neural data,” vol. 29, pp. 107–126, 2010. [21] A. Z. Mangion, K. Yuan, V. Kadirkamanathan, M. Niranjan, and G. Sanguinetti, “Online variational inference for state-space models with point-process observations,” Neural Comput, vol. 23, no. 8, pp. 1967– 1999, 2011. [22] M. Emtiyaz Khan, A. Aravkin, M. Friedlander, and M. Seeger, “Fast dual variational inference for nonconjugate latent gaussian models,” in Proceedings of ICML, 2013. [23] Z. Ghahramani and G. E. Hinton, “Parameter estimation for linear dynamical systems,” Univ. Toronto Tech Report, vol. 6, no. CRG-TR-96-2, 1996. [24] J. H. Macke, G. Zeck, and M. Bethge, “Receptive fields without spike-triggering,” in Adv in Neural Info Proc Sys, vol. 20, pp. 969–976, 2008. [25] U. K¨oster, J. Sohl-Dickstein, C. M. Gray, and B. A. Olshausen, “Modeling higher-order correlations within cortical microcolumns,” PLoS Comput Bio, vol. 10, no. 7, p. e1003684, 2014. [26] A. B. Graf, A. Kohn, M. Jazayeri, and J. A. Movshon, “Decoding the activity of neuronal populations in macaque primary visual cortex,” Nature neuroscience, vol. 14, no. 2, pp. 239–245, 2011. [27] V. Mountcastle, “Modality and topographic properties of single neurons of cat’s somatic sensory cortex,” J Neurophysiol, 1957. [28] M. Vidne, Y. Ahmadian, J. Shlens, J. Pillow, J. Kulkarni, A. Litke, E. Chichilnisky, E. Simoncelli, and L. Paninski, “Modeling the impact of common noise inputs on the network activity of retinal ganglion cells,” J Comput Neurosci, 2011. 9
2014
329
5,435
Multilabel Structured Output Learning with Random Spanning Trees of Max-Margin Markov Networks Mario Marchand D´epartement d’informatique et g´enie logiciel Universit´e Laval Qu´ebec (QC), Canada mario.marchand@ift.ulaval.ca Hongyu Su Helsinki Institute for Information Technology Dept of Information and Computer Science Aalto University, Finland hongyu.su@aalto.fi Emilie Morvant∗ LaHC, UMR CNRS 5516 Univ. of St-Etienne, France emilie.morvant@univ-st-etienne.fr Juho Rousu Helsinki Institute for Information Technology Dept of Information and Computer Science Aalto University, Finland juho.rousu@aalto.fi John Shawe-Taylor Department of Computer Science University College London London, UK j.shawe-taylor@ucl.ac.uk Abstract We show that the usual score function for conditional Markov networks can be written as the expectation over the scores of their spanning trees. We also show that a small random sample of these output trees can attain a significant fraction of the margin obtained by the complete graph and we provide conditions under which we can perform tractable inference. The experimental results confirm that practical learning is scalable to realistic datasets using this approach. 1 Introduction Finding an hyperplane that minimizes the number of misclassifications is NP-hard. But the support vector machine (SVM) substitutes the hinge for the discrete loss and, modulo a margin assumption, can nonetheless efficiently find a hyperplane with a guarantee of good generalization. This paper investigates whether the problem of inference over a complete graph in structured output prediction can be avoided in an analogous way based on a margin assumption. We first show that the score function for the complete output graph can be expressed as the expectation over the scores of random spanning trees. A sampling result then shows that a small random sample of these output trees can attain a significant fraction of the margin obtained by the complete graph. Together with a generalization bound for the sample of trees, this shows that we can obtain good generalization using the average scores of a sample of trees in place of the complete graph. We have thus reduced the intractable inference problem to a convex optimization not dissimilar to a SVM. The key inference problem to enable learning with this ensemble now becomes finding the maximum violator for the (finite sample) average tree score. We then provide the conditions under which the inference problem is tractable. Experimental results confirm this prediction and show that ∗Most of this work was carried out while E. Morvant was affiliated with IST Austria, Klosterneurburg. 1 practical learning is scalable to realistic datasets using this approach with the resulting classification accuracy enhanced over more naive ways of training the individual tree score functions. The paper aims at exploring the potential ramifications of the random spanning tree observation both theoretically and practically. As such, we think that we have laid the foundations for a fruitful approach to tackle the intractability of inference in a number of scenarios. Other attractive features are that we do not require knowledge of the output graph’s structure, that the optimization is convex, and that the accuracy of the optimization can be traded against computation. Our approach is firmly rooted in the maximum margin Markov network analysis [1]. Other ways to address the intractability of loopy graph inference have included using approximate MAP inference with tree-based and LP relaxations [2], semi-definite programming convex relaxations [3], special cases of graph classes for which inference is efficient [4], use of random tree score functions in heuristic combinations [5]. Our work is not based on any of these approaches, despite superficial resemblances to, e.g., the trees in tree-based relaxations and the use of random trees in [5]. We believe it represents a distinct approach to a fundamental problem of learning and, as such, is worthy of further investigation. 2 Definitions and Assumptions We consider supervised learning problems where the input space X is arbitrary and the output space Y consists of the set of all ℓ-dimensional multilabel vectors (y1, . . . , yℓ) def= y where each yi ∈ {1, . . . , ri} for some finite positive integer ri. Each example (x, y) ∈X ×Y is mapped to a joint feature vector φφφ(x, y). Given a weight vector w in the space of joint feature vectors, the predicted output yw(x) at input x ∈X, is given by the output y maximizing the score F(w, x, y), i.e., yw(x) def= argmax y∈Y F(w, x, y) ; where F(w, x, y) def= ⟨w,φφφ(x, y)⟩, (1) and where ⟨·, ·⟩denotes the inner product in the joint feature space. Hence, yw(x) is obtained by solving the so-called inference problem, which is known to be NP-hard for many output feature maps [6, 7]. Consequently, we aim at using an output feature map for which the inference problem can be solved by a polynomial time algorithm such as dynamic programming. The margin Γ(w, x, y) achieved by predictor w at example (x, y) is defined as, Γ(w, x, y) def= min y′̸=y [F(w, x, y) −F(w, x, y′)] . We consider the case where the feature map φφφ is a potential function for a Markov network defined by a complete graph G with ℓnodes and ℓ(ℓ−1)/2 undirected edges. Each node i of G represents an output variable yi and there exists an edge (i, j) of G for each pair (yi, yj) of output variables. For any example (x, y) ∈X × Y, its joint feature vector is given by φφφ(x, y) = φφφi,j(x, yi, yj)  (i,j)∈G = ϕϕϕ(x) ⊗ψψψi,j(yi, yj)  (i,j)∈G , where ⊗is the Kronecker product. Hence, any predictor w can be written as w = (wi,j)(i,j)∈G where wi,j is w’s weight on φφφi,j(x, yi, yj). Therefore, for any w and any (x, y), we have F(w, x, y) = ⟨w,φφφ(x, y)⟩= X (i,j)∈G ⟨wi,j,φφφi,j(x, yi, yj)⟩= X (i,j)∈G Fi,j(wi,j, x, yi, yj) , where we denote by Fi,j(wi,j, x, yi, yj) = ⟨wi,j,φφφi,j(x, yi, yj) the score of labeling the edge (i, j) by (yi, yj) given input x. For any vector a, let ∥a∥denote its L2 norm. Throughout the paper, we make the assumption that we have a normalized joint feature space such that ∥φφφ(x, y)∥= 1 for all (x, y) ∈X × Y and ∥φφφi,j(x, yi, yj)∥is the same for all (i, j) ∈G. Since the complete graph G has ℓ 2  edges, it follows that ∥φφφi,j(x, yi, yj)∥2 = ℓ 2 −1 for all (i, j) ∈G. We also have a training set S def= {(x1, y1), . . . , (xm, ym)} where each example is generated independently according to some unknown distribution D. Mathematically, we do not assume the existence of a predictor w achieving some positive margin Γ(w, x, y) on each (x, y) ∈S. Indeed, 2 for some S, there might not exist any w where Γ(w, x, y) > 0 for all (x, y) ∈S. However, the generalization guarantee will be best when w achieves a large margin on most training points. Given any γ > 0, and any (x, y) ∈X ×Y, the hinge loss (at scale γ) incurred on (x, y) by a unit L2 norm predictor w that achieves a (possibly negative) margin Γ(w, x, y) is given by Lγ(Γ(w, x, y)), where the so-called hinge loss function Lγ is defined as Lγ(s) def= max (0, 1 −s/γ) ∀s ∈R . We will also make use of the ramp loss function Aγ defined by Aγ(s) def= min(1, Lγ(s)) ∀s ∈R . The proofs of all the rigorous results of this paper are provided in the supplementary material. 3 Superposition of Random Spanning Trees Given a complete graph G of ℓnodes (representing the Markov network), let S(G) denote the set of all ℓℓ−2 spanning trees of G. Recall that each spanning tree of G has ℓ−1 edges. Hence, for any edge (i, j) ∈G, the number of trees in S(G) covering that edge (i, j) is given by ℓℓ−2(ℓ−1)/ ℓ 2  = (2/ℓ)ℓℓ−2. Therefore, for any function f of the edges of G we have X T ∈S(G) X (i,j)∈T f ((i, j)) = ℓℓ−2 2 ℓ X (i,j)∈G f((i, j)) . Given any spanning tree T of G and given any predictor w, let wT denote the projection of w on the edges of T. Namely, (wT )i,j = wi,j if (i, j) ∈T, and (wT )i,j = 0 otherwise. Let us also denote by φφφT (x, y), the projection of φφφ(x, y) on the edges of T. Namely, (φφφT (x, y))i,j = φφφi,j(x, yi, yj) if (i, j) ∈T, and (φφφT (x, y))i,j = 0 otherwise. Recall that ∥φφφi,j(x, yi, yj)∥2 = ℓ 2 −1 ∀(i, j) ∈G. Thus, for all (x, y) ∈X × Y and for all T ∈S(G), we have ∥φφφT (x, y)∥2 = X (i,j)∈T ∥φφφi,j(x, yi, yj)∥2 = ℓ−1 ℓ 2  = 2 ℓ. We now establish how F(w, x, y) can be written as an expectation over all the spanning trees of G. Lemma 1. Let ˆwT def= wT /∥wT ∥, ˆφφφT def= φφφT /∥φφφT ∥. Let U(G) denote the uniform distribution on S(G). Then, we have F(w, x, y) = E T ∼U(G) aT ⟨ˆwT , ˆφφφT (x, y)⟩, where aT def= r ℓ 2 ∥wT ∥. Moreover, for any w such that ∥w∥= 1, we have: E T ∼U(G) a2 T = 1, and E T ∼U(G) aT ≤1 . Let T def= {T1, . . . , Tn} be a sample of n spanning trees of G where each Ti is sampled independently according to U(G). Given any unit L2 norm predictor w on the complete graph G, our task is to investigate how the margins Γ(w, x, y), for each (x, y) ∈X ×Y, will be modified if we approximate the (true) expectation over all spanning trees by an average over the sample T . For this task, we consider any (x, y) and any w of unit L2 norm. Let FT (w, x, y) denote the estimation of F(w, x, y) on the tree sample T , FT (w, x, y) def= 1 n n X i=1 aTi⟨ˆwTi, ˆφφφTi(x, y)⟩, and let ΓT (w, x, y) denote the estimation of Γ(w, x, y) on the tree sample T , ΓT (w, x, y) def= min y′̸=y [FT (w, x, y) −FT (w, x, y′)] . The following lemma states how ΓT relates to Γ. Lemma 2. Consider any unit L2 norm predictor w on the complete graph G that achieves a margin of Γ(w, x, y) for each (x, y) ∈X × Y, then we have ΓT (w, x, y) ≥Γ(w, x, y) −2ϵ ∀(x, y) ∈X × Y , whenever we have |FT (w, x, y) −F(w, x, y)| ≤ϵ for all (x, y) ∈X × Y. 3 Lemma 2 has important consequences whenever |FT (w, x, y) −F(w, x, y)| ≤ϵ for all (x, y) ∈ X × Y. Indeed, if w achieves a hard margin Γ(w, x, y) ≥γ > 0 for all (x, y) ∈S, then we have that w also achieves a hard margin of ΓT (w, x, y) ≥γ −2ϵ on each (x, y) ∈S when using the tree sample T instead of the full graph G. More generally, if w achieves a ramp loss of Aγ(Γ(w, x, y)) for each (x, y) ∈X ×Y, then w achieves a ramp loss of Aγ(ΓT (w, x, y)) ≤Aγ (Γ(w, x, y) −2ϵ) for all (x, y) ∈X × Y when using the tree sample T instead of the full graph G. This last property follows directly from the fact that Aγ(s) is a non-increasing function of s. The next lemma tells us that, apart from a slow ln2(√n) dependence, a sample of n ∈Θ(ℓ2/ϵ2) spanning trees is sufficient to assure that the condition of Lemma 2 holds with high probability for all (x, y) ∈X × Y. Such a fast convergence rate was made possible by using PAC-Bayesian methods which, in our case, prevented us of using the union bound over all possible y ∈Y. Lemma 3. Consider any ϵ > 0 and any unit L2 norm predictor w for the complete graph G acting on a normalized joint feature space. For any δ ∈(0, 1), let n ≥ℓ2 ϵ2  1 16 + 1 2 ln 8√n δ 2 . (2) Then with probability of at least 1 −δ/2 over all samples T generated according to U(G)n, we have, simultaneously for all (x, y) ∈X × Y, that |FT (w, x, y) −F(w, x, y)| ≤ϵ. Given a sample T of n spanning trees of G, we now consider an arbitrary set W def= { ˆwT1, . . . , ˆwTn} of unit L2 norm weight vectors where each ˆwTi operates on a unit L2 norm feature vector ˆφφφTi(x, y). For any T and any such set W, we consider an arbitrary unit L2 norm conical combination of each weight in W realized by a n-dimensional weight vector q def= (q1, . . . , qn), where Pn i=1 q2 i = 1 and each qi ≥0. Given any (x, y) and any T , we define the score FT (W, q, x, y) achieved on (x, y) by the conical combination (W, q) on T as FT (W, q, x, y) def= 1 √n n X i=1 qi⟨ˆwTi, ˆφφφTi(x, y)⟩, (3) where the √n denominator ensures that we always have FT (W, q, x, y) ≤1 in view of the fact that Pn i=1 qi can be as large as √n. Note also that FT (W, q, x, y) is the score of the feature vector obtained by the concatenation of all the weight vectors in W (and weighted by q) acting on a feature vector obtained by concatenating each ˆφφφTi multiplied by 1/√n. Hence, given T , we define the margin ΓT (W, q, x, y) achieved on (x, y) by the conical combination (W, q) on T as ΓT (W, q, x, y) def= min y′̸=y [FT (W, q, x, y) −FT (W, q, x, y′)] . (4) For any unit L2 norm predictor w that achieves a margin of Γ(w, x, y) for all (x, y) ∈X × Y, we now show that there exists, with high probability, a unit L2 norm conical combination (W, q) on T achieving margins that are not much smaller than Γ(w, x, y). Theorem 4. Consider any unit L2 norm predictor w for the complete graph G, acting on a normalized joint feature space, achieving a margin of Γ(w, x, y) for each (x, y) ∈X × Y. Then for any ϵ > 0, and any n satisfying Lemma 3, for any δ ∈(0, 1], with probability of at least 1 −δ over all samples T generated according to U(G)n, there exists a unit L2 norm conical combination (W, q) on T such that, simultaneously for all (x, y) ∈X × Y, we have ΓT (W, q, x, y) ≥ 1 √1 + ϵ [Γ(w, x, y) −2ϵ] . From Theorem 4, and since Aγ(s) is a non-increasing function of s, it follows that, with probability at least 1 −δ over the random draws of T ∼U(G)n, there exists (W, q) on T such that, simultaneously for all ∀(x, y) ∈X × Y, for any n satisfying Lemma 3 we have Aγ(ΓT (W, q, x, y)) ≤Aγ  [Γ(w, x, y) −2ϵ] (1 + ϵ)−1/2 . Hence, instead of searching for a predictor w for the complete graph G that achieves a small expected ramp loss E(x,y)∼DAγ(Γ(w, x, y), Theorem 4 tells us that we can settle the search for a 4 unit L2 norm conical combination (W, q) on a sample T of randomly-generated spanning trees of G that achieves small E(x,y)∼DAγ(ΓT (W, q, x, y)). But recall that ΓT (W, q, x, y)) is the margin of a weight vector obtained by the concatenation of all the weight vectors in W (weighted by q) on a feature vector obtained by the concatenation of the n feature vectors (1/√n)ˆφφφTi. It thus follows that any standard risk bound for the SVM applies directly to E(x,y)∼DAγ(ΓT (W, q, x, y)). Hence, by adapting the SVM risk bound of [8], we have the following result. Theorem 5. Consider any sample T of n spanning trees of the complete graph G. For any γ > 0 and any 0 < δ ≤1, with probability of at least 1 −δ over the random draws of S ∼Dm, simultaneously for all unit L2 norm conical combinations (W, q) on T , we have E (x,y)∼D Aγ(ΓT (W, q, x, y)) ≤ 1 m m X i=1 Aγ(ΓT (W, q, xi, yi)) + 2 γ√m + 3 r ln(2/δ) 2m . Hence, according to this theorem, the conical combination (W, q) having the best generalization guarantee is the one which minimizes the sum of the first two terms on the right hand side of the inequality. Note that the theorem is still valid if we replace, in the empirical risk term, the non-convex ramp loss Aγ by the convex hinge loss Lγ. This provides the theoretical basis of the proposed optimization problem for learning (W, q) on the sample T . 4 A L2-Norm Random Spanning Tree Approximation Approach If we introduce the usual slack variables ξk def= γ · Lγ(ΓT (W, q, xk, yk), Theorem 5 suggests that we should minimize 1 γ Pm k=1 ξk for some fixed margin value γ > 0. Rather than performing this task for several values of γ, we show in the supplementary material that we can, equivalently, solve the following optimization problem for several values of C > 0. Definition 6. Primal L2-norm Random Tree Approximation. min wTi,ξk 1 2 n X i=1 ||wTi||2 2 + C m X k=1 ξk s.t. n X i=1 ⟨wTi, ˆφφφTi(xk, yk)⟩−max y̸=yk n X i=1 ⟨wTi, ˆφφφTi(xk, y)⟩≥1 −ξk, ξk ≥0 , ∀k ∈{1, . . . , m}, where {wTi|Ti ∈T } are the feature weights to be learned on each tree, ξk is the margin slack allocated for each xk, and C is the slack parameter that controls the amount of regularization. This primal form has the interpretation of maximizing the joint margins from individual trees between (correct) training examples and all the other (incorrect) examples. The key for the efficient optimization is solving the ’argmax’ problem efficiently. In particular, we note that the space of all multilabels is exponential in size, thus forbidding exhaustive enumeration over it. In the following, we show how exact inference over a collection T of trees can be implemented in Θ(Knℓ) time per data point, where K is the smallest number such that the average score of the K’th best multilabel for each tree of T is at most FT (x, y) def= 1 n Pn i=1⟨wTi, ˆφφφTi(x, y)⟩. Whenever K is polynomial in the number of labels, this gives us exact polynomial-time inference over the ensemble of trees. 4.1 Fast inference over a collection of trees It is well known that the exact solution to the inference problem ˆyTi(x) = argmax y∈Y FwTi (x, y) def= argmax y∈Y ⟨wTi, ˆφφφTi(x, y)⟩, (5) on an individual tree Ti can be obtained in Θ(ℓ) time by dynamic programming. However, there is no guarantee that the maximizer ˆyTi of Equation (5) is also a maximizer of FT . In practice, ˆyTi 5 can differ for each spanning tree Ti ∈T . Hence, instead of using only the best scoring multilabel ˆyTi from each individual Ti ∈T , we consider the set of the K highest scoring multilabels YTi,K = {ˆyTi,1, · · · , ˆyTi,K} of FwTi (x, y). In the supplementary material we describe a dynamic programming to find the K highest multilabels in Θ(Kℓ) time. Running this algorithm for all of the trees gives us a candidate set of Θ(Kn) multilabels YT ,K = YT1,K ∪· · · ∪YTn,K. We now state a key lemma that will enable us to verify if the candidate set contains the maximizer of FT . Lemma 7. Let y⋆ K = argmax y∈YT ,K FT (x, y) be the highest scoring multilabel in YT ,K. Suppose that FT (x, y⋆ K) ≥1 n n X i=1 FwTi (x, yTi,K) def= θx(K). It follows that FT (x, y⋆ K) = maxy∈Y FT (x, y). We can use any K satisfying the lemma as the length of K-best lists, and be assured that y⋆ K is a maximizer of FT . We now examine the conditions under which the highest scoring multilabel is present in our candidate set YT ,K with high probability. For any x ∈X and any predictor w, let ˆy def= yw(x) def= argmax y∈Y F(w, x, y) be the highest scoring multilabel in Y for predictor w on the complete graph G. For any y ∈Y, let KT (y) be the rank of y in tree T and let ρT (y) def= KT (y)/|Y| be the normalized rank of y in tree T. We then have 0 < ρT (y) ≤1 and ρT (y′) = miny∈Y ρT (y) whenever y′ is a highest scoring multilabel in tree T. Since w and x are arbitrary and fixed, let us drop them momentarily from the notation and let F(y) def= F(w, x, y), and FT (y) def= FwT (x, y). Let U(Y) denote the uniform distribution of multilabels on Y. Then, let µT def= Ey∼U(Y)FT (y) and µ def= ET ∼U(G)µT . Let T ∼U(G)n be a sample of n spanning trees of G. Since the scoring function FT of each tree T of G is bounded in absolute value, it follows that FT is a σT -sub-Gaussian random variable for some σT > 0. We now show that, with high probability, there exists a tree T ∈T such that ρT (ˆy) is decreasing exponentially rapidly with (F(ˆy) −µ)/σ, where σ2 def= ET ∼U(G)σ2 T . Lemma 8. Let the scoring function FT of each spanning tree of G be a σT -sub-Gaussian random variable under the uniform distribution of labels; i.e., for each T on G, there exists σT > 0 such that for any λ > 0 we have E y∼U(Y) eλ(FT (y)−µT ) ≤e λ2 2 σ2 T . Let σ2 def= E T ∼U(G) σ2 T , and let α def= Pr T ∼U(G)  µT ≤µ ∧FT (ˆy) ≥F(ˆy) ∧σ2 T ≤σ2 . Then, Pr T ∼U(G)n  ∃T ∈T : ρT (ˆy) ≤e−1 2 (F (ˆy)−µ)2 σ2  ≥1 −(1 −α)n . Thus, even for very small α, when n is large enough, there exists, with high probability, a tree T ∈T such that ˆy has a small ρT (ˆy) whenever [F(ˆy) −µ]/σ is large for G. For example, when |Y| = 2ℓ (the multiple binary classification case), we have with probability of at least 1 −(1 −α)n, that there exists T ∈T such that KT (ˆy) = 1 whenever F(ˆy) −µ ≥σ √ 2ℓln 2. 4.2 Optimization To optimize the L2-norm RTA problem (Definition 6) we convert it to the marginalized dual form (see the supplementary material for the derivation), which gives us a polynomial-size problem (in the number of microlabels) and allows us to use kernels to tackle complex input spaces efficiently. Definition 9. L2-norm RTA Marginalized Dual max µµµ∈Mm 1 |ET | X e,k,ue µ(k, e, ue) −1 2 X e,k,ue, k′,u′ e µ(k, e, ue)Ke T (xk, ue; x′ k, u′ e)µ(k′, e, u′ e) , where ET is the union of the sets of edges appearing in T , and µµµ ∈Mm are the marginal dual variables µµµ def= (µ(k, e, ue))k,e,ue, with the triplet (k, e, ue) corresponding to labeling the edge 6 DATASET MICROLABEL LOSS (%) 0/1 LOSS (%) SVM MTL MMCRF MAM RTA SVM MTL MMCRF MAM RTA EMOTIONS 22.4 20.2 20.1 19.5 18.8 77.8 74.5 71.3 69.6 66.3 YEAST 20.0 20.7 21.7 20.1 19.8 85.9 88.7 93.0 86.0 77.7 SCENE 9.8 11.6 18.4 17.0 8.8 47.2 55.2 72.2 94.6 30.2 ENRON 6.4 6.5 6.2 5.0 5.3 99.6 99.6 92.7 87.9 87.7 CAL500 13.7 13.8 13.7 13.7 13.8 100.0 100.0 100.0 100.0 100.0 FINGERPRINT 10.3 17.3 10.5 10.5 10.7 99.0 100.0 99.6 99.6 96.7 NCI60 15.3 16.0 14.6 14.3 14.9 56.9 53.0 63.1 60.0 52.9 MEDICAL 2.6 2.6 2.1 2.1 2.1 91.8 91.8 63.8 63.1 58.8 CIRCLE10 4.7 6.3 2.6 2.5 0.6 28.9 33.2 20.3 17.7 4.0 CIRCLE50 5.7 6.2 1.5 2.1 3.8 69.8 72.3 38.8 46.2 52.8 Table 1: Prediction performance of each algorithm in terms of microlabel loss and 0/1 loss. The best performing algorithm is highlighted with boldface, the second best is in italic. e=(v, v′) ∈ET of the output graph by ue =(uv, uv′)∈Yv×Yv′ for the training example xk. Also, Mm is the marginal dual feasible set and Ke T (xk, ue; xk′, u′ e) def = NT (e) |ET |2 K(xk, xk′) ψψψe(ykv, ykv′) −ψψψe(uv, uv′),ψψψe(yk′v, yk′v′) −ψψψe(u′ v, u′ v′) is the joint kernel of input features and the differences of output features of true and competing multilabels (yk, u), projected to the edge e. Finally, NT (e) denotes the number of times e appears among the trees of the ensemble. The master algorithm described in the supplementary material iterates over each training example until convergence. The processing of each training example xk proceeds by finding the worst violating multilabel of the ensemble defined as ¯yk def= argmax y̸=yk FT (xk, y) , (6) using the K-best inference approach of the previous section, with the modification that the correct multilabel is excluded from the K-best lists. The worst violator ¯yk is mapped to a vertex ¯µµµ(xk) = C · ([¯ye = ue])e,ue ∈Mk corresponding to the steepest feasible ascent direction (c.f, [9]) in the marginal dual feasible set Mk of example xk, thus giving us a subgradient of the objective of Definition 9. An exact line search is used to find the saddle point between the current solution and ¯µµµ. 5 Empirical Evaluation We compare our method RTA to Support Vector Machine (SVM) [10, 11], Multitask Feature Learning (MTL) [12], Max-Margin Conditional Random Fields (MMCRF) [9] which uses the loopy belief propagation algorithm for approximate inference on the general graph, and Maximum Average Marginal Aggregation (MAM) [5] which is a multilabel ensemble model that trains a set of random tree based learners separately and performs the final approximate inference on a union graph of the edge potential functions of the trees. We use ten multilabel datasets from [5]. Following [5], MAM is constructed with 180 tree based learners, and for MMCRF a consensus graph is created by pooling edges from 40 trees. We train RTA with up to 40 spanning trees and with K up to 32. The linear kernel is used for methods that require kernelized input. Margin slack parameters are selected from {100, 50, 10, 1, 0.5, 0.1, 0.01}. We use 5-fold cross-validation to compute the results. Prediction performance. Table 1 shows the performance in terms of microlabel loss and 0/1 loss. The best methods are highlighted in ’boldface’ and the second best in ’italics’ (see supplementary material for full results). RTA quite often improves over MAM in 0/1 accuracy, sometimes with noticeable margin except for Enron and Circle50. The performances in microlabel accuracy are quite similar while RTA is slightly above the competition. This demonstrates the advantage of RTA that gains by optimizing on a collection of trees simultaneously rather than optimizing on individual trees as MAM. In addition, learning using approximate inference on a general graph seems less 7 G G G G G G G 0 20 40 60 80 100 |T| = 5 K (% of |Y|) Y* being verified (% of data) G G Emotions Yeast Scene Enron Cal500 Fingerprint NCI60 Medical Circle10 Circle50 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 G G G G G G G 1 3 10 32 100 316 1000 G G G G G G G 0 20 40 60 80 100 |T| = 10 K (% of |Y|) Y* being verified (% of data) 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 G G G G G G G 1 3 10 32 100 316 1000 G G G G G G G 0 20 40 60 80 100 |T| = 40 K (% of |Y|) Y* being verified (% of data) 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 1 3 10 32 100 316 1000 G G G G G G G 1 3 10 32 100 316 1000 Figure 1: Percentage of examples with provably optimal y∗being in the K-best lists plotted as a function of K, scaled with respect to the number of microlabels in the dataset. favorable as the tree-based methods, as MMCRF quite consistently trails to RTA and MAM in both microlabel and 0/1 error, except for Circle50 where it outperforms other models. Finally, we notice that SVM, as a single label classifier, is very competitive against most multilabel methods for microlabel accuracy. Exactness of inference on the collection of trees. We now study the empirical behavior of the inference (see Section 4) on the collection of trees, which, if taken as a single general graph, would call for solving an NP-hard inference problem. We provide here empirical evidence that we can perform exact inference on most examples in most datasets in polynomial time. We ran the K-best inference on eleven datasets where the RTA models were trained with different amounts of spanning trees |T |={5, 10, 40} and values for K ={2, 4, 8, 16, 32, 40, 60}. For each parameter combination and for each example, we recorded whether the K-best inference was provably exact on the collection (i.e., if Lemma 7 was satisfied). Figure 1 plots the percentage of examples where the inference was indeed provably exact. The values are shown as a function of K, expressed as the percentage of the number of microlabels in each dataset. Hence, 100% means K = ℓ, which denotes low polynomial (Θ(nℓ2)) time inference in the exponential size multilabel space. We observe, from Figure 1, on some datasets (e.g., Medical, NCI60), that the inference task is very easy since exact inference can be computed for most of the examples even with K values that are below 50% of the number of microlabels. By setting K = ℓ(i.e., 100%) we can perform exact inference for about 90% of the examples on nine datasets with five trees, and eight datasets with 40 trees. On two of the datasets (Cal500, Circle50), inference is not (in general) exact with low values of K. Allowing K to grow superlinearly on ℓwould possibly permit exact inference on these datasets. However, this is left for future studies. Finally, we note that the difficulty of performing provably exact inference slightly increases when more spanning trees are used. We have observed that, in most cases, the optimal multilabel y∗is still on the K-best lists but the conditions of Lemma 7 are no longer satisfied, hence forbidding us to prove exactness of the inference. Thus, working to establish alternative proofs of exactness is a worthy future research direction. 6 Conclusion The main theoretical result of the paper is the demonstration that if a large margin structured output predictor exists, then combining a small sample of random trees will, with high probability, generate a predictor with good generalization. The key attraction of this approach is the tractability of the inference problem for the ensemble of trees, both indicated by our theoretical analysis and supported by our empirical results. However, as a by-product, we have a significant added benefit: we do not need to know the output structure a priori as this is generated implicitly in the learned weights for the trees. This is used to significant advantage in our experiments that automatically leverage correlations between the multiple target outputs to give a substantive increase in accuracy. It also suggests that the approach has enormous potential for applications where the structure of the output is not known but is expected to play an important role. 8 References [1] Ben Taskar, Carlos Guestrin, and Daphne Koller. Max-margin markov networks. In S. Thrun, L.K. Saul, and B. Sch¨olkopf, editors, Advances in Neural Information Processing Systems 16, pages 25–32. MIT Press, 2004. [2] Martin J. Wainwright, Tommy S. Jaakkola, and Alan S. Willsky. MAP estimation via agreement on trees: message-passing and linear programming. IEEE Transactions on Information Theory, 51(11):3697–3717, 2005. [3] Michael I. Jordan and Martin J Wainwright. Semidefinite relaxations for approximate inference on graphs with cycles. In S. Thrun, L.K. Saul, and B. Sch¨olkopf, editors, Advances in Neural Information Processing Systems 16, pages 369–376. MIT Press, 2004. [4] Amir Globerson and Tommi S. Jaakkola. Approximate inference using planar graph decomposition. In B. Sch¨olkopf, J.C. Platt, and T. Hoffman, editors, Advances in Neural Information Processing Systems 19, pages 473–480. MIT Press, 2007. [5] Hongyu Su and Juho Rousu. Multilabel classification through random graph ensembles. Machine Learning, dx.doi.org/10.1007/s10994-014-5465-9, 2014. [6] Robert G. Cowell, A. Philip Dawid, Steffen L. Lauritzen, and David J. Spiegelhalter. Probabilistic Networks and Expert Systems. Springer, New York, 1999. [7] Thomas G¨artner and Shankar Vembu. On structured output training: hard cases and an efficient alternative. Machine Learning, 79:227–242, 2009. [8] John Shawe-Taylor and Nello Cristianini. Kernel Methods for Pattern Analysis. Cambridge University Press, 2004. [9] J. Rousu, C. Saunders, S. Szedmak, and J. Shawe-Taylor. Efficient algorithms for max-margin structured classification. Predicting Structured Data, pages 105–129, 2007. [10] Kristin P. Bennett. Combining support vector and mathematical programming methods for classifications. In B. Sch¨olkopf, C. J. C. Burges, and A. J. Smola, editors, Advances in Kernel Methods—Support Vector Learning, pages 307–326. MIT Press, Cambridge, MA, 1999. [11] Nello Cristianini and John Shawe-Taylor. An Introduction to Support Vector Machines and Other Kernel-Based Learning Methods. Cambridge University Press, Cambridge, U.K., 2000. [12] Andreas Argyriou, Theodoros Evgeniou, and Massimiliano Pontil. Convex multi-task feature learning. Machine Learning, 73(3):243–272, 2008. [13] Yevgeny Seldin, Franc¸ois Laviolette, Nicol`o Cesa-Bianchi, John Shawe-Taylor, and Peter Auer. PAC-Bayesian inequalities for martingales. IEEE Transactions on Information Theory, 58:7086–7093, 2012. [14] Andreas Maurer. A note on the PAC Bayesian theorem. CoRR, cs.LG/0411099, 2004. [15] David McAllester. PAC-Bayesian stochastic model selection. Machine Learning, 51:5–21, 2003. [16] Juho Rousu, Craig Saunders, Sandor Szedmak, and John Shawe-Taylor. Kernel-based learning of hierarchical multilabel classification models. Journal of Machine Learning Research, 7:1601–1626, December 2006. 9
2014
33
5,436
Spectral k-Support Norm Regularization Andrew M. McDonald, Massimiliano Pontil, Dimitris Stamos Department of Computer Science University College London {a.mcdonald,m.pontil,d.stamos}@cs.ucl.ac.uk Abstract The k-support norm has successfully been applied to sparse vector prediction problems. We observe that it belongs to a wider class of norms, which we call the box-norms. Within this framework we derive an efficient algorithm to compute the proximity operator of the squared norm, improving upon the original method for the k-support norm. We extend the norms from the vector to the matrix setting and we introduce the spectral k-support norm. We study its properties and show that it is closely related to the multitask learning cluster norm. We apply the norms to real and synthetic matrix completion datasets. Our findings indicate that spectral k-support norm regularization gives state of the art performance, consistently improving over trace norm regularization and the matrix elastic net. 1 Introduction In recent years there has been a great deal of interest in the problem of learning a low rank matrix from a set of linear measurements. A widely studied and successful instance of this problem arises in the context of matrix completion or collaborative filtering, in which we want to recover a low rank (or approximately low rank) matrix from a small sample of its entries, see e.g. [1, 2]. One prominent method to solve this problem is trace norm regularization: we look for a matrix which closely fits the observed entries and has a small trace norm (sum of singular values) [3, 4, 5]. Besides collaborative filtering, this problem has important applications ranging from multitask learning, to computer vision and natural language processing, to mention but a few. In this paper, we propose new techniques to learn low rank matrices. These are inspired by the notion of the k-support norm [6], which was recently studied in the context of sparse vector prediction and shown to empirically outperform the Lasso [7] and Elastic Net [8] penalties. We note that this norm can naturally be extended to the matrix setting and its characteristic properties relating to the cardinality operator translate in a natural manner to matrices. Our approach is suggested by the observation that the k-support norm belongs to a broader class of norms, which makes it apparent that they can be extended to spectral matrix norms. Moreover, it provides a link between the spectral k-support norm and the cluster norm, a regularizer introduced in the context of multitask learning [9]. This result allows us to interpret the spectral k-support norm as a special case of the cluster norm and furthermore adds a new perspective of the cluster norm as a perturbation of the former. The main contributions of this paper are threefold. First, we show that the k-support norm can be written as a parametrized infimum of quadratics, which we term the box-norms, and which are symmetric gauge functions. This allows us to extend the norms to orthogonally invariant matrix norms using a classical result by von Neumann [10]. Second, we show that the spectral box-norm is essentially equivalent to the cluster norm, which in turn can be interpreted as a perturbation of the spectral k-support norm, in the sense of the Moreau envelope [11]. Third, we use the infimum framework to compute the box-norm and the proximity operator of the squared norm in O(d log d) time. Apart from improving on the O(d(k + log d)) algorithm in [6], this method allows one to use optimal first order optimization algorithms [12] with the cluster norm. Finally, we present numerical 1 experiments which indicate that the spectral k-support norm shows a significant improvement in performance over regularization with the trace norm and the matrix elastic net, on four popular matrix completion benchmarks. The paper is organized as follows. In Section 2 we recall the k-support norm, and define the boxnorm. In Section 3 we study their properties, we introduce the corresponding spectral norms, and we observe the connection to the cluster norm. In Section 4 we compute the norm and we derive a fast method to compute the proximity operator. Finally, in Section 5 we report on our numerical experiments. The supplementary material contains derivations of the results in the body of the paper. 2 Preliminaries In this section, we recall the k-support norm and we introduce the box-norm and its dual. The ksupport norm k · k(k) was introduced in [6] as the norm whose unit ball is the convex hull of the set of vectors of cardinality at most k and `2-norm no greater than one. The authors show that the k-support norm can be written as the infimal convolution [11] kwk(k) = inf 8 < : X g2Gk kvgk2 : vg 2 Rd, supp(vg) ✓g, X g2Gk vg = w 9 = ; , w 2 Rd, (1) where Gk is the collection of all subsets of {1, . . . , d} containing at most k elements, and for any v 2 Rd, the set supp(v) = {i : vi 6= 0} denotes the support of v. When used as a regularizer, the norm encourages vectors w to be a sum of a limited number of vectors with small support. The k-support norm is a special case of the group lasso with overlap [13], where the cardinality of the support sets is at most k. Despite the complicated form of the primal norm, the dual norm has a simple formulation, namely the `2-norm of the k largest components of the vector kuk⇤,(k) = v u u t k X i=1 (|u|# i )2, u 2 Rd, (2) where |u|# is the vector obtained from u by reordering its components so that they are non-increasing in absolute value [6]. The k-support norm includes the `1-norm and `2-norm as special cases. This is clear from the dual norm since for k = 1 and k = d, it is equal to the `1-norm and `2-norm, respectively. We note that while definition (1) involves a combinatorial number of variables, [6] observed that the norm can be computed in O(d log d). We now define the box-norm, and in the following section we will show that the k-support norm is a special case of this family. Definition 2.1. Let 0 a b and c 2 [ad, bd] and let ⇥= {✓2 Rd : a ✓i b, Pd i=1 ✓i c}. The box-norm is defined as kwk⇥= v u u t inf ✓2⇥ d X i=1 w2 i ✓i , w 2 Rd. (3) This formulation will be fundamental in deriving the proximity operator in Section 4.1. Note that we may assume without loss of generality that b = 1, as by rescaling we obtain an equivalent norm, however we do not explicitly fix b in the sequel. Proposition 2.2. The norm (3) is well defined and the dual norm is kuk⇤,⇥= s sup ✓2⇥ dP i=1 ✓iu2 i . The result holds true in the more general case that ⇥is a bounded convex subset of the strictly positive orthant (for related results see [14, 15, 16, 17, 18, 19] and references therein). In this paper we limit ourselves to the box constraints above. In particular we note that the constraints are invariant with respect to permutation of the components of ⇥, and as we shall see this property is key to extend the norm to matrices. 2 3 Properties of the Norms In this section, we study the properties of the vector norms, and we extend the norms to the matrix setting. We begin by deriving the dual box-norm. Proposition 3.1. The dual box-norm is given by kuk⇤,⇥= q akuk2 2 + (b −a)kuk2 ⇤,(k) + (b −a)(⇢−k)(|u|# k+1)2, (4) where ⇢= c−da b−a and k is the largest integer not exceeding ⇢. We see from (4) that the dual norm decomposes into two `2-norms plus a residual term, which vanishes if ⇢= k, and for the rest of this paper we assume this holds, which loses little generality. Note that setting a = 0, b = 1, and c = k 2 {1, . . . , d}, the dual box-norm (4) is the `2-norm of the largest k components of u, and we recover the dual k-support norm in equation (2). It follows that the k-support norm is a box-norm with parameters a = 0, b = 1, c = k. The following infimal convolution interpretation of the box-norm provides a link between the boxnorm and the k-support norm, and illustrates the effect of the parameters. Proposition 3.2. If 0 < a b and c = (b −a)k + da, for k 2 {1, . . . , d}, then kwk⇥= inf 8 < : X g2Gk v u u tX i2g v2 g,i b + X i/2g v2 g,i a : vg 2 Rd, X g2Gk vg = w 9 = ; . (5) Notice that if b = 1, then as a tends to zero, we obtain the expression of the k-support norm (1), recovering in particular the support constraints. If a is small and positive, the support constraints are not imposed, however effectively most of the weight for each vg tends to be concentrated on supp(g). Hence, Proposition 3.2 suggests that the box-norm regularizer will encourage vectors w whose dominant components are a subset of a union of a small number of groups g 2 Gk. The previous results have characterized the k-support norm as a special case of the box-norm. Conversely, the box-norm can be seen as a perturbation of the k-support norm with a quadratic term. Proposition 3.3. Let k·k⇥be the box-norm on Rd with parameters 0 < a < b and c = k(b−a)+da, for k 2 {1, . . . , d}, then kwk2 ⇥= min z2Rd ⇢1 akw −zk2 2 + 1 b −akzk2 (k) / . (6) Consider the regularization problem minw2Rd kXw −yk2 2 + λkwk2 ⇥, with data X and response y. Using Proposition 3.3 and setting w = u + z, we see that this problem is equivalent to min u,z2Rd ⇢ kX(u + z) −yk2 2 + λ akuk2 2 + λ b −akzk2 (k) / . Furthermore, if (ˆu, ˆz) solves this problem then ˆw = ˆu + ˆz solves problem (6). The solution ˆw can therefore be interpreted as the superposition of a vector which has small `2 norm, and a vector which has small k-support norm, with the parameter a regulating these two components. Specifically, as a tends to zero, in order to prevent the objective from blowing up, ˆu must also tend to zero and we recover k-support norm regularization. Similarly, as a tends to b, ˆz vanishes and we have a simple ridge regression problem. 3.1 The Spectral k-Support Norm and the Spectral Box-Norm We now turn our focus to the matrix norms. For this purpose, we recall that a norm k · k on Rd⇥m is called orthogonally invariant if kWk = kUWV k, for any orthogonal matrices U 2 Rd⇥d and V 2 Rm⇥m. A classical result by von Neumann [10] establishes that a norm is orthogonally invariant if and only if it is of the form kWk = g(σ(W)), where σ(W) is the vector formed by the singular values of W in nonincreasing order, and g is a symmetric gauge function, that is a norm which is invariant under permutations and sign changes of the vector components. 3 Lemma 3.4. If ⇥is a convex bounded subset of the strictly positive orthant in Rd which is invariant under permutations, then k · k⇥is a symmetric gauge function. In particular, this readily applies to both the k-support norm and box-norm. We can therefore extend both norms to orthogonally invariant norms, which we term the spectral k-support norm and the spectral box-norm respectively, and which we write (with some abuse of notation) as kWk(k) = kσ(W)k(k) and kWk⇥= kσ(W)k⇥. We note that since the k-support norm subsumes the `1 and `2-norms for k = 1 and k = d respectively, the corresponding spectral k-support norms are equal to the trace and Frobenius norms respectively. We first characterize the unit ball of the spectral k-support norm. Proposition 3.5. The unit ball of the spectral k-support norm is the convex hull of the set of matrices of rank at most k and Frobenius norm no greater than one. Referring to the unit ball characterization of the k-support norm, we note that the restriction on the cardinality of the vectors whose convex hull defines the unit ball naturally extends to a restriction on the rank operator in the matrix setting. Furthermore, as noted in [6], regularization using the k-support norm encourages vectors to be sparse, but less so that the `1-norm. In matrix problems, as the extreme points of the unit ball have rank k, Proposition 3.5 suggests that the spectral k-support norm for k > 1 should encourage matrices to have low rank, but less so than the trace norm. 3.2 Cluster Norm We end this section by briefly discussing the cluster norm, which was introduced in [9] as a convex relaxation of a multitask clustering problem. The norm is defined, for every W 2 Rd⇥m, as kWkcl = r inf S2Sm tr(S−1W >W) (7) where Sm = {S 2 Rm⇥m, S ⌫0 : aI ⪯S ⪯bI, tr S = c}, and 0 < a b. In [9] the authors state that the cluster norm of W equals the box-norm of the vector formed by the singular values of W where c = (b−a)k +da. Here we provide a proof of this result. Denote by λi(·) the eigenvalues of a matrix which we write in nonincreasing order λ1(·) ≥λ2(·) ≥· · · ≥λd(·). Note that if ✓i are the eigenvalues of S then ✓i = λd−i+1(S−1). We have that tr(S−1W >W) = tr(S−1U⌃2U >) ≥ m X i=1 λd−i+1(S−1)λi(W >W) = d X i=1 σ2 i (W) ✓i where we have used the inequality [20, Sec. H.1.h] for S−1, W >W ⌫0. Since this inequality is attained whenever S = UDiag(✓)U, where U are the eigenvectors of W >W, we see that kWkcl = kσ(W)k⇥, that is, the cluster norm coincides with the spectral box-norm. In particular, we see that the spectral k-support norm is a special case of the cluster norm, where we let a tend to zero, b = 1 and c = k. Moreover, the methods to compute the norm and its proximity operator described in the following section can directly be applied to the cluster norm. As in the case of the vector norm (Proposition 3.3), the spectral box-norm or cluster norm can be written as a perturbation of spectral k-support norm with a quadratic term. Proposition 3.6. Let k · k⇥be a matrix box-norm with parameters a, b, c and let k = c−da b−a . Then kWk2 ⇥= min Z 1 akW −Zk2 F + 1 b −akZk2 (k). In other words, this result shows that the cluster norm can be seen as the Moreau envelope [11] of a spectral k-support norm. 4 Computing the Norms and their Proximity Operator In this section, we compute the norm and the proximity operator of the squared norm by explicitly solving the optimization problem in (3). We begin with the vector norm. 4 Theorem 4.1. For every w 2 Rd it holds that kwk2 ⇥= 1 b kwQk2 2 + 1 pkwIk2 1 + 1 akwLk2 2, (8) where wQ = (|w|# 1, . . . , |w|# q), wI = (|w|# q+1, . . . , |w|# d−`), wL = (|w|# d−`+1, . . . , |w|# d), and q and ` are the unique integers in {0, . . . , d} that satisfy q + ` d, |wq| b ≥1 p d−` X i=q+1 |wi| > |wq+1| b , |wd−`| a ≥1 p d−` X i=q+1 |wi| > |wd−`+1| a , (9) p = c −qb −`a and we have defined |w0| = 1 and |wd+1| = 0. Proof. (Sketch) We need to solve the optimization problem inf ✓ ⇢ d X i=1 w2 i ✓i : a ✓i b, d X i=1 ✓i c / . (10) We assume without loss of generality that the wi are ordered nonincreasing in absolute values, and it follows that at the optimum the ✓i are also ordered nonincreasing. We further assume that wi 6= 0 for all i and c db, so the sum constraint will be tight at the optimum. The Lagrangian is given by L(✓, ↵) = d X i=1 w2 i ✓i + 1 ↵2 d X i=1 ✓i −c ! where 1/↵2 is a strictly positive multiplier to be chosen such that S(↵) := Pd i=1 ✓i(↵) = c. We can then solve the original problem by minimizing the Lagrangian over the constraint ✓2 [a, b]d. Due to the decoupling effect of the multiplier we can solve the simplified problem componentwise, obtaining the solution ✓i = ✓i(↵) = min(b, max(a, ↵|wi|)) (11) where S(↵) = c. The minimizer has the form ✓= (b, . . . , b, ✓q+1, . . . , ✓d−`, a, . . . , a), where q, ` are determined by the value of ↵. From S(↵) = c we get ↵= p/(Pd−` i=q+1 |wi|). The value of the norm in (8) follows by substituting ✓into the objective. Finally, by construction we have ✓q ≥b > ✓q+1 and ✓d−` > a ≥✓d−`+1, which give rise to the conditions in (9). Theorem 4.1 suggests two methods for computing the box-norm. First we find ↵such that S(↵) = c; this value uniquely determines ✓in (11), and the norm follows by substitution into (10). Alternatively, we identify q and ` that jointly satisfy (9) and we compute the norm using (8). Taking advantage of the structure of ✓in the former method leads to a computation time that is O(d log d). Theorem 4.2. The computation of the box-norm can be completed in O(d log d) time. The k-support norm is a special case of the box-norm, and as a direct corollary of Theorem 4.1 and Theorem 4.2, we recover [6, Proposition 2.1]. 4.1 Proximity Operator Proximal gradient methods can be used to solve optimization problems of the form minw f(w) + λg(w), where f is a convex loss function with Lipschitz continuous gradient, λ > 0 is a regularization parameter, and g is a convex function for which the proximity operator can be computed efficiently, see [12, 21, 22] and references therein. The proximity operator of g with parameter ⇢> 0 is defined as prox⇢g(w) = argmin ⇢1 2kx −wk2 + ⇢g(x) : x 2 Rd / . We now use the infimum formulation of the box-norm to derive the proximity operator of the squared norm. 5 Algorithm 1 Computation of x = prox λ 2 k·k2 ⇥(w). Require: parameters a, b, c, λ. 1. Sort points 3 ↵i 2d i=1 = n a+λ |wj| , b+λ |wj| od j=1 such that ↵i ↵i+1; 2. Identify points ↵i and ↵i+1 such that S(↵i) c and S(↵i+1) ≥c by binary search; 3. Find ↵⇤between ↵i and ↵i+1 such that S(↵⇤) = c by linear interpolation; 4. Compute ✓i(↵⇤) for i = 1, . . . , d; 5. Return xi = ✓iwi ✓i+λ for i = 1, . . . , d. Theorem 4.3. The proximity operator of the square of the box-norm at point w 2 Rd with parameter λ 2 is given by prox λ 2 k·k2 ⇥(w) = ( ✓1w1 ✓1+λ, . . . , ✓dwd ✓d+λ), where ✓i = ✓i(↵) = min(b, max(a, ↵|wi| −λ)) (12) and ↵is chosen such that S(↵) := Pd i=1 ✓i(↵) = c. Furthermore, the computation of the proximity operator can be completed in O(d log d) time. The proof follows a similar reasoning to the proof of Theorem 4.1. Algorithm 1 illustrates the computation of the proximity operator for the squared box-norm in O(d log d) time. This includes the k-support as a special case, where we let a tend to zero, and set b = 1 and c = k, which improves upon the complexity of the O(d(k +log d)) computation provided in [6], and we illustrate the improvement empirically in Table 1. 4.2 Proximity Operator for Orthogonally Invariant Norms The computational considerations outlined above can be naturally extended to the matrix setting by using von Neumann’s trace inequality (see, e.g. [23]). Here we comment on the computation of the proximity operator, which is important for our numerical experiments in the following section. The proximity operator of an orthogonally invariant norm k · k = g(σ(·)) is given by proxk·k(W) = Udiag(proxg(σ(W)))V >, W 2 Rm⇥d, where U and V are the matrices formed by the left and right singular vectors of W (see e.g. [24, Prop 3.1]). Using this result we can employ proximal gradient methods to solve matrix regularization problems using the squared spectral k-support norm and spectral box-norm. 5 Numerical Experiments In this section, we report on the statistical performance of the spectral regularizers in matrix completion experiments. We also offer an interpretation of the role of the parameters in the box-norm and we empirically verify the improved performance of the proximity operator computation (see Table 1). We compare the trace norm (tr) [25], matrix elastic net (en) [26], spectral k-support (ks) and the spectral box-norm (box). The Frobenius norm, which is equal to the spectral k-support norm for k = d, performed considerably worse than the trace norm and we omit the results here. We report test error and standard deviation, matrix rank (r) and optimal parameter values for k and a, which were determined by validation, as were the regularization parameters. When comparing performance, we used a t-test to determine statistical significance at a level of p < 0.001. For the optimization we used an accelerated proximal gradient method (FISTA), see e.g. [12, 21, 22], with the percentage change in objective as convergence criterion, with a tolerance of 10−5 for the simulated datasets and 10−3 for the real datasets. As is typical with spectral regularizers we found that the spectrum of the learned matrix exhibited a rapid decay to zero. In order to explicitly impose a low rank on the solution we included a final step where we hard-threshold the singular values of the final matrix below a level determined by validation. We report on both sets of results below. 5.1 Simulated Data Matrix Completion. We applied the norms to matrix completion on noisy observations of low rank matrices. Each m ⇥m matrix was generated as W = AB> + E, where A, B 2 Rm⇥r, r ⌧m, and 6 Table 1: Comparison of proximity operator algorithms for the k-support norm (time in s), k = 0.05d. Algorithm 1 is the method in [6], Algorithm 2 is our method. d 1,000 2,000 4,000 8,000 16,000 32,000 Alg. 1 0.0443 0.1567 0.5907 2.3065 9.0080 35.6199 Alg. 2 0.0011 0.0016 0.0026 0.0046 0.0101 0.0181 2 4 6 8 10 0 0.01 0.02 0.03 a value SNR Figure 1: Impact of signal to noise on a. 2 4 6 8 10 1 2 3 4 5 k value true rank Figure 2: Impact of matrix rank on k. the entries of A, B and E are i.i.d. standard Gaussian. We set m = 100, r 2 {5, 10} and we sampled uniformly a percentage ⇢2 {10%, 20%, 30%} of the entries for training, and used a fixed 10% for validation. The error was measured as ktrue−predictedk2/ktruek2 [5] and averaged over 100 trials. The results are summarized in Table 2. In the thresholding case, all methods recovered the rank of the true noiseless matrix. The spectral box-norm generated the lowest test errors in all regimes, with the spectral k-support a close second, in particular in the thresholding case. This suggests that the non zero parameter a in the spectral box-norm counteracted the noise to some extent. Role of Parameters. In the same setting we investigated the role of the parameters in the boxnorm. As previously discussed, parameter b can be set to 1 without loss of generality. Figure 1 shows the optimal value of a chosen by validation for varying signal to noise ratios (SNR), keeping k fixed. We see that for greater noise levels (smaller SNR), the optimal value for a increases. While for a > 0, the recovered solutions are not sparse, as we show below this can still lead to improved performance in experiments, in particular in the presence of noise. Figure 2 shows the optimal value of k chosen by validation for matrices with increasing rank, keeping a fixed. We notice that as the rank of the matrix increases, the optimal k value increases, which is expected since it is an upper bound on the sum of the singular values. Table 2: Matrix completion on simulated data sets, without (left) and with (right) thresholding. dataset norm test error r k a rank 5 tr 0.8184 (0.03) 20 ⇢=10% en 0.8164 (0.03) 20 ks 0.8036 (0.03) 16 3.6 box 0.7805 (0.03) 87 2.9 1.7e-2 rank 5 tr 0.4085 (0.03) 23 ⇢=20% en 0.4081 (0.03) 23 ks 0.4031 (0.03) 21 3.1 box 0.3898 (0.03) 100 1.3 9e-3 rank 10 tr 0.6356 (0.03) 27 ⇢=20% en 0.6359 (0.03) 27 ks 0.6284 (0.03) 24 4.4 box 0.6243 (0.03) 89 1.8 9e-3 rank 10 tr 0.3642 (0.02) 36 ⇢=30% en 0.3638 (0.002 36 ks 0.3579 (0.02) 33 5.0 box 0.3486 (0.02) 100 2.5 9e-3 dataset norm test error r k a rank 5 tr 0.7799 (0.04) 5 ⇢=10% en 0.7794 (0.04) 5 ks 0.7728 (0.04) 5 4.23 box 0.7649 (0.04) 5 3.63 8.1e-3 rank 5 tr 0.3449 (0.02) 5 ⇢=20% en 0.3445 (0.02) 5 ks 0.3381 (0.02) 5 2.97 box 0.3380 (0.02) 5 3.28 1.9e-3 rank 10 tr 0.6084 (0.03) 10 ⇢=20% en 0.6074 (0.03) 10 ks 0.6000 (0.03) 10 5.02 box 0.6000 (0.03) 10 5.22 1.9e-3 rank 10 tr 0.3086 (0.02) 10 ⇢=30% en 0.3082 (0.02) 10 ks 0.3025 (0.02) 10 5.13 box 0.3025 (0.02) 10 5.16 3e-4 7 Table 3: Matrix completion on real data sets, without (left) and with (right) thresholding. dataset norm test error r k a MovieLens tr 0.2034 87 100k en 0.2034 87 ⇢= 50% ks 0.2031 102 1.00 box 0.2035 943 1.00 1e-5 MovieLens tr 0.1821 325 1M en 0.1821 319 ⇢= 50% ks 0.1820 317 1.00 box 0.1817 3576 1.09 3e-5 Jester 1 tr 0.1787 98 20 per line en 0.1787 98 ks 0.1764 84 5.00 box 0.1766 100 4.00 1e-6 Jester 3 tr 0.1988 49 8 per line en 0.1988 49 ks 0.1970 46 3.70 box 0.1973 100 5.91 1e-3 dataset norm test error r k a MovieLens tr 0.2017 13 100k en 0.2017 13 ⇢= 50% ks 0.1990 9 1.87 box 0.1989 10 2.00 1e-5 MovieLens tr 0.1790 17 1M en 0.1789 17 ⇢= 50% ks 0.1782 17 1.80 box 0.1777 19 2.00 1e-6 Jester 1 tr 0.1752 11 20 per line en 0.1752 11 ks 0.1739 11 6.38 box 0.1726 11 6.40 2e-5 Jester 3 tr 0.1959 3 8 per line en 0.1959 3 ks 0.1942 3 2.13 box 0.1940 3 4.00 8e-4 5.2 Real Data Matrix Completion (MovieLens and Jester). In this section we report on matrix completion on real data sets. We observe a percentage of the (user, rating) entries of a matrix and the task is to predict the unobserved ratings, with the assumption that the true matrix has low rank. The datasets we considered were MovieLens 100k and MovieLens 1M (http://grouplens.org/datasets/movielens/), which consist of user ratings of movies, and Jester 1 and Jester 3 (http://goldberg.berkeley.edu/jesterdata/), which consist of users and ratings of jokes (Jester 2 showed essentially identical performance to Jester 1). Following [4], for MovieLens we uniformly sampled ⇢= 50% of the available entries for each user for training, and for Jester 1 and Jester 3 we sampled 20, respectively 8, ratings per user, and we used 10% for validation. The error was measured as normalized mean absolute error, ktrue−predictedk2 #observations/(rmax−rmin), where rmin and rmax are lower and upper bounds for the ratings [4]. The results are outlined in Table 3. In the thresholding case, the spectral box and k-support norms had the best performance. In the absence of thresholding, the spectral k-support showed slightly better performance. Comparing to the synthetic data sets, this suggests that in the absence of noise the parameter a did not provide any benefit. We note that in the absence of thresholding our results for the trace norm on MovieLens 100k agreed with those in [3]. 6 Conclusion We showed that the k-support norm belongs to the family of box-norms and noted that these can be naturally extended from the vector to the matrix setting. We also provided a connection between the k-support norm and the cluster norm, which essentially coincides with the spectral box-norm. We further observed that the cluster norm is a perturbation of the spectral k-support norm, and we were able to compute the norm and its proximity operator. Our experiments indicate that the spectral box-norm and k-support norm consistently outperform the trace norm and the matrix elastic net on various matrix completion problems. With a single parameter to validate, compared to two for the spectral box-norm, our results suggest that the spectral k-support norm is a powerful alternative to the trace norm and the elastic net, which has the same number of parameters. In future work, we would like to study the application of the norms to clustering problems in multitask learning [9], in particular the impact of centering. It would also be valuable to derive statistical inequalities and Rademacher complexities for these norms. Acknowledgements We would like to thank Andreas Maurer, Charles Micchelli and especially Andreas Argyriou for useful discussions. Part of this work was supported by EPSRC Grant EP/H027203/1. 8 References [1] N. Srebro, J. D. M. Rennie, and T. S. Jaakkola. Maximum-margin matrix factorization. Advances in Neural Information Processing Systems 17, 2005. [2] J. Abernethy, F. Bach, T. Evgeniou, and J.-P. Vert. A new approach to collaborative filtering: Operator estimation with spectral regularization. Journal of Machine Learning Research, Vol. 10:803–826, 2009. [3] M Jaggi and M. Sulovsky. A simple algorithm for nuclear norm regularized problems. Proceedings of the 27th International Conference on Machine Learning, 2010. [4] K.-C. Toh and S. Yun. An accelerated proximal gradient algorithm for nuclear norm regularized least squares problems. SIAM Journal on Imaging Sciences, 4:573–596, 2011. [5] R. Mazumder, T. Hastie, and R. Tibshirani. Spectral regularization algorithms for learning large incomplete matrices. Journal of Machine Learning Research, 11:2287–2322, 2010. [6] A. Argyriou, R. Foygel, and N. Srebro. Sparse prediction with the k-support norm. In Advances in Neural Information Processing Systems 25, pages 1466–1474, 2012. [7] R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society, Vol. 58:267–288, 1996. [8] H. Zou and T. Hastie. Regularization and variable selection via the elastic net. Journal of the Royal Statistical Society, Series B, 67(2):301–320, 2005. [9] L. Jacob, F. Bach, and J.-P. Vert. Clustered multi-task learning: a convex formulation. Advances in Neural Information Processing Systems (NIPS 21), 2009. [10] J. Von Neumann. Some matrix-inequalities and metrization of matric-space. Tomsk. Univ. Rev. Vol I, 1937. [11] R. T. Rockafellar. Convex Analysis. Princeton University Press, 1970. [12] Y. Nesterov. Gradient methods for minimizing composite objective function. Center for Operations Research and Econometrics, 76, 2007. [13] L. Jacob, G. Obozinski, and J.-P. Vert. Group lasso with overlap and graph lasso. Proc of the 26th Int. Conf. on Machine Learning, 2009. [14] Y. Grandvalet. Least absolute shrinkage is equivalent to quadratic penalization. In ICANN 98, pages 201–206. Springer London, 1998. [15] C. A. Micchelli and M. Pontil. Learning the kernel function via regularization. Journal of Machine Learning Research, 6:1099–1125, 2005. [16] M. Szafranski, Y. Grandvalet, and P. Morizet-Mahoudeaux. Hierarchical penalization. In Advances in Neural Information Processing Systems 21, 2007. [17] C. A. Micchelli, J. M. Morales, and M. Pontil. Regularizers for structured sparsity. Advances in Comp. Mathematics, 38:455–489, 2013. [18] A. Maurer and M. Pontil. Structured sparsity and generalization. The Journal of Machine Learning Research, 13:671–690, 2012. [19] G. Obozinski and F. Bach. Convex relaxation for combinatorial penalties. CoRR, 2012. [20] A. W. Marshall and I. Olkin. Inequalities: Theory of Majorization and its Applications. Academic Press, 1979. [21] P. L. Combettes and J.-C. Pesquet. Proximal splitting methods in signal processing. In Fixed-Point Algorithms for Inv Prob. Springer, 2011. [22] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM J. Imaging Sciences, 2(1):183–202, 2009. [23] A. S. Lewis. The convex analysis of unitarily invariant matrix functions. Journal of Convex Analysis, 2:173–183, 1995. [24] A. Argyriou, C. A. Micchelli, M. Pontil, L. Shen, and Y. Xu. Efficient first order methods for linear composite regularizers. CoRR, abs/1104.1436, 2011. [25] J.-F. Cai, E. J. Candes, and Z. Shen. A singular value thresholding algorithm for matrix completion. SIAM Journal on Optimization, 20(4):1956–1982, 2008. [26] H. Li, N. Chen, and L. Li. Error analysis for matrix elastic-net regularization algorithms. IEEE Transactions on Neural Networks and Learning Systems, 23-5:737–748, 2012. [27] W. Rudin. Functional Analysis. McGraw Hill, 1991. [28] D. P. Bertsekas, A. Nedic, and A. E. Ozdaglar. Convex Analysis and Optimization. Athena Scientific, 2003. [29] R. A. Horn and C. R. Johnson. Topics in Matrix Analysis. Cambridge University Press, 1991. 9
2014
330
5,437
Learning Optimal Commitment to Overcome Insecurity Avrim Blum Carnegie Mellon University avrim@cs.cmu.edu Nika Haghtalab Carnegie Mellon University nika@cmu.edu Ariel D. Procaccia Carnegie Mellon University arielpro@cs.cmu.edu Abstract Game-theoretic algorithms for physical security have made an impressive realworld impact. These algorithms compute an optimal strategy for the defender to commit to in a Stackelberg game, where the attacker observes the defender’s strategy and best-responds. In order to build the game model, though, the payoffs of potential attackers for various outcomes must be estimated; inaccurate estimates can lead to significant inefficiencies. We design an algorithm that optimizes the defender’s strategy with no prior information, by observing the attacker’s responses to randomized deployments of resources and learning his priorities. In contrast to previous work, our algorithm requires a number of queries that is polynomial in the representation of the game. 1 Introduction The US Coast Guard, the Federal Air Marshal Service, the Los Angeles Airport Police, and other major security agencies are currently using game-theoretic algorithms, developed in the last decade, to deploy their resources on a regular basis [13]. This is perhaps the biggest practical success story of computational game theory — and it is based on a very simple idea. The interaction between the defender and a potential attacker can be modeled as a Stackelberg game, in which the defender commits to a (possibly randomized) deployment of his resources, and the attacker responds in a way that maximizes his own payoff. The algorithmic challenge is to compute an optimal defender strategy — one that would maximize the defender’s payoff under the attacker’s best response. While the foregoing model is elegant, implementing it requires a significant amount of information. Perhaps the most troubling assumption is that we can determine the attacker’s payoffs for different outcomes. In deployed applications, these payoffs are estimated using expert analysis and historical data — but an inaccurate estimate can lead to significant inefficiencies. The uncertainty about the attacker’s payoffs can be encoded into the optimization problem itself, either through robust optimization techniques [12], or by representing payoffs as continuous distributions [5]. Letchford et al. [8] take a different, learning-theoretic approach to dealing with uncertain attacker payoffs. Studying Stackelberg games more broadly (which are played by two players, a leader and a follower), they show that the leader can efficiently learn the follower’s payoffs by iteratively committing to different strategies, and observing the attacker’s sequence of responses. In the context of security games, this approach may be questionable when the attacker is a terrorist, but it is a perfectly reasonable way to calibrate the defender’s strategy for routine security operations when the attacker is, say, a smuggler. And the learning-theoretic approach has two major advantages over modifying the defender’s optimization problem. First, the learning-theoretic approach requires no prior information. Second, the optimization-based approach deals with uncertainty by inevitably degrading the quality of the solution, as, intuitively, the algorithm has to simultaneously optimize against a range of possible attackers; this problem is circumvented by the learning-theoretic approach. But let us revisit what we mean by “efficiently learn”. The number of queries (i.e., observations of follower responses to leader strategies) required by the algorithm of Letchford et al. [8] is polynomial in the number of pure leader strategies. The main difficulty in applying their results to Stackelberg 1 security games is that even in the simplest security game, the number of pure defender strategies is exponential in the representation of the game. For example, if each of the defender’s resources can protect one of two potential targets, there is an exponential number of ways in which resources can be assigned to targets. 1 Our approach and results. We design an algorithm that learns an (additively) ϵ-optimal strategy for the defender with probability 1 −δ, by asking a number of queries that is polynomial in the representation of the security game, and logarithmic in 1/ϵ and 1/δ. Our algorithm is completely different from that of Letchford et al. [8]. Its novel ingredients include: • We work in the space of feasible coverage probability vectors, i.e., we directly reason about the probability that each potential target is protected under a randomized defender strategy. Denoting the number of targets by n, this is an n-dimensional space. In contrast, Letchford et al. [8] study the exponential-dimensional space of randomized defender strategies. We observe that, in the space of feasible coverage probability vectors, the region associated with a specific best response for the attacker (i.e., a specific target being attacked) is convex. • To optimize within each of these convex regions, we leverage techniques — developed by Tauman Kalai and Vempala [14] — for optimizing a linear objective function in an unknown convex region using only membership queries. In our setting, it is straightforward to build a membership oracle, but it is quite nontrivial to satisfy a key assumption of the foregoing result: that the optimization process starts from an interior point of the convex region. We do this by constructing a hierarchy of nested convex regions, and using smaller regions to obtain interior points in larger regions. • We develop a method for efficiently discovering new regions. In contrast, Letchford et al. [8] find regions (in the high-dimensional space of randomized defender strategies) by sampling uniformly at random; their approach is inefficient when some regions are small. 2 Preliminaries A Stackelberg security game is a two-player general-sum game between a defender (or the leader) and an attacker (or the follower). In this game, the defender commits to a randomized allocation of his security resources to defend potential targets. The attacker, in turn, observes this randomized allocation and attacks the target with the best expected payoff. The defender and the attacker receive payoffs that depend on the target that was attacked and whether or not it was defended. The defender’s goal is to choose an allocation that leads to the best payoff. More precisely, a security game is defined by a 5-tuple (T, D, R, A, U): • T = {1, . . . , n} is a set of n targets. • R is a set of resources. • D ⊆2T is a collection of subsets of targets, each called a schedule, such that for every schedule D ∈D, targets in D can be simultaneously defended by one resource. It is natural to assume that if a resource is capable of covering schedule D, then it can also cover any subset of D. We call this property closure under the subset operation; it is also known as “subsets of schedules are schedules (SSAS)” [7]. • A : R →2D, called the assignment function, takes a resource as input and returns the set of all schedules that the resource is capable of defending. An allocation of resources is valid if every resource r is allocated to a schedule in A(r). • The payoffs of the players are given by functions Ud(t, pt) and Ua(t, pt), which return the expected payoffs of the defender and the attacker, respectively, when target t is attacked and it is covered with probability pt (as formally explained below). We make two assumptions that are common to all papers on security games. First, these utility functions are linear. Second, the attacker prefers it if the attacked target is not covered, and the defender prefers 1Subsequent work by Marecki et al. [9] focuses on exploiting revealed information during the learning process — via Monte Carlo Tree Search — to optimize total leader payoff. While their method provably converges to the optimal leader strategy, no theoretical bounds on the rate of convergence are known. 2 it if the attacked target is covered, i.e., Ud(t, pt) and Ua(t, pt) are respectively increasing and decreasing in pt. We also assume w.l.o.g. that the utilities are normalized to have values in [−1, 1]. If the utility functions have coefficients that are rational with denominator at most a, then the game’s (utility) representation length is L = n log n + n log a. A pure strategy of the defender is a valid assignment of resources to schedules. The set of pure strategies is determined by T, D, R, and A. Let there be m pure strategies; we use the following n × m, zero-one matrix M to represent the set of all pure strategies. Every row in M represents a target and every column represents a pure strategy. Mti = 1 if and only if target t is covered using some resource in the ith pure strategy. A mixed strategy (hereinafter, called strategy) is a distribution over the pure strategies. To represent a strategy we use a 1 × m vector s, such that si is the probability with which the ith strategy is played, and Pm i=1 si = 1. Given a defender’s strategy, the coverage probability of a target is the probability with which it is defended. Let s be a defender’s strategy, then the coverage probability vector is pT = MsT , where pt is coverage probability of target t. We call a probability vector implementable if there exists a strategy that imposes that coverage probability on the targets. Let ps be the corresponding coverage probability vector of strategy s. The attacker’s best response to s is defined by b(s) = arg maxt Ua(t, ps t). Since the attacker’s best-response is determined by the coverage probability vector irrespective of the strategy, we slightly abuse notation by using b(ps) to denote the best-response, as well. We say that target t is “better” than t′ for the defender if the highest payoff he receives when t is attacked is more than the highest payoff he receives when t′ is attacked. We assume that if multiple targets are tied for the best-response, then ties are broken in favor of the “best” target. The defender’s optimal strategy is defined as the strategy with highest expected payoff for the defender, i.e. arg maxs Ud(b(s), ps b(s)). An optimal strategy p is called conservative if no other optimal strategy has a strictly lower sum of coverage probabilities. For two coverage probability vectors we use q ⪯p to denote that for all t, qt ≤pt. 3 Problem Formulation and Technical Approach In this section, we give an overview of our approach for learning the defender’s optimal strategy when Ua is not known. To do so, we first review how the optimal strategy is computed in the case where Ua is known. Computing the defender’s optimal strategy, even when Ua(·) is known, is NP-Hard [6]. In practice the optimal strategy is computed using two formulations: Mixed Integer programming [11] and Multiple Linear Programs [1]; the latter provides some insight for our approach. The Multiple LP approach creates a separate LP for every t ∈T. This LP, as shown below, solves for the optimal defender strategy under the restriction that the strategy is valid (second and third constraints) and the attacker best-responds by attacking t (first constraint). Among these solutions, the optimal strategy is the one where the defender has the highest payoff. maximize Ud(t, X i:Mti=1 si) s.t. ∀t′ ̸= t, Ua(t′, X i:Mt′i=1 si) ≤Ua(t, X i:Mti=1 si) ∀i, si ≥0 n X i=1 si = 1 We make two changes to the above LP in preparation for finding the optimal strategy in polynomially many queries, when Ua is unknown. First, notice that when Ua is unknown, we do not have an explicit definition of the first constraint. However, implicitly we can determine whether t has a better payoff than t′ by observing the attacker’s best-response to s. Second, the above LP has exponentially 3 many variables, one for each pure strategy. However, given the coverage probabilities, the attacker’s actions are independent of the strategy that induces that coverage probability. So, we can restate the LP to use variables that represent the coverage probabilities and add a constraint that enforces the coverage probabilities to be implementable. maximize Ud(t, pt) s.t. t is attacked p is implementable (1) This formulation requires optimizing a linear function over a region of the space of coverage probabilities, by using membership queries. We do so by examining some of the characteristics of the above formulation and then leveraging an algorithm introduced by Tauman Kalai and Vempala [14] that optimizes over a convex set, using only an initial point and a membership oracle. Here, we restate their result in a slightly different form. Theorem 2.1 [14, restated]. For any convex set H ⊆Rn that is contained in a ball of radius R, given a membership oracle, an initial point with margin r in H, and a linear function ℓ(·), with probability 1 −δ we can find an ϵ-approximate optimal solution for ℓin H, using O(n4.5 log nR2 rϵδ ) queries to the oracle. 4 Main Result In this section, we design and analyze an algorithm that (ϵ, δ)-learns the defender’s optimal strategy in a number of best-response queries that is polynomial in the number of targets and the representation, and logarithmic in 1 ϵ and 1 δ . Our main result is: Theorem 1. Consider a security game with n targets and representation length L, such that for every target, the set of implementable coverage probability vectors that induce an attack on that target, if non-empty, contains a ball of radius 1/2L. For any ϵ, δ > 0, with probability 1 −δ, Algorithm 2 finds a defender strategy that is optimal up to an additive term of ϵ, using O(n6.5(log n ϵδ + L)) best-response queries to the attacker. The main assumption in Theorem 1 is that the set of implementable coverage probabilities for which a given target is attacked is either empty or contains a ball of radius 1/2L. This implies that if it is possible to make the attacker prefer a target, then it is possible to do so with a small margin. This assumption is very mild in nature and its variations have appeared in many well-known algorithms. For example, interior point methods for linear optimization require an initial feasible solution that is within the region of optimization with a small margin [4]. Letchford et al. [8] make a similar assumption, but their result depends linearly, instead of logarithmically, on the minimum volume of a region (because they use uniformly random sampling to discover regions). To informally see why such an assumption is necessary, consider a security game with n targets, such that an attack on any target but target 1 is very harmful to the defender. The defender’s goal is therefore to convince the attacker to attack target 1. The attacker, however, only attacks target 1 under a very specific coverage probability vector, i.e., the defender’s randomized strategy has to be just so. In this case, the defender’s optimal strategy is impossible to approximate. The remainder of this section is devoted to proving Theorem 1. We divide our intermediate results into sections based on the aspect of the problem that they address. The proofs of most lemmas are relegated to the appendix; here we mainly aim to provide the structure of the theorem’s overall proof. 4.1 Characteristics of the Optimization Region One of the requirements of Theorem 2.1 is that the optimization region is convex. Let P denote the space of implementable probability vectors, and let Pt = {p : p is implementable and b(p) = t}. The next lemma shows that Pt is indeed convex. Lemma 1. For all t ∈T, Pt is the intersection of a finitely many half-spaces. Proof. Pt is defined by the set of all p ∈[0, 1]n such that there is s that satisfies the LP with the following constraints. There are m half-spaces of the form si ≥0, 2 half-spaces P i si ≤1 and 4 P i si ≥1, 2n half-spaces of the form Ms T −p T ≤0 and Ms T −p T ≥0, and n −1 halfspaces of the form Ua(t, pt) −Ua(t′, pt′) ≥0. Therefore, the set of (s, p) ∈Rm+n such that p is implemented by strategy s and causes an attack on t is the intersection of 3n+m+1 half-spaces. Pt is the reflection of this set on n dimensions; therefore, it is also the intersection of at most 3n+m+1 half-spaces. Lemma 1, in particular, implies that Pt is convex. The Lemma’s proof also suggests a method for finding the minimal half-space representation of P. Indeed, the set S = {(s, p) ∈Rm+n : Valid strategy s implements p} is given by its half-space representation. Using the Double Description Method [2, 10], we can compute the vertex representation of S. Since, P is a linear transformation of S, its vertex representation is the transformation of the vertex representation of S. Using the Double Description Method again, we can find the minimal half-space representation of P. Next, we establish some properties of P and the half-spaces that define it. The proofs of the following two lemmas appear in Appendices A.1 and A.2, respectively. Lemma 2. Let p ∈P. Then for any 0 ⪯q ⪯p, q ∈P. Lemma 3. Let A be a set of a positive volume that is the intersection of finitely many half-spaces. Then the following two statements are equivalent. 1. For all p ∈A, p ⪰ϵ. And for all ϵ ⪯q ⪯p, q ∈A. 2. A can be defined as the intersection of ei · p ≥ϵ for all i, and a set H of half-spaces, such that for any h · p ≥b in H, h ⪯0, and b ≤−ϵ. Using Lemmas 2 and 3, we can refer to the set of half-spaces that define P by {(ei, 0) : for all i} ∪ HP, where for all (h∗, b∗) ∈HP, h∗⪯0, and b∗≤0. 4.2 Finding Initial Points An important requirement for many optimization algorithms, including the one developed by Tauman Kalai and Vempala [14], is having a “well-centered” initial feasible point in the region of optimization. There are two challenges involved in discovering an initial feasible point in the interior of every region. First, establishing that a region is non-empty, possibly by finding a boundary point. Second, obtaining a point that has a significant margin from the boundary. We carry out these tasks by executing the optimization in a hierarchy of sets where at each level the optimization task only considers a subset of the targets and the feasibility space. We then show that optimization in one level of this hierarchy helps us find initial points in new regions that are well-centered in higher levels of the hierarchy. To this end, let us define restricted regions. These regions are obtained by first perturbing the defining half-spaces of P so that they conform to a given representation length, and then trimming the boundaries by a given width (See Figure 1). In the remainder of this paper, we use γ = 1 (n+1)2L+1 to denote the accuracy of the representation and the width of the trimming procedure for obtaining restricted regions. More precisely: Definition 1 (restricted regions). The set Rk ∈Rn is defined by the intersection the following halfspaces: For all i, (ei, kγ). For all (h∗, b∗) ∈HP, a half-space (h, b + kγ), such that h = γ⌊1 γ h∗⌋ and b = γ⌈1 γ b∗⌉. Furthermore, for every t ∈T, define Rk t = Rk ∩Pt. The next Lemma, whose proof appears in Appendix A.3, shows that the restricted regions are subsets of the feasibility space, so, we can make best-response queries within them. Lemma 4. For any k ≥0, Rk ⊆P. The next two lemmas, whose proofs are relegated to Appendices A.4 and A.5, show that in Rk one can reduce each coverage probability individually down to kγ, and the optimal conservative strategy in Rk indeed reduces the coverage probabilities of all targets outside the best-response set to kγ. Lemma 5. Let p ∈Rk, and let q such that kγ ⪯q ⪯p. Then q ∈Rk. Lemma 6. Let s and its corresponding coverage probability p be a conservative optimal strategy in Rk. Let t∗= b(s) and B = {t : Ua(t, pt) = Ua(t∗, pt∗)}. Then for any t /∈B, pt = kγ. 5 Target Attacker Defender 1 0.5(1 −p1) −0.5(1 −p1) 2 (1 −p2) −(1 −p2) (a) Utilities of the game 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 p1 p2 Optimal strategy R2 2 R1 2 P2 R2 1 R1 1 P1 p1 + p2 <= 1 0.5(1−p1) = 1−p2 Attack on Target 1 Attack on Target 2 Utility Halfspace Feasibility Halfspaces Optimal Strategy (b) Regions Figure 1: A security game with one resource that can cover one of two targets. The attacker receives utility 0.5 from attacking target 1 and utility 1 from attacking target 2, when they are not defended; he receives 0 utility from attacking a target that is being defended. The defender’s utility is the zero-sum complement. The following Lemma, whose proof appears in Appendix A.6 shows that if every non-empty Pt contains a large enough ball, then Rn t ̸= ∅. Lemma 7. For any t and k ≤n such that Pt contains a ball of radius r > 1 2L , Rk t ̸= ∅. The next lemma provides the main insight behind our search for the region with the highestpaying optimal strategy. It implies that we can restrict our search to strategies that are optimal for a subset of targets in Rk, if the attacker also agrees to play within that subset of targets. At any point, if the attacker chooses a target outside the known regions, he is providing us with a point in a new region. Crucially, Lemma 8 requires that we optimize exactly inside each restricted region, and we show below (Algorithm 1 and Lemma 11) that this is indeed possible. Lemma 8. Assume that for every t, if Pt is non-empty, then it contains a ball of radius 1 2L . Given K ⊆T and k ≤n, let p ∈Rk be the coverage probability of the strategy that has kγ probability mass on targets in T \ K and is optimal if the attacker were to be restricted to attacking targets in K. Let p∗be the optimal strategy in P. If b(p) ∈K then b(p∗) ∈K. Proof. Assume on the contrary that b(p∗) = t∗/∈K. Since Pt∗̸= ∅, by Lemma 7, there exists p′ ∈Rk t∗. For ease of exposition, replace p with its corresponding conservative strategy in Rk. Let B be the set of targets that are tied for the attacker’s best-response in p, i.e. B = arg maxt∈T Ua(t, pt). Since b(p) ∈K and ties are broken in favor of the “best” target, i.e. t∗, it must be that t∗/∈B. Then, for any t ∈B, Ua(t, pt) > Ua(t∗, kγ) ≥Ua(t∗, p′ t∗) ≥Ua(t, p′ t). Since Ua is decreasing in the coverage probability, for all t ∈B, p′ t > pt. Note that there is a positive gap between the attacker’s payoff for attacking a best-response target versus another target, i.e. ∆= mint′∈K\B,t∈B Ua(t, pt) −Ua(t′, pt′) > 0, so it is possible to increase pt by a small amount without changing the best response. More precisely, since Ua is continuous and decreasing in the coverage probability, for every t ∈B, there exists δ < p′ t −pt such that for all t′ ∈K \ B, Ua(t′, pt′) < Ua(t, p′ t −δ) < Ua(t, pt). Let q be such that for t ∈B, qt = p′ t −δ and for t /∈B, qt = pt = kγ (by Lemma 6 and the fact that p was replaced by its conservative equivalent). By Lemma 5, q ∈Rk. Since for all t ∈B and t′ ∈K \ B, Ua(t, qt) > Ua(t′, qt′), b(q) ∈B. Moreover, because Ud is increasing in the coverage probability for all t ∈B, Ud(t, qt) > Ud(t, pt). So, q has higher payoff for the defender when the attacker is restricted to attacking K. This contradicts the optimality of p in Rk. Therefore, b(p∗) ∈K. If the attacker attacks a target t outside the set of targets K whose regions we have already discovered, we can use the new feasible point in Rk t to obtain a well-centered point in Rk−1 t , as the next lemma formally states. Lemma 9. For any k and t, let p be any strategy in Rk t . Define q such that qt = pt −γ 2 and for all i ̸= t, qi = pi + γ 4√n. Then, q ∈Rk−1 t and q has distance γ 2n from the boundaries of Rk−1 t . The lemma’s proof is relegated to Appendix A.7. 6 4.3 An Oracle for the Convex Region We use a three-step procedure for defining a membership oracle for P or Rk t . Given a vector p, we first use the half-space representation of P (or Rk) described in Section 4.1 to determine whether p ∈P (or p ∈Rk). We then find a strategy s that implements p by solving a linear system with constraints MsT = pT , 0 ⪯s, and ∥s∥1 = 1. Lastly, we make a best-response query to the attacker for strategy s. If the attacker responds by attacking t, then p ∈Pt (or p ∈Rk t ), else p /∈Pt (or p /∈Rk t ). 4.4 The Algorithms In this section, we define algorithms that use the results from previous sections to prove Theorem 1. First, we define Algorithm 1, which receives an approximately optimal strategy in Rk t as input, and finds the optimal strategy in Rk t . As noted above, obtaining exact optimal solutions in Rk t is required in order to apply Lemma 8, thereby ensuring that we discover new regions when lucrative undiscovered regions still exist. Algorithm 1 LATTICE-ROUNDING (approximately optimal strategy p) 1. For all i ̸= t, make best-response queries to binary search for the smallest p′ i ∈[kγ, pi] up to accuracy 1 25n(L+1) , such that t = b(p′), where for all j ̸= i, p′ j ←pj. 2. For all i, set ri and qi respectively to the smallest and second smallest rational numbers with denominator at most 22n(L+1), that are larger than p′ i − 1 25n(L+1) . 3. Define p∗such that p∗ t is the unique rational number with denominator at most 22n(L+1) in [pt, pt + 1 24n(L+1) ). (Refer to the proof for uniqueness), and for all i ̸= t, p∗ i ←ri. 4. Query j ←b(p∗). 5. If j ̸= t, let p∗ j ←qi. Go to step 4 6. Return p∗. The next two Lemmas, whose proofs appear in Appendices A.8 and A.9, establish the guarantees of Algorithm 1. The first is a variation of a well-known result in linear programming [3] that is adapted specifically for our problem setting. Lemma 10. Let p∗be a basic optimal strategy in Rk t , then for all i, p∗ i is a rational number with denominator at most 22n(L+1). Lemma 11. For any k and t, let p be a 1 26n(L+1) -approximate optimal strategy in Rk t . Algorithm 1 finds the optimal strategy in Rk t in O(nL) best-response queries. At last, we are ready to prove our main result, which provides guarantees for Algorithm 2, given below. Theorem 1 (restated). Consider a security game with n targets and representation length L, such that for every target, the set of implementable coverage probability vectors that induce an attack on that target, if non-empty, contains a ball of radius 1/2L. For any ϵ, δ > 0, with probability 1 −δ, Algorithm 2 finds a defender strategy that is optimal up to an additive term of ϵ, using O(n6.5(log n ϵδ + L)) best-response queries to the attacker. Proof Sketch. For each K ⊆T and k, the loop at step 5 of Algorithm 2 finds the optimal strategy if the attacker was restricted to attacking targets of K in Rk. Every time the IF clause at step 5a is satisfied, the algorithm expands the set K by a target t′ and adds xt′ to the set of initial points X, which is an interior point of Rk−1 t′ (by Lemma 9). Then the algorithm restarts the loop at step 5. Therefore every time the loop at step 5 is started, X is a set of initial points in K that have margin γ 2n in Rk. This loop is restarted at most n −1 times. We reach step 6 only when the best-response to the optimal strategy that only considers targets of K is in K. By Lemma 8, the optimal strategy is in Pt for some t ∈K. By applying Theorem 2.1 to K, 7 Algorithm 2 OPTIMIZE (accuracy ϵ, confidence δ) 1. γ ← 1 (n+1)2L+1 , δ′ ← δ n2 , and k ←n. 2. Use R, D, and A to compute oracles (half-spaces) for P, R0, . . . , Rn. 3. Query t ←b(kγ) 4. K ←{t}, X ←{x t}, where xt t = kγ −γ/2 and for i ̸= t, xt i = kγ + γ 4√n. 5. For t ∈K, (a) If during steps 5b to 5e a target t′ /∈K is attacked as a response to some strategy p: i. Let xt′ t′ ←pt′ −γ/2 and for i ̸= t′, xt′ i ←pi + γ 4√n. ii. X ←X ∪{xt′}, K ←K ∪{t′}, and k ←k −1. iii. Restart the loop at step 5. (b) Use Theorem 2.1 with set of targets K. With probability 1 −δ′ find a qt that is a 1 26n(L+1) -approximate optimal strategy restricted to set K. (c) Use the Lattice Rounding on qt to find qt∗, that is the optimal strategy in Rk t restricted to K. (d) For all t′ /∈K, qt∗ t′ ←kγ. (e) Query qt∗. 6. For all t ∈K, use Theorem 2.1 to find pt∗that is an ϵ-approximate strategy with probability 1 −δ′, in Pt. 7. Return pt∗that has the highest payoff to the defender. with an oracle for P using the initial set of point X which has γ/2n margin in R0, we can find the ϵ-optimal strategy with probability 1−δ′. There are at most n2 applications of Theorem 2.1 and each succeeds with probability 1−δ′, so our overall procedure succeeds with probability 1−n2δ′ ≥1−δ. Regarding the number of queries, every time the loop at step 5 is restarted |K| increases by 1. So, this loop is restarted at most n −1 times. In a successful run of the loop for set K, the loop makes |K| calls to the algorithm of Theorem 2.1 to find a 1 26n(L+1) -approximate optimal solution. In each call, X has initial points with margin γ 2n, and furthermore, the total feasibility space is bounded by a sphere of radius √n (because of probability vectors), so each call makes O(n4.5(log n δ + L)) queries. The last call looks for an ϵ-approximate solution, and will take another O(n4.5(log n ϵδ +L)) queries. In addition, our the algorithm makes n2 calls to Algorithm 1 for a total of O(n3L) queries. In conclusion, our procedure makes a total of O(n6.5(log n ϵδ +L)) = poly(n, L, log 1 ϵδ) queries. 5 Discussion Our main result focuses on the query complexity of our problem. We believe that, indeed, best response queries are our most scarce resource, and it is therefore encouraging that an (almost) optimal strategy can be learned with a polynomial number of queries. It is worth noting, though, that some steps in our algorithm are computationally inefficient. Specifically, our membership oracle needs to determine whether a given coverage probability vector is implementable. We also need to explicitly compute the feasibility half-spaces that define P. Informally speaking, (worst-case) computational inefficiency is inevitable, because computing an optimal strategy to commit to is computationally hard even in simple security games [6]. Nevertheless, deployed security games algorithms build on integer programming techniques to achieve satisfactory runtime performance in practice [13]. While beyond the reach of theoretical analysis, a synthesis of these techniques with ours can yield truly practical learning algorithms for dealing with payoff uncertainty in security games. Acknowledgments. This material is based upon work supported by the National Science Foundation under grants CCF-1116892, CCF-1101215, CCF-1215883, and IIS-1350598. 8 References [1] V. Conitzer and T. Sandholm. Computing the optimal strategy to commit to. In Proceedings of the 7th ACM Conference on Electronic Commerce (EC), pages 82–90, 2006. [2] K. Fukuda and A. Prodon. Double description method revisited. In Combinatorics and computer science, pages 91–111. Springer, 1996. [3] P. G´acs and L. Lov´asz. Khachiyan’s algorithm for linear programming. Mathematical Programming Studies, 14:61–68, 1981. [4] M. Gr¨otschel, L. Lov´asz, and A. Schrijver. Geometric Algorithms and Combinatorial Optimization. Springer, 2nd edition, 1993. [5] C. Kiekintveld, J. Marecki, and M. Tambe. Approximation methods for infinite Bayesian Stackelberg games: Modeling distributional payoff uncertainty. In Proceedings of the 10th International Conference on Autonomous Agents and Multi-Agent Systems (AAMAS), pages 1005–1012, 2011. [6] D. Korzhyk, V. Conitzer, and R. Parr. Complexity of computing optimal Stackelberg strategies in security resource allocation games. In Proceedings of the 24th AAAI Conference on Artificial Intelligence (AAAI), pages 805–810, 2010. [7] D. Korzhyk, Z. Yin, C. Kiekintveld, V. Conitzer, and M. Tambe. Stackelberg vs. Nash in security games: An extended investigation of interchangeability, equivalence, and uniqueness. Journal of Artificial Intelligence Research, 41:297–327, 2011. [8] J. Letchford, V. Conitzer, and K. Munagala. Learning and approximating the optimal strategy to commit to. In Proceedings of the 2nd International Symposium on Algorithmic Game Theory (SAGT), pages 250–262, 2009. [9] J. Marecki, G. Tesauro, and R. Segal. Playing repeated Stackelberg games with unknown opponents. In Proceedings of the 11th International Conference on Autonomous Agents and Multi-Agent Systems (AAMAS), pages 821–828, 2012. [10] T. S. Motzkin, H. Raiffa, G. L. Thompson, and R. M. Thrall. The double description method. Annals of Mathematics Studies, 2(28):51–73, 1953. [11] P. Paruchuri, J. P. Pearce, J. Marecki, M. Tambe, F. F. Ord´o˜nez, and S. Kraus. Playing games for security: An efficient exact algorithm for solving Bayesian Stackelberg games. In Proceedings of the 7th International Conference on Autonomous Agents and Multi-Agent Systems (AAMAS), pages 895–902, 2008. [12] J. Pita, M. Jain, M. Tambe, F. Ord´o˜nez, and S. Kraus. Robust solutions to Stackelberg games: Addressing bounded rationality and limited observations in human cognition. Artificial Intelligence, 174(15):1142–1171, 2010. [13] M. Tambe. Security and Game Theory: Algorithms, Deployed Systems, Lessons Learned. Cambridge University Press, 2012. [14] A. Tauman Kalai and S. Vempala. Simulated annealing for convex optimization. Mathematics of Operations Research, 31(2):253–266, 2006. 9
2014
331
5,438
A Drifting-Games Analysis for Online Learning and Applications to Boosting Haipeng Luo Department of Computer Science Princeton University Princeton, NJ 08540 haipengl@cs.princeton.edu Robert E. Schapire⇤ Department of Computer Science Princeton University Princeton, NJ 08540 schapire@cs.princeton.edu Abstract We provide a general mechanism to design online learning algorithms based on a minimax analysis within a drifting-games framework. Different online learning settings (Hedge, multi-armed bandit problems and online convex optimization) are studied by converting into various kinds of drifting games. The original minimax analysis for drifting games is then used and generalized by applying a series of relaxations, starting from choosing a convex surrogate of the 0-1 loss function. With different choices of surrogates, we not only recover existing algorithms, but also propose new algorithms that are totally parameter-free and enjoy other useful properties. Moreover, our drifting-games framework naturally allows us to study high probability bounds without resorting to any concentration results, and also a generalized notion of regret that measures how good the algorithm is compared to all but the top small fraction of candidates. Finally, we translate our new Hedge algorithm into a new adaptive boosting algorithm that is computationally faster as shown in experiments, since it ignores a large number of examples on each round. 1 Introduction In this paper, we study online learning problems within a drifting-games framework, with the aim of developing a general methodology for designing learning algorithms based on a minimax analysis. To solve an online learning problem, it is natural to consider game-theoretically optimal algorithms which find the best solution even in worst-case scenarios. This is possible for some special cases ([7, 1, 3, 21]) but difficult in general. On the other hand, many other efficient algorithms with optimal regret rate (but not exactly minimax optimal) have been proposed for different learning settings (such as the exponential weights algorithm [14, 15], and follow the perturbed leader [18]). However, it is not always clear how to come up with these algorithms. Recent work by Rakhlin et al. [26] built a bridge between these two classes of methods by showing that many existing algorithms can indeed be derived from a minimax analysis followed by a series of relaxations. In this paper, we provide a parallel way to design learning algorithms by first converting online learning problems into variants of drifting games, and then applying a minimax analysis and relaxations. Drifting games [28] (reviewed in Section 2) generalize Freund’s “majority-vote game” [13] and subsume some well-studied boosting and online learning settings. A nearly minimax optimal algorithm is proposed in [28]. It turns out the connections between drifting games and online learning go far beyond what has been discussed previously. To show that, we consider variants of drifting games that capture different popular online learning problems. We then generalize the minimax analysis in [28] based on one key idea: relax a 0-1 loss function by a convex surrogate. Although ⇤R. Schapire is currently at Microsoft Research in New York City. 1 this idea has been applied widely elsewhere in machine learning, we use it here in a new way to obtain a very general methodology for designing and analyzing online learning algorithms. Using this general idea, we not only recover existing algorithms, but also design new ones with special useful properties. A somewhat surprising result is that our new algorithms are totally parameterfree, which is usually not the case for algorithms derived from a minimax analysis. Moreover, a generalized notion of regret (✏-regret, defined in Section 3) that measures how good the algorithm is compared to all but the top ✏fraction of candidates arises naturally in our drifting-games framework. Below we summarize our results for a range of learning settings. Hedge Settings: (Section 3) The Hedge problem [14] investigates how to cleverly bet across a set of actions. We show an algorithmic equivalence between this problem and a simple drifting game (DGv1). We then show how to relax the original minimax analysis step by step to reach a general recipe for designing Hedge algorithms (Algorithm 3). Three examples of appropriate convex surrogates of the 0-1 loss function are then discussed, leading to the well-known exponential weights algorithm and two other new ones, one of which (NormalHedge.DT in Section 3.3) bears some similarities with the NormalHedge algorithm [10] and enjoys a similar ✏-regret bound simultaneously for all ✏and horizons. However, our regret bounds do not depend on the number of actions, and thus can be applied even when there are infinitely many actions. Our analysis is also arguably simpler and more intuitive than the one in [10] and easy to be generalized to more general settings. Moreover, our algorithm is more computationally efficient since it does not require a numerical searching step as in NormalHedge. Finally, we also derive high probability bounds for the randomized Hedge setting as a simple side product of our framework without using any concentration results. Multi-armed Bandit Problems: (Section 4) The multi-armed bandit problem [6] is a classic example for learning with incomplete information where the learner can only obtain feedback for the actions taken. To capture this problem, we study a quite different drifting game (DGv2) where randomness and variance constraints are taken into account. Again the minimax analysis is generalized and the EXP3 algorithm [6] is recovered. Our results could be seen as a preliminary step to answer the open question [2] on exact minimax optimal algorithms for the multi-armed bandit problem. Online Convex Optimization: (Section 4) Based the theory of convex optimization, online convex optimization [31] has been the foundation of modern online learning theory. The corresponding drifting game formulation is a continuous space variant (DGv3). Fortunately, it turns out that all results from the Hedge setting are ready to be used here, recovering the continuous EXP algorithm [12, 17, 24] and also generalizing our new algorithms to this general setting. Besides the usual regret bounds, we also generalize the ✏-regret, which, as far as we know, is the first time it has been explicitly studied. Again, we emphasize that our new algorithms are adaptive in ✏and the horizon. Boosting: (Section 4) Realizing that every Hedge algorithm can be converted into a boosting algorithm ([29]), we propose a new boosting algorithm (NH-Boost.DT) by converting NormalHedge.DT. The adaptivity of NormalHedge.DT is then translated into training error and margin distribution bounds that previous analysis in [29] using nonadaptive algorithms does not show. Moreover, our new boosting algorithm ignores a great many examples on each round, which is an appealing property useful to speeding up the weak learning algorithm. This is confirmed by our experiments. Related work: Our analysis makes use of potential functions. Similar concepts have widely appeared in the literature [8, 5], but unlike our work, they are not related to any minimax analysis and might be hard to interpret. The existence of parameter free Hedge algorithms for unknown number of actions was shown in [11], but no concrete algorithms were given there. Boosting algorithms that ignore some examples on each round were studied in [16], where a heuristic was used to ignore examples with small weights and no theoretical guarantee is provided. 2 Reviewing Drifting Games We consider a simplified version of drifting games similar to the one described in [29, chap. 13] (also called chip games). This game proceeds through T rounds, and is played between a player and an adversary who controls N chips on the real line. The positions of these chips at the end of round t are denoted by st 2 RN, with each coordinate st,i corresponding to the position of chip i. Initially, all chips are at position 0 so that s0 = 0. On every round t = 1, . . . , T: the player first chooses a distribution pt over the chips, then the adversary decides the movements of the chips zt so that the 2 new positions are updated as st = st−1 + zt. Here, each zt,i has to be picked from a prespecified set B ⇢R, and more importantly, satisfy the constraint pt · zt ≥β ≥0 for some fixed constant β. At the end of the game, each chip is associated with a nonnegative loss defined by L(sT,i) for some nonincreasing function L mapping from the final position of the chip to R+. The goal of the player is to minimize the chips’ average loss 1 N PN i=1 L(sT,i) after T rounds. So intuitively, the player aims to “push” the chips to the right by assigning appropriate weights on them so that the adversary has to move them to the right by β in a weighted average sense on each round. This game captures many learning problems. For instance, binary classification via boosting can be translated into a drifting game by treating each training example as a chip (see [28] for details). We regard a player’s strategy D as a function mapping from the history of the adversary’s decisions to a distribution that the player is going to play with, that is, pt = D(z1:t−1) where z1:t−1 stands for z1, . . . , zt−1. The player’s worst case loss using this algorithm is then denoted by LT (D). The minimax optimal loss of the game is computed by the following expression: minD LT (D) = minp12∆N maxz12Zp1 · · · minpT 2∆N maxzT 2ZpT 1 N PN i=1 L(PT t=1 zt,i), where ∆N is the N dimensional simplex and Zp = BN \ {z : p · z ≥β} is assumed to be compact. A strategy D⇤that realizes the minimum in minD LT (D) is called a minimax optimal strategy. A nearly optimal strategy and its analysis is originally given in [28], and a derivation by directly tackling the above minimax expression can be found in [29, chap. 13]. Specifically, a sequence of potential functions of a chip’s position is defined recursively as follows: ΦT (s) = L(s), Φt−1(s) = min w2R+ max z2B (Φt(s + z) + w(z −β)). (1) Let wt,i be the weight that realizes the minimum in the definition of Φt−1(st−1,i), that is, wt,i 2 arg minw maxz(Φt(st−1,i + z) + w(z −β)). Then the player’s strategy is to set pt,i / wt,i. The key property of this strategy is that it assures that the sum of the potentials over all the chips never increases, connecting the player’s final loss with the potential at time 0 as follows: 1 N N X i=1 L(sT,i) 1 N N X i=1 ΦT (sT,i) 1 N N X i=1 ΦT −1(sT −1,i) · · · 1 N N X i=1 Φ0(s0,i) = Φ0(0). (2) It has been shown in [28] that this upper bound on the loss is optimal in a very strong sense. Moreover, in some cases the potential functions have nice closed forms and thus the algorithm can be efficiently implemented. For example, in the boosting setting, B is simply {−1, +1}, and one can verify Φt(s) = 1+β 2 Φt+1(s+1)+ 1−β 2 Φt+1(s−1) and wt,i = 1 2 (Φt(st−1,i −1) −Φt(st−1,i + 1)). With the loss function L(s) being 1{s 0}, these can be further simplified and eventually give exactly the boost-by-majority algorithm [13]. 3 Online Learning as a Drifting Game The connection between drifting games and some specific settings of online learning has been noticed before ([28, 23]). We aim to find deeper connections or even an equivalence between variants of drifting games and more general settings of online learning, and provide insights on designing learning algorithms through a minimax analysis. We start with a simple yet classic Hedge setting. 3.1 Algorithmic Equivalence In the Hedge setting [14], a player tries to earn as much as possible (or lose as little as possible) by cleverly spreading a fixed amount of money to bet on a set of actions on each day. Formally, the game proceeds for T rounds, and on each round t = 1, . . . , T: the player chooses a distribution pt over N actions, then the adversary decides the actions’ losses `t (i.e. action i incurs loss `t,i 2 [0, 1]) which are revealed to the player. The player suffers a weighted average loss pt · `t at the end of this round. The goal of the player is to minimize his “regret”, which is usually defined as the difference between his total loss and the loss of the best action. Here, we consider an even more general notion of regret studied in [20, 19, 10, 11], which we call ✏-regret. Suppose the actions are ordered according to their total losses after T rounds (i.e. PT t=1 `t,i) from smallest to largest, and let i✏be the index 3 Input: A Hedge Algorithm H for t = 1 to T do Query H: pt = H(`1:t−1). Set: DR(z1:t−1) = pt. Receive movements zt from the adversary. Set: `t,i = zt,i −minj zt,j, 8i. Algorithm 1: Conversion of a Hedge Algorithm H to a DGv1 Algorithm DR Input: A DGv1 Algorithm DR for t = 1 to T do Query DR: pt = DR(z1:t−1). Set: H(`1:t−1) = pt. Receive losses `t from the adversary. Set: zt,i = `t,i −pt · `t, 8i. Algorithm 2: Conversion of a DGv1 Algorithm DR to a Hedge Algorithm H of the action that is the dN✏e-th element in the sorted list (0 < ✏1). Now, ✏-regret is defined as R✏ T (p1:T , `1:T ) = PT t=1 pt · `t −PT t=1 `t,i✏. In other words, ✏-regret measures the difference between the player’s loss and the loss of the dN✏e-th best action (recovering the usual regret with ✏1/N), and sublinear ✏-regret implies that the player’s loss is almost as good as all but the top ✏fraction of actions. Similarly, R✏ T (H) denotes the worst case ✏-regret for a specific algorithm H. For convenience, when ✏0 or ✏> 1, we define ✏-regret to be 1 or −1 respectively. Next we discuss how Hedge is highly related to drifting games. Consider a variant of drifting games where B = [−1, 1], β = 0 and L(s) = 1{s −R} for some constant R. Additionally, we impose an extra restriction on the adversary: |zt,i −zt,j| 1 for all i and j. In other words, the difference between any two chips’ movements is at most 1. We denote this specific variant of drifting games by DGv1 (summarized in Appendix A) and a corresponding algorithm by DR to emphasize the dependence on R. The reductions in Algorithm 1 and 2 and Theorem 1 show that DGv1 and the Hedge problem are algorithmically equivalent (note that both conversions are valid). The proof is straightforward and deferred to Appendix B. By Theorem 1, it is clear that the minimax optimal algorithm for one setting is also minimax optimal for the other under these conversions. Theorem 1. DGv1 and the Hedge problem are algorithmically equivalent in the following sense: (1) Algorithm 1 produces a DGv1 algorithm DR satisfying LT (DR) i/N where i 2 {0, . . . , N} is such that R(i+1)/N T (H) < R Ri/N T (H). (2) Algorithm 2 produces a Hedge algorithm H with R✏ T (H) < R for any R such that LT (DR) < ✏. 3.2 Relaxations From now on we only focus on the direction of converting a drifting game algorithm into a Hedge algorithm. In order to derive a minimax Hedge algorithm, Theorem 1 tells us it suffices to derive minimax DGv1 algorithms. Exact minimax analysis is usually difficult, and appropriate relaxations seem to be necessary. To make use of the existing analysis for standard drifting games, the first obvious relaxation is to drop the additional restriction in DGv1, that is, |zt,i −zt,j| 1 for all i and j. Doing this will lead to the exact setting discussed in [23] where a near optimal strategy is proposed using the recipe in Eq. (1). It turns out that this relaxation is reasonable and does not give too much more power to the adversary. To see this, first recall that results from [23], written in our notation, state that minDR LT (DR)  1 2T P T −R 2 j=0 #T +1 j $ , which, by Hoeffding’s inequality, is upper bounded by 2 exp ⇣ −(R+1)2 2(T +1) ⌘ . Second, statement (2) in Theorem 1 clearly remains valid if the input of Algorithm 2 is a drifting game algorithm for this relaxed version of DGv1. Therefore, by setting ✏> 2 exp ⇣ −(R+1)2 2(T +1) ⌘ and solving for R, we have R✏ T (H) O ⇣q T ln( 1 ✏) ⌘ , which is the known optimal regret rate for the Hedge problem, showing that we lose little due to this relaxation. However, the algorithm proposed in [23] is not computationally efficient since the potential functions Φt(s) do not have closed forms. To get around this, we would want the minimax expression in Eq. (1) to be easily solved, just like the case when B = {−1, 1}. It turns out that convexity would allow us to treat B = [−1, 1] almost as B = {−1, 1}. Specifically, if each Φt(s) is a convex function of s, then due to the fact that the maximum of a convex function is always realized at the boundary of a compact region, we have min w2R+ max z2[−1,1] (Φt(s + z) + wz) = min w2R+ max z2{−1,1} (Φt(s + z) + wz) = Φt(s −1) + Φt(s + 1) 2 , (3) 4 Input: A convex, nonincreasing, nonnegative function ΦT (s). for t = T down to 1 do Find a convex function Φt−1(s) s.t. 8s, Φt(s −1) + Φt(s + 1) 2Φt−1(s). Set: s0 = 0. for t = 1 to T do Set: H(`1:t−1) = pt s.t. pt,i / Φt(st−1,i −1) −Φt(st−1,i + 1). Receive losses `t and set st,i = st−1,i + `t,i −pt · `t, 8i. Algorithm 3: A General Hedge Algorithm H with w = (Φt(s −1) −Φt(s + 1))/2 realizing the minimum. Since the 0-1 loss function L(s) is not convex, this motivates us to find a convex surrogate of L(s). Fortunately, relaxing the equality constraints in Eq. (1) does not affect the key property of Eq. (2) as we will show in the proof of Theorem 2. “Compiling out” the input of Algorithm 2, we thus have our general recipe (Algorithm 3) for designing Hedge algorithms with the following regret guarantee. Theorem 2. For Algorithm 3, if R and ✏are such that Φ0(0) < ✏and ΦT (s) ≥1{s −R} for all s 2 R, then R✏ T (H) < R. Proof. It suffices to show that Eq. (2) holds so that the theorem follows by a direct application of statement (2) of Theorem 1. Let wt,i = (Φt(st−1,i −1) −Φt(st−1,i + 1))/2. Then P i Φt(st,i) P i (Φt(st−1,i + zt,i) + wt,izt,i) since pt,i / wt,i and pt·zt ≥0. On the other hand, by Eq. (3), we have Φt(st−1,i + zt,i) + wt,izt,i minw2R+ maxz2[−1,1] (Φt(st−1,i + z) + wz) = 1 2 (Φt(st−1,i −1) + Φt(st−1,i + 1)), which is at most Φt−1(st−1,i) by Algorithm 3. This shows P i Φt(st,i) P i Φt−1(st−1,i) and Eq. (2) follows. Theorem 2 tells us that if solving Φ0(0) < ✏for R gives R > R for some value R, then the regret of Algorithm 3 is less than any value that is greater than R, meaning the regret is at most R. 3.3 Designing Potentials and Algorithms Now we are ready to recover existing algorithms and develop new ones by choosing an appropriate potential ΦT (s) as Algorithm 3 suggests. We will discuss three different algorithms below, and summarize these examples in Table 1 (see Appendix C). Exponential Weights (EXP) Algorithm. Exponential loss is an obvious choice for ΦT (s) as it has been widely used as the convex surrogate of the 0-1 loss function in the literature. It turns out that this will lead to the well-known exponential weights algorithm [14, 15]. Specifically, we pick ΦT (s) to be exp (−⌘(s + R)) which exactly upper bounds 1{s −R}. To compute Φt(s) for t T, we simply let Φt(s −1) + Φt(s + 1) 2Φt−1(s) hold with equality. Indeed, direct computations show that all Φt(s) share a similar form: Φt(s) = ⇣ e⌘+e−⌘ 2 ⌘T −t · exp (−⌘(s + R)) . Therefore, according to Algorithm 3, the player’s strategy is to set pt,i / Φt(st−1,i −1) −Φt(st−1,i + 1) / exp (−⌘st−1,i) , which is exactly the same as EXP (note that R becomes irrelevant after normalization). To derive regret bounds, it suffices to require Φ0(0) < ✏, which is equivalent to R > 1 ⌘ ⇣ ln( 1 ✏) + T ln e⌘+e−⌘ 2 ⌘ . By Theorem 2 and Hoeffding’s lemma (see [9, Lemma A.1]), we thus know R✏ T (H) 1 ⌘ln # 1 ✏ $ + T ⌘ 2 = q 2T ln # 1 ✏ $ where the last step is by optimally tuning ⌘to be q 2(ln 1 ✏)/T. Note that this algorithm is not adaptive in the sense that it requires knowledge of T and ✏to set the parameter ⌘. We have thus recovered the well-known EXP algorithm and given a new analysis using the driftinggames framework. More importantly, as in [26], this derivation may shed light on why this algorithm works and where it comes from, namely, a minimax analysis followed by a series of relaxations, starting from a reasonable surrogate of the 0-1 loss function. 2-norm Algorithm. We next move on to another simple convex surrogate: ΦT (s) = a[s]2 −≥ 1{s −1/pa}, where a is some positive constant and [s]−= min{0, s} represents a truncating operation. The following lemma shows that Φt(s) can also be simply described. 5 Lemma 1. If a > 0, then Φt(s) = a # [s]2 −+ T −t $ satisfies Φt(s −1) + Φt(s + 1) 2Φt−1(s). Thus, Algorithm 3 can again be applied. The resulting algorithm is extremely concise: pt,i / Φt(st−1,i −1) −Φt(st−1,i + 1) / [st−1,i −1]2 −−[st−1,i + 1]2 −. We call this the “2-norm” algorithm since it resembles the p-norm algorithm in the literature when p = 2 (see [9]). The difference is that the p-norm algorithm sets the weights proportional to the derivative of potentials, instead of the difference of them as we are doing here. A somewhat surprising property of this algorithm is that it is totally adaptive and parameter-free (since a disappears under normalization), a property that we usually do not expect to obtain from a minimax analysis. Direct application of Theorem 2 (Φ0(0) = aT < ✏, 1/pa > p T/✏) shows that its regret achieves the optimal dependence on the horizon T. Corollary 1. Algorithm 3 with potential Φt(s) defined in Lemma 1 produces a Hedge algorithm H such that R✏ T (H)  p T/✏simultaneously for all T and ✏. NormalHedge.DT. The regret for the 2-norm algorithm does not have the optimal dependence on ✏. An obvious follow-up question would be whether it is possible to derive an adaptive algorithm that achieves the optimal rate O( p T ln(1/✏)) simultaneously for all T and ✏using our framework. An even deeper question is: instead of choosing convex surrogates in a seemingly arbitrary way, is there a more natural way to find the right choice of ΦT (s)? To answer these questions, we recall that the reason why the 2-norm algorithm can get rid of the dependence on ✏is that ✏appears merely in the multiplicative constant a that does not play a role after normalization. This motivates us to let ΦT (s) in the form of ✏F(s) for some F(s). On the other hand, from Theorem 2, we also want ✏F(s) to upper bound the 0-1 loss function 1{s  − p dT ln(1/✏)} for some constant d. Taken together, this is telling us that the right choice of F(s) should be of the form ⇥ # exp(s2/T) $1. Of course we still need to refine it to satisfy the monotonicity and other properties. We define ΦT (s) formally and more generally as: ΦT (s) = a ⇣ exp ⇣[s]2 − dT ⌘ −1 ⌘ ≥1 ⇢ s − q dT ln # 1 a + 1 $* , where a and d are some positive constants. This time it is more involved to figure out what other Φt(s) should be. The following lemma addresses this issue (proof deferred to Appendix C). Lemma 2. If bt = 1−1 2 PT ⌧=t+1 # exp # 4 d⌧ $ −1 $ , a > 0, d ≥3 and Φt(s) = a ⇣ exp ⇣[s]2 − dt ⌘ −bt ⌘ (define Φ0(s) ⌘a(1 −b0)), then we have Φt(s −1) + Φt(s + 1) 2Φt−1(s) for all s 2 R and t = 2, . . . , T. Moreover, Eq. (2) still holds. Note that even if Φ1(s −1) + Φ1(s + 1) 2Φ0(s) is not valid in general, Lemma 2 states that Eq. (2) still holds. Thus Algorithm 3 can indeed still be applied, leading to our new algorithm: pt,i / Φt(st−1,i −1) −Φt(st−1,i + 1) / exp ⇣[st−1,i−1]2 − dt ⌘ −exp ⇣[st−1,i+1]2 − dt ⌘ . Here, d seems to be an extra parameter, but in fact, simply setting d = 3 is good enough: Corollary 2. Algorithm 3 with potential Φt(s) defined in Lemma 2 and d = 3 produces a Hedge algorithm H such that the following holds simultaneously for all T and ✏: R✏ T (H)  q 3T ln # 1 2✏ # e4/3 −1 $ (ln T + 1) + 1 $ = O ⇣p T ln (1/✏) + T ln ln T ⌘ . We have thus proposed a parameter-free adaptive algorithm with optimal regret rate (ignoring the ln ln T term) using our drifting-games framework. In fact, our algorithm bears a striking similarity to NormalHedge [10], the first algorithm that has this kind of adaptivity. We thus name our algorithm NormalHedge.DT2. We include NormalHedge in Table 1 for comparison. One can see that the main differences are: 1) On each round NormalHedge performs a numerical search to find out the right parameter used in the exponents; 2) NormalHedge uses the derivative of potentials as weights. 1Similar potential was also proposed in recent work [22, 25] for a different setting. 2“DT” stands for discrete time. 6 Compared to NormalHedge, the regret bound for NormalHedge.DT has no explicit dependence on N, but has a slightly worse dependence on T (indeed ln ln T is almost negligible). We emphasize other advantages of our algorithm over NormalHedge: 1) NormalHedge.DT is more computationally efficient especially when N is very large, since it does not need a numerical search for each round; 2) our analysis is arguably simpler and more intuitive than the one in [10]; 3) as we will discuss in Section 4, NormalHedge.DT can be easily extended to deal with the more general online convex optimization problem where the number of actions is infinitely large, while it is not clear how to do that for NormalHedge by generalizing the analysis in [10]. Indeed, the extra dependence on the number of actions N for the regret of NormalHedge makes this generalization even seem impossible. Finally, we will later see that NormalHedge.DT outperforms NormalHedge in experiments. Despite the differences, it is worth noting that both algorithms assign zero weight to some actions on each round, an appealing property when N is huge. We will discuss more on this in Section 4. 3.4 High Probability Bounds We now consider a common variant of Hedge: on each round, instead of choosing a distribution pt, the player has to randomly pick a single action it, while the adversary decides the losses `t at the same time (without seeing it). For now we only focus on the player’s regret to the best action: RT (i1:T , `1:T ) = PT t=1 `t,it −mini PT t=1 `t,i. Notice that the regret is now a random variable, and we are interested in a bound that holds with high probability. Using Azuma’s inequality, standard analysis (see for instance [9, Lemma 4.1]) shows that the player can simply draw it according to pt = H(`1:t−1), the output of a standard Hedge algorithm, and suffers regret at most RT (H) + p T ln(1/δ) with probability 1 −δ. Below we recover similar results as a simple side product of our drifting-games analysis without resorting to concentration results, such as Azuma’s inequality. For this, we only need to modify Algorithm 3 by setting zt,i = `t,i −`t,it. The restriction pt · zt ≥0 is then relaxed to hold in expectation. Moreover, it is clear that Eq. (2) also still holds in expectation. On the other hand, by definition and the union bound, one can show that P i E[L(sT,i)] = P i Pr [sT,i −R] ≥Pr [RT (i1:T , `1:T ) ≥R]. So setting Φ0(0) = δ shows that the regret is smaller than R with probability 1 −δ. Therefore, for example, if EXP is used, then the regret would be at most p 2T ln(N/δ) with probability 1−δ, giving basically the same bound as the standard analysis. One draw back is that EXP would need δ as a parameter. However, this can again be addressed by NormalHedge.DT for the exact same reason that NormalHedge.DT is independent of ✏. We have thus derived high probability bounds without using any concentration inequalities. 4 Generalizations and Applications Multi-armed Bandit (MAB) Problem: The only difference between Hedge (randomized version) and the non-stochastic MAB problem [6] is that on each round, after picking it, the player only sees the loss for this single action `t,it instead of the whole vector `t. The goal is still to compete with the best action. A common technique used in the bandit setting is to build an unbiased estimator ˆ`t for the losses, which in this case could be ˆ`t,i = 1{i = it}·`t,it/pt,it. Then algorithms such as EXP can be used by replacing `t with ˆ`t, leading to the EXP3 algorithm [6] with regret O( p TN ln N). One might expect that Algorithm 3 would also work well by replacing `t with ˆ`t. However, doing so breaks an important property of the movements zt,i: boundedness. Indeed, Eq. (3) no longer makes sense if z could be infinitely large, even if in expectation it is still in [−1, 1] (note that zt,i is now a random variable). It turns out that we can address this issue by imposing a variance constraint on zt,i. Formally, we consider a variant of drifting games where on each round, the adversary picks a random movement zt,i for each chip such that: zt,i ≥−1, Et[zt,i] 1, Et[z2 t,i] 1/pt,i and Et[pt · zt] ≥0. We call this variant DGv2 and summarize it in Appendix A. The standard minimax analysis and the derivation of potential functions need to be modified in a certain way for DGv2, as stated in Theorem 4 (Appendix D). Using the analysis for DGv2, we propose a general recipe for designing MAB algorithms in a similar way as for Hedge and also recover EXP3 (see Algorithm 4 and Theorem 5 in Appendix D). Unfortunately so far we do not know other appropriate potentials due to some technical difficulties. We conjecture, however, that there is a potential function that could recover the poly-INF algorithm [4, 5] or give its variants that achieve the optimal regret O( p TN). 7 Online Convex Optimization: We next consider a general online convex optimization setting [31]. Let S ⇢Rd be a compact convex set, and F be a set of convex functions with range [0, 1] on S. On each round t, the learner chooses a point xt 2 S, and the adversary chooses a loss function ft 2 F (knowing xt). The learner then suffers loss ft(xt). The regret after T rounds is RT (x1:T , f1:T ) = PT t=1 ft(xt) −minx2S PT t=1 ft(x). There are two general approaches to OCO: one builds on convex optimization theory [30], and the other generalizes EXP to a continuous space [12, 24]. We will see how the drifting-games framework can recover the latter method and also leads to new ones. To do so, we introduce a continuous variant of drifting games (DGv3, see Appendix A). There are now infinitely many chips, one for each point in S. On round t, the player needs to choose a distribution over the chips, that is, a probability density function pt(x) on S. Then the adversary decides the movements for each chip, that is, a function zt(x) with range [−1, 1] on S (not necessarily convex or continuous), subject to a constraint Ex⇠pt[zt(x)] ≥0. At the end, each point x is associated with a loss L(x) = 1{P t zt(x) −R}, and the player aims to minimize the total loss R x2S L(x)dx. OCO can be converted into DGv3 by setting zt(x) = ft(x)−ft(xt) and predicting xt = Ex⇠pt[x] 2 S. The constraint Ex⇠pt[zt(x)] ≥0 holds by the convexity of ft. Moreover, it turns out that the minimax analysis and potentials for DGv1 can readily be used here, and the notion of ✏-regret, now generalized to the OCO setting, measures the difference of the player’s loss and the loss of a best fixed point in a subset of S that excludes the top ✏fraction of points. With different potentials, we obtain versions of each of the three algorithms of Section 3 generalized to this setting, with the same ✏-regret bounds as before. Again, two of these methods are adaptive and parameter-free. To derive bounds for the usual regret, at first glance it seems that we have to set ✏to be close to zero, leading to a meaningless bound. Nevertheless, this is addressed by Theorem 6 using similar techniques in [17], giving the usual O( p dT ln T) regret bound. All details can be found in Appendix E. Applications to Boosting: There is a deep and well-known connection between Hedge and boosting [14, 29]. In principle, every Hedge algorithm can be converted into a boosting algorithm; for instance, this is how AdaBoost was derived from EXP. In the same way, NormalHedge.DT can be converted into a new boosting algorithm that we call NH-Boost.DT. See Appendix F for details and further background on boosting. The main idea is to treat each training example as an “action”, and to rely on the Hedge algorithm to compute distributions over these examples which are used to train the weak hypotheses. Typically, it is assumed that each of these has “edge” γ, meaning its accuracy on the training distribution is at least 1/2 + γ. The final hypothesis is a simple majority vote of the weak hypotheses. To understand the prediction accuracy of a boosting algorithm, we often study the training error rate and also the distribution of margins, a well-established measure of confidence (see Appendix F for formal definitions). Thanks to the adaptivity of NormalHedge.DT, we can derive bounds on both the training error and the distribution of margins after any number of rounds: Theorem 3. After T rounds, the training error of NH-Boost.DT is of order ˜O(exp(−1 3Tγ2)), and the fraction of training examples with margin at most ✓(2γ) is of order ˜O(exp(−1 3T(✓−2γ)2)). Thus, the training error decreases at roughly the same rate as AdaBoost. In addition, this theorem implies that the fraction of examples with margin smaller than 2γ eventually goes to zero as T gets large, which means NH-Boost.DT converges to the optimal margin 2γ; this is known not to be true for AdaBoost (see [29]). Also, like AdaBoost, NH-Boost.DT is an adaptive boosting algorithm that does not require γ or T as a parameter. However, unlike AdaBoost, NH-Boost.DT has the striking property that it completely ignores many examples on each round (by assigning zero weight), which is very helpful for the weak learning algorithm in terms of computational efficiency. To test this, we conducted experiments to compare the efficiency of AdaBoost, “NH-Boost” (an analogous boosting algorithm derived from NormalHedge) and NH-Boost.DT. All details are in Appendix G. Here we only briefly summarize the results. While the three algorithms have similar performance in terms of training and test error, NH-Boost.DT is always the fastest one in terms of running time for the same number of rounds. Moreover, the average faction of examples with zero weight is significantly higher for NH-Boost.DT than for NH-Boost (see Table 3). On one hand, this explains why NHBoost.DT is faster (besides the reason that it does not require a numerical step). On the other hand, this also implies that NH-Boost.DT tends to achieve larger margins, since zero weight is assigned to examples with large margin. This is also confirmed by our experiments. Acknowledgements. Support for this research was provided by NSF Grant #1016029. The authors thank Yoav Freund for helpful discussions and the anonymous reviewers for their comments. 8 References [1] Jacob Abernethy, Peter L. Bartlett, Alexander Rakhlin, and Ambuj Tewari. Optimal strategies and minimax lower bounds for online convex games. In Proceedings of the 21st Annual Conference on Learning Theory, 2008. [2] Jacob Abernethy and Manfred K. Warmuth. Minimax games with bandits. In Proceedings of the 22st Annual Conference on Learning Theory, 2009. [3] Jacob Abernethy and Manfred K. Warmuth. Repeated games against budgeted adversaries. In Advances in Neural Information Processing Systems 23, 2010. [4] Jean-Yves Audibert and S´ebastien Bubeck. Regret bounds and minimax policies under partial monitoring. The Journal of Machine Learning Research, 11:2785–2836, 2010. [5] Jean-Yves Audibert, S´ebastien Bubeck, and G´abor Lugosi. Regret in online combinatorial optimization. Mathematics of Operations Research, 39(1):31–45, 2014. [6] Peter Auer, Nicol`o Cesa-Bianchi, Yoav Freund, and Robert E. Schapire. The nonstochastic multiarmed bandit problem. SIAM Journal on Computing, 32(1):48–77, 2002. [7] Nicol`o Cesa-Bianchi, Yoav Freund, David Haussler, David P. Helmbold, Robert E. Schapire, and Manfred K. Warmuth. How to use expert advice. Journal of the ACM, 44(3):427–485, May 1997. [8] Nicol`o Cesa-Bianchi and G´abor Lugosi. Potential-based algorithms in on-line prediction and game theory. Machine Learning, 51(3):239–261, 2003. [9] Nicol`o Cesa-Bianchi and G´abor Lugosi. Prediction, Learning, and Games. Cambridge University Press, 2006. [10] Kamalika Chaudhuri, Yoav Freund, and Daniel Hsu. A parameter-free hedging algorithm. Advances in Neural Information Processing Systems 22, 2009. [11] Alexey Chernov and Vladimir Vovk. Prediction with advice of unknown number of experts. arXiv preprint arXiv:1006.0475, 2010. [12] Thomas M. Cover. Universal portfolios. Mathematical Finance, 1(1):1–29, January 1991. [13] Yoav Freund. Boosting a weak learning algorithm by majority. Information and Computation, 121(2):256–285, 1995. [14] Yoav Freund and Robert E. Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of Computer and System Sciences, 55(1):119–139, August 1997. [15] Yoav Freund and Robert E. Schapire. Adaptive game playing using multiplicative weights. Games and Economic Behavior, 29:79–103, 1999. [16] Jerome Friedman, Trevor Hastie, and Robert Tibshirani. Additive logistic regression: A statistical view of boosting. Annals of Statistics, 28(2):337–407, April 2000. [17] Elad Hazan, Amit Agarwal, and Satyen Kale. Logarithmic regret algorithms for online convex optimization. Machine Learning, 69(2-3):169–192, 2007. [18] Adam Kalai and Santosh Vempala. Efficient algorithms for online decision problems. Journal of Computer and System Sciences, 71(3):291–307, 2005. [19] Robert Kleinberg. Anytime algorithms for multi-armed bandit problems. In Proceedings of the seventeenth annual ACM-SIAM symposium on Discrete algorithm, pages 928–936. ACM, 2006. [20] Robert David Kleinberg. Online decision problems with large strategy sets. PhD thesis, MIT, 2005. [21] Haipeng Luo and Robert E. Schapire. Towards Minimax Online Learning with Unknown Time Horizon. In Proceedings of the 31st International Conference on Machine Learning, 2014. [22] H Brendan McMahan and Francesco Orabona. Unconstrained online linear learning in hilbert spaces: Minimax algorithms and normal approximations. In Proceedings of the 27th Annual Conference on Learning Theory, 2014. [23] Indraneel Mukherjee and Robert E. Schapire. Learning with continuous experts using drifting games. Theoretical Computer Science, 411(29):2670–2683, 2010. [24] Hariharan Narayanan and Alexander Rakhlin. Random walk approach to regret minimization. In Advances in Neural Information Processing Systems 23, 2010. [25] Francesco Orabona. Simultaneous model selection and optimization through parameter-free stochastic learning. In Advances in Neural Information Processing Systems 28, 2014. [26] Alexander Rakhlin, Ohad Shamir, and Karthik Sridharan. Relax and localize: From value to algorithms. In Advances in Neural Information Processing Systems 25, 2012. Full version available in arXiv:1204.0870. [27] Lev Reyzin and Robert E. Schapire. How boosting the margin can also boost classifier complexity. In Proceedings of the 23rd International Conference on Machine Learning, 2006. [28] Robert E. Schapire. Drifting games. Machine Learning, 43(3):265–291, June 2001. [29] Robert E. Schapire and Yoav Freund. Boosting: Foundations and Algorithms. MIT Press, 2012. [30] Shai Shalev-Shwartz. Online learning and online convex optimization. Foundations and Trends in Machine Learning, 4(2):107–194, 2011. [31] Martin Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the Twentieth International Conference on Machine Learning, 2003. 9
2014
332
5,439
Dynamic Rank Factor Model for Text Streams Shaobo Han∗, Lin Du∗, Esther Salazar and Lawrence Carin Duke University, Durham, NC 27708 {shaobo.han, lin.du, esther.salazar, lcarin}@duke.edu Abstract We propose a semi-parametric and dynamic rank factor model for topic modeling, capable of (i) discovering topic prevalence over time, and (ii) learning contemporary multi-scale dependence structures, providing topic and word correlations as a byproduct. The high-dimensional and time-evolving ordinal/rank observations (such as word counts), after an arbitrary monotone transformation, are well accommodated through an underlying dynamic sparse factor model. The framework naturally admits heavy-tailed innovations, capable of inferring abrupt temporal jumps in the importance of topics. Posterior inference is performed through straightforward Gibbs sampling, based on the forward-filtering backwardsampling algorithm. Moreover, an efficient data subsampling scheme is leveraged to speed up inference on massive datasets. The modeling framework is illustrated on two real datasets: the US State of the Union Address and the JSTOR collection from Science. 1 Introduction Multivariate longitudinal ordinal/count data arise in many areas, including economics, opinion polls, text mining, and social science research. Due to the lack of discrete multivariate distributions supporting a rich enough correlation structure, one popular choice in modeling correlated categorical data employs the multivariate normal mixture of independent exponential family distributions, after appropriate transformations. Examples include the logistic-normal model for compositional data [1], the Poisson log-normal model for correlated count data [2], and the ordered probit model for multivariate ordinal data [3]. Moreover, a dynamic Bayesian extension of the generalized linear model [4] may be considered, for capturing the temporal dependencies of non-Gaussian data (such as ordinal data). In this general framework, the observations are assumed to follow an exponential family distribution, with natural parameter related to a conditionally Gaussian dynamic model [5], via a nonlinear transformation. However, these model specifications may still be too restrictive in practice, for the following reasons: (i) Observations are usually discrete, non-negative and with a massive number of zero values and, unfortunately, far from any standard parametric distributions (e.g., multinomial, Poisson, negative binomial and even their zero-inflated variants). (ii) The number of contemporaneous series can be large, bringing difficulties in sharing/learning statistical strength and in performing efficient computations. (iii) The linear state evolution is not truly manifested after a nonlinear transformation, where positive shocks (such as outliers and jumps) are magnified and negative shocks are suppressed; hence, handling temporal jumps (up and down) is a challenge for the above models. We present a flexible semi-parametric Bayesian model, termed dynamic rank factor model (DRFM), that does not suffer these drawbacks. We first reduce the effect of model misspecification by modeling the sampling distribution non-parametrically. To do so, we fit the observed data only after some implicit monotone transformation, learned automatically via the extended rank likelihood [6]. Second, instead of treating panels of time series as independent collections of variables, we analyze them jointly, with the high-dimensional cross-sectional dependencies estimated via a latent factor ∗contributed equally 1 model. Finally, by avoiding nonlinear transformations, both smooth transitions and sudden changes (“jumps”) are better preserved in the state-space model, using heavy-tailed innovations. The proposed model offers an alternative to both dynamic and correlated topic models [7, 8, 9], with additional modeling facility of word dependencies, and improved ability to handle jumps. It also provides a semi-parametric Bayesian treatment of dynamic sparse factor model. Further, our proposed framework is applicable in the analysis of multiple ordinal time series, where the innovations follow either stationary Gaussian or heavy-tailed distributions. 2 Dynamic Rank Factor Model We perform analysis of multivariate ordinal time series. In the most general sense, such ordinal variables indicate a ranking of responses in the sample space, rather than a cardinal measure [10]. Examples include real continuous variables, discrete ordered variables with or without numerical scales or, more specially, counts, which can be viewed as discrete variables with integer numeric scales. Our goal is twofold: (i) discover the common trends that govern variations in observations, and (ii) extract interpretable patterns from the cross-sectional dependencies. Dependencies among multivariate non-normal variables may be induced through normally distributed latent variables. Suppose we have P ordinal-valued time series yp,t, p = 1, . . . , P, t = 1, . . . , T. The general framework contains three components: yp,t ∼g(zp,t), zp,t ∼p(θt), θt ∼q(θt−1), (1) where g(·) is the sampling distribution, or marginal likelihood for the observations, the latent variable zp,t is modeled by p(·) (assumed to be Gaussian) with underlying system parameters θt, and q(·) is the system equation representing Markovian dynamics for the time-evolving parameter θt. In order to gain more model flexibility and robustness against misspecification, we propose a semiparametric Bayesian dynamic factor model for multiple ordinal time series analysis. The model is based on the extended rank likelihood [6], allowing the transformation from the latent conditionally Gaussian dynamic model to the multivariate observations, treated non-parametrically. Extended rank likelihood (ERL): There exist many approaches for dealing with ordinal data, however, they all have some restrictions. For continuous variables, the underlying normality assumption could be easily violated without a carefully chosen deterministic transformation. For discrete ordinal variables, an ordered probit model, with cut points, becomes computationally expensive if the number of categories is large. For count variables, a multinomial model requires finite support on the integer values. Poisson and negative binomial models lack flexibility from a practical viewpoint, and often lead to non-conjugacy when employing log-normal priors. Being aware of these issues, a natural candidate for consideration is the ERL [6]. With appropriate monotone transformations learned automatically from data, it offers a unified framework for handling both continuous [11] and discrete ordinal variables. The ERL depends only on the ranks of the observations (zero values in observations are further restricted to have negative latent variables), zp,t ∈D(Y ) ≡{zp,t ∈R : yp,t < yp′,t′ ⇒zp,t < zp′,t′, and zp,t ≤0 if yp,t = 0}. (2) In particular, this offers a distribution-free approach, with relaxed assumptions compared to parametric models, such as Poisson log-normal [12]. It also avoids the burden of computing nuisance parameters in the ordered probit model (cut points). The ERL has been utilized in Bayesian Gaussian copula modeling, to characterize the dependence of mixed data [6]. In [13] a low-rank decomposition of the covariance matrix is further employed and efficient posterior sampling is developed in [14]. The proposed work herein can be viewed as a dynamic extension of that framework. 2.1 Latent sparse dynamic factor model In the forthcoming text, G(α, β) denotes a gamma distribution with shape parameter α and rate parameter β, TN(l,u)(µ, σ2) denotes a univariate truncated normal distribution within the interval (l, u), and N+(0, σ2) is the half-normal distribution that only has non-negative support. Assume zt ∼N(0, Ωt), where Ωt is usually a high-dimensional (P × P) covariance matrix. To reduce the number of parameters, we assume a low rank factor model decomposition of the covariance matrix Ωt = ΛV tΛT + R such that zt = Λst + ϵt, ϵt ∼N(0, R), R = IP . (3) 2 Common trends (importance of topics) are captured by a low-dimensional factor score parameter st. We assume autoregressive dynamics on sk,t ←AR(1|(ρk, δk,t)) with heavy-tailed innovations, sk,t = ρksk,t−1 + δk,t, 0 < ρk < 1, δk,t ∼TPBN(e, f, ν), ν1/2 ∼C+(0, h), (4) where δk,t follows the three-parameter beta mixture of normal TPBN(e, f, ν) distribution [15]. Parameter e controls the peak around zero, f controls the heaviness on the tails, and ν controls the global sparsity with a half-Cauchy prior [16]. This prior encourages smooth transitions in general, while jumps are captured by the heavy tails. The conjugate hierarchy may be equivalently represented as δk,t ∼N(0, τk,t), τk,t ∼G(e, ηk,t), ηk,t ∼G(f, ν) ν ∼G(1/2, ζ), ζ ∼G(1/2, h2). Truncated normal priors are employed on ρk, ρk ∼TN(0,1)(µ0, σ2 0), and assume s0,k ∼N(0, σ2 s). Note that the extended rank likelihood is scale-free; therefore, we do not need to include a redundant intercept parameter in (3). For the same reason, we set R = IP . Model identifiability issues: Although the covariance matrix Ωt is not identifiable [10], the related correlation matrix Ct = Ω[i,j],t/pΩ[i,i],tΩ[j,j],t, (i, j = 1, . . . , P) may be identified, using the parameter expansion technique [3, 13]. Further, the rank K in the low-rank decomposition of Ωt is also not unique. For the purpose of brevity, we do not explore this uncertainty here, but the tools developed in the Bayesian factor analysis literature [17, 18, 19] can be easily adopted. Identifiability is a key concern for factor analysis. Conventionally, for fixed K, a full-rank, lowertriangular structure in Λ ensures identifiability [20]. Unfortunately, this assumption depends on the ordering of variables. As a solution, we add nonnegative and sparseness constraints on the factor loadings, to alleviate the inherit ambiguity, while also improving interpretability. Also, we add a Procrustes post-processing step [21] on the posterior samples, to reduce this indeterminacy. The nonnegative and (near) sparseness constraints are imposed by the following hierarchy, λp,k ∼N+(0, lp,k) lp,k ∼G(a, up,k), up,k ∼G(b, φk), φ1/2 k ∼C+(0, d). (5) Integrating out lp,k and up,k, we obtain a half-TPBN prior λp,k ∼TPBN+(a, b, φk). The columnwise shrinkage parameters φk enable factors to be of different sparsity levels [22]. We set hyperparameters a = b = e = f = 0.5, d = P, h = 1, σ2 s = 1. For weakly informative priors, we set α = β = 0.01; µ0 = 0.5, σ2 0 = 10. 2.2 Extension to handle multiple documents At each time point t we may have a corpus of documents {ynt t }Nt nt=1, where ynt t is a P-dimensional observation vector, and Nt denotes the number of documents at time t. The model presented in Section 2.1 is readily extended to handle this situation. Specifically, at each time point t, for each document nt, the ERL representation for word count p, denoted by ynt p,t, is ynt p,t = g znt p,t  , p = 1, . . . , P, t = 1, . . . , T, nt = 1, . . . , Nt, where znt t ∈RP and P is the vocabulary size. We assume a latent factor model for znt t such that znt t = Λbnt t + ϵnt t , ϵnt t ∼N(0, IP ), bnt t ∼N(st, Γ), Γ = diag(γ), γ−1 k ∼G(α, β), where Λ ∈RP ×K + is the topic-word loading matrix, representing the K topics as columns of Λ. The factor score vector bnt t ∈RK is the topic usage for each document ynt t , corresponding to locations in a low-dimensional RK space. The other parts of the model remain unchanged. The latent trajectory s1:T represents the common trends for the K topics. Moreover, through the forward filtering backward sampling (FFBS) algorithm [23, 24], we also obtain time-evolving topic correlation matrices Φt ∈RK×K and word dependencies matrices Ct ∈RP ×P , offering a multi-scale graph representation, a useful tool for document visualization. 2.3 Comparison with admixture topic models Many topic models are unified in the admixture framework [25], P Admix(yn|w, Φ) = P Base yn φn = K X k=1 wk,nφk ! , (6) where yn is the P-dimensional observation vector of word counts in the n th document, and P denotes the vocabulary size. Traditionally, yn is generated from an admixture of base distributions, wn is the admixture weight (topic proportion for document n), and φk is the canonical parameter (word 3 distribution for topic k), which denotes the location of the kth topic on the P-1 dimensional simplex. For example, latent Dirichlet allocation (LDA) [26] assumes the base distribution to be multinomial, with φk ∼Dir(α0), wn ∼Dir(β0). The correlated topic model (CTM) [8] modifies the topic distribution, with wn ∼Logistic Normal(µ, Σ). The dynamic topic model (DTM) [7] analyzes document collections in a known chronological order. In order to incorporate the state space model, both the topic proportion and the word distribution are changed to logistic normal, with isotropic covariance matrices wt ∼Logistic Normal(wt−1, σ2IK) and φk,t ∼Logistic Normal(φk,t−1, vIP ), respectively. To overcome the drawbacks of multinomial base, spherical topic models [27] assume the von Mises-Fisher (vMF) distribution as its base distribution, with φk ∼vMF(µ, ξ) lying on a unit P-1 dimensional sphere. Recently in [25] the base and word distribution are both replaced with Poisson Markov random fields (MRFs), which characterizes word dependencies. We present here a semi-parametric factor model formulation, P(yn|s, Λ) ≜P zn ∈D(Y ) λn = K X k=1 sk,nλk ! , (7) with yn defined as above, λk ∈RP + is a vector of nonnegative weights, indicating the P vocabulary usage in each individual topics k, and sn ∈RK is the topic usage. Note that the extended rank likelihood does not depend on any assumptions about the data marginal distribution, making it appropriate for a broad class of ordinal-valued observations, e.g., term frequency-inverse document frequency (tf-idf) or rankings, beyond word counts. However, the proposed model here is not an admixture model, as the topic usage is allowed to be either positive or negative. The DRFM framework has some appealing advantages: (i) It is more natural and convenient to incorporate with sparsity, rank selection, and state-space model; (ii) it provides topic-correlations and word-dependences as a byproduct; and (iii) computationally, this model is tractable and often leads to locally conjugate posterior inference. DRFM has limitations. Since the marginal distributions are of unspecified types, objective criteria (e.g. perplexity) is not directly computable. This makes quantitative comparisons to other parametric baselines developed in the literature very difficult. 3 Conjugate Posterior Inference Let Θ = {Λ, S, L, U, φ, ω, ρ, τ, η, ν, ζ} denote the set of parameters in basic model, and let Z be the augmented data (from the ERL). We use Gibbs sampling to approximate the joint posterior distribution p(Z, Θ|Z ∈R(Y )). The algorithm alternates between sampling p(Z|Θ, Z ∈R(Y )) and p(Θ|Z, Z ∈R(Y )) (reduced to p(Θ|Z)). The derivation of the Gibbs sampler is straightforward, and for brevity here we only highlight the sampling steps for Z, and the forward filtering backward sampling (FFBS) steps for the trajectory s1:T . The Supplementary Material contains further details for the inference. • Sampling zp,t: p(zp,t|Θ, Z ∈R(Y ), Z−p,−t) ∼TN[zp,t,zp,t](PK k=1 λp,ksk,t, 1), where zp,t = max{zp′,t′ : yp′,t′ < yp,t} and zp,t = min{zp′,t′ : yp′,t′ > yp,t}. This conditional sampling scheme is widely used in [6, 10, 13]. In [14] a novel Hamiltonian Monte Carlo (HMC) approach has been developed recently, for a Gaussian copula extended rank likelihood model, where ranking is only within each row of Z. This method simultaneously samples a column vector of zi conditioned on other columns Z−i, with higher computation but better mixing. • Sampling st: we have the state model st|st−1 ∼N(Ast−1, Qt), and the observation model zt|st ∼N(Λst, R),1 where A = diag(ρ), Qt = diag(τ t), R = IP . for t = 1, . . . , T 1. Forward Filtering: beginning at t = 0 with s0 ∼N(0, σ2 sIK), for all t = 1, . . . , T, we find the on-line posteriors at t, p(st|z1:t) = N(mt, V t), where mt = V t{ΛT R−1zt + H−1 t Amt−1}, V t = [H−1 t + ΛT R−1Λ]−1, and Ht = Qt + AV t−1AT . 2. Backward Sampling: starting from N(f mt, eV t), the backward smoothing density, i.e., the conditional distribution of st−1 given st, is p(st−1|st, z1:(t−1)) = N(eµt−1, eΣt−1), where eµt−1 = eΣt−1{AT Q−1 t st + V −1 t−1mt−1}, eΣt−1 = (V −1 t−1 + AT Q−1 t A)−1. There exist different variants of FFBS schemes (see [28] for a detailed comparison); the method we choose here enjoys fast decay in autocorrelation and reduced computation time. 1For brevity, we omit the dependencies on Θ in notation 4 3.1 Time-evolving topic and word dependencies We also have the backward recursion density at t −1, p(st−1|z1:T ) = N(f mt−1, eV t−1), where f mt−1 = eΣt−1(AT Q−1 t f mt + V −1 t−1mt−1) and eV t−1 = eΣt−1 + eΣt−1AT Q−1 t eV tQ−1 t AeΣt−1. We perform inference on the K × K time-evolving topic dependences in s1:T , using the posterior covariances { eV 1:T } (with topic correlation matrices Φ1:T , Φ[r,s],t = V[r,s],t/pV[r,r],tV[s,s],t, r, s = 1, . . . , K), and further obtain the P × P time-evolving word dependencies capsuled in {Ω1:T } with Ωt = Λ eV tΛT + IP . Essentially, this can be viewed as a dynamic Gaussian copula model, yp,t = g(ezp,t), ezt ∼N(0, Ct), where g(·) is a non-decreasing function of a univariate marginal likelihood and Ct (t = 1, . . . , T) is the correlation matrix capturing the multivariate dependence. We obtain a posterior distribution for C1:T as a byproduct, without having to estimate the nuisance parameters in marginal likelihoods g(·). This decoupling strategy resembles the idea of copula models. 3.2 Accelerated MCMC via document subsampling For large-scale datasets, recent approaches efficiently reduce the computational load of Monte Carlo Markov chain (MCMC) by data subsampling [29, 30]. We borrow this idea of subsampling documents when considering a large corpora (e.g., in our experiments, we consider analysis of articles in the magazine Science, composed of 139379 articles from years 1880 to 2002, and a vocabulary size 5855). In our model, the augmented data znt t (nt = 1, . . . , Nt) for each document is relatively expensive to sample. One simple method is random document sampling without replacement. However, by treating all likelihood contributions symmetrically, this method leads to a highly inefficient MCMC chain with poor mixing [29]. Alternatively, we adopt the probability proportional-to-size (PSS) sampling scheme in [30], i.e., sampling the documents with inclusion probability proportional to the likelihood contributions. For each MCMC iteration, the sub-sampling procedure for documents at time t is designed as follows: • Step 1: Given a small subset Vt ⊂{1, . . . , Nt} of chosen documents, only sample {zd t } for all d ∈Vt and compute the augment log-likelihood contributions (with Bt integrated out) ℓVt(zd t ) = N(Λst, eR), where eR = ΛΓΛT + IP . Note that, only a K-dimensional matrix inversion is required, by using the Woodbury matrix inversion formula eR −1 = IP −Λ(Γ−1 + ΛT Λ)T ΛT . • Step 2: Similar to [30], we use a Gaussian process [31] to predict the log-likelihood for the remaining documents ℓVc t (zd t ) = K(Vc t , Vt)K(Vt, Vt)−1ℓVt(zd t ), where K is a Nt × Nt squared-exponential kernel, which denotes the similarity of documents: K(yi t, yj t) = σ2 f exp  −||yi t −yj t||2/(2s2)  , i, j = 1, . . . , Nt, σ2 f = 1, s = 1. • Step 3: Calculate the inclusion probability wd ∝exp [ℓ(zd t )], d = 1, . . . , Nt, ewd = wd/ P d′ wd′. • Step 4: Sampling the next subset Vt of pre-specified size |Vt| with inclusion probability ewd, and store it for the use of the next MCMC iteration. In practice, this adaptive design allows MCMC to run more efficiently on a full dataset of large scale, often mitigating the need to do parallel MCMC implementation. Future work could also consider nonparametric function estimation subject to monotonicity constraint, e.g. Gaussian process projections recently developed in [32]. 4 Experiments Different from DTM [7] , the proposed model has the jumps directly at the level of the factor scores (no exponentiation or normalization needed), and therefore it proved more effective in uncovering jumps in factor scores over time. Demonstrations of this phenomenon in a synthetic experiment are detailed in the Supplementary Material. In the following, we present exploratory data analysis on two real examples, demonstrating the ability of the proposed model to infer temporal jumps in topic importance, and to infer correlations across topics and words. 4.1 Case Study I: State of the Union dataset The State of the Union dataset contains the transcripts of T = 225 US State of the Union addresses, from 1790 to 2014. We take each transcript as a document, i.e., we have one document per year. 5 After removing stop words, and removing terms that occur fewer than 3 times in one document and less than 10 times overall, we have P = 7518 unique words. The observation yp,t corresponds to the frequency of word p of the State of the Union transcript from year t. We apply the proposed DRFM setting and learned K = 25 topics. To better understand the temporal dynamic per topic, six topics are selected and the posterior mean of their latent trajectories sk,1:T are shown in Figure 1 (with also the top 12 most probable words associated with each of the topics). A complete table with all 25 learned topics and top 12 words is provided in the Supplementary Material. The learned trajectory associated with every topic indicates different temporal patterns across all the topics. Clearly, we can identify jumps associated with some key historical events. For instance, for Topic 10, we observe a positive jump in 1846 associated with the Mexican-American war. Topic 13 is related with the Spanish-American war of 1898, with a positive jump in that year. In Topic 24, we observe a positive jump in 1914, when the Panama Canal was officially opened (words Panana and canal are included). In Topic 18, the positive jumps observed from 1997 to 1999 seem to be associated with the creation of the State Children’s Health Insurance Program in 1997. We note that the words for this topic are explicitly related with this issue. Topic 25 appears to be related to banking; the significant spike around 1836 appears to correspond to the Second Bank of the United States, which was allowed to go out of existence, and end national banking that year. In 1863 Congress passed the National Banking Act, which ended the “free-banking” period from 1836-1863; note the spike around 1863 in Topic 25. 0 2 4 Topic 10 0 2 4 6 Topic 13 1800 1850 1900 1950 2000 0 2 4 6 Topic 24 0 2 4 Topic 17 0 2 4 6 Topic 18 1800 1850 1900 1950 2000 -5 0 5 10 Topic 25 Topic#10 Topic#13 Topic#24 Topic#17 Topic#18 Topic#25 Mexico Government United Jobs Children Government Government United Treaty Country America Public Texas Islands Isthmus Tax Americans Banks United Commission Public American Care Bank War Island Panama Economy Tonight Currency Mexican Cuba Law Deficit Support Money Army Spain Territory Americans Century United Territory Act America Energy Health Federal Country General Canal Businesses Working American Peace Military Service Health Challenge National Policy International Banks Plan Security Duty Lands Officiers Colombia Care Families Institutions Figure 1: (State of the Union dataset) Above: Time evolving from 1790 to 2014 for six selected topics. The plotted values represent the posterior means. Below: Top 12 most probable words associated with the above topics. Our modeling framework is able to capture dynamic patterns of topics and word correlations. To illustrate this, we select three years (associated with some meaningful historical events) and analyze their corresponding topic and word correlations. Figure 2 (first row) shows graphs of the topic correlation matrices, in which the nodes represent topics and the edges indicate positive (green) and negative (red) correlations (we show correlations with absolute value larger than 0.01). We notice that Topics 11 and 22 are positively correlated with those years. Some of the most probable words associated with each of them are: increase, united, law and legislation (for Topic 11) and war, Mexico, peace, army, enemy and military (for Topic 22). We also are interested in understanding the time-varying correlation between words. To do so, and for the same years as before, in Figure 2 (second row) we plot the dendrogram associated with the learned correlation matrix for words. In the plots, different colors indicate highly correlated word clusters defined by cutting the branches off the dendrogram. Those figures reveal different sets of highly correlated words for different years. By 6 1846 1929 2003 Mexican-American War Economic Depression Iraq War T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16 T17 T18 T19 T20 T21 T22 T23 T24 T25 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16 T17 T18 T19 T20 T21 T22 T23 T24 T25 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16 T17 T18 T19 T20 T21 T22 T23 T24 T25 act administration america american americans army attention authority banks business billion bonds canal care children country court currency citizens constitution convention cuba department development dollars economic energy expenditures federal fiscal forces foreign freedom free general government gold health increase islands island jobs june labor law mexican mexico military million national nations nation notes number order peace policy power president program public present programs reserve report secretary service silver spain subject tax trade treasury treaty territory texas tonight union united war act administration america american americans army attention authority banks business billion bonds canal care children country court currency citizens constitution convention cuba department development dollars economic energy expenditures federal fiscal forces foreign freedom free general government gold health increase islands island jobs june labor law mexican mexico military million national nations nation notes number order peace policy power president program public present programs reserve report secretary service silver spain subject tax trade treasury treaty territory texas tonight union united war act administration america american americans army attention authority banks business billion bonds canal care children country court currency citizens constitution convention cuba department development dollars economic energy expenditures federal fiscal forces foreign freedom free general government gold health increase islands island jobs june labor law mexican mexico military million national nations nation notes number order peace policy power president program public present programs reserve report secretary service silver spain subject tax trade treasury treaty territory texas tonight union united war −1.0 −0.5 0.0 0.5 1.0 Figure 2: (State of the Union dataset) First row: Inferred correlations between topics for some specific years associated with some meaningful historical events. Green edges indicate positive correlations and red edges indicate negative correlations. Second row: Learned dendrogram based upon the correlation matrix between the top 10 words associated with each topic (we display 80 unique words in total). inspecting all the words correlation, we noticed that the set of words {government, federal, public, power, authority, general, country} are highly correlated across the whole period. 4.2 Case Study II: Analysis of Science dataset We analyze a collection of scientific documents from the JSTOR Science journal [7]. This dataset contains a collection of 139379 documents from 1880 to 2002 (T = 123), with approximately 1100 documents per year. After removing terms that occurred fewer than 25 times, the total vocabulary size is P = 5855. We learn K = 50 topics from the inferred posterior distribution, for brevity and simplicity, we only show 20 of them. We handle about 2700 documents per iteration (subsampling rate: 2%). Table 1 shows the 20 selected topics and the top 10 most probable words associated with each of them. By inspection, we notice that those topics are related with specific fields in science. For instance, Topic 2 is more related to “scientific research”, Topic 10 to “natural resources”, and Topic 15 to “genetics”. Figure 3 shows the time-varying trend for some specific words, bzp,1:T , which reveals the importance of those words across time. Finally, Figure 4 shows the correlation between the selected 20 topics. For instance, in 1950 and 2000, topic 9 (related to mouse, cells, human, transgenic) and topic 17 (related to virus, rna, tumor, infection) are highly correlated. 1880 1900 1920 1940 1960 1980 2000 −1 −0.5 0 0.5 1 1.5 2 2.5 DNA RNA Gene 1880 1900 1920 1940 1960 1980 2000 0 0.2 0.4 0.6 0.8 1 Cancer Patients Nuclear 1880 1900 1920 1940 1960 1980 2000 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Astronomy Psychology Brain Figure 3: (Science dataset) the inferred latent trend for variable bzp,1:T associated with words. 7 1900 1950 2000 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16 T17 T18 T19 T20 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16 T17 T18 T19 T20 T1 T2 T3 T4 T5 T6 T7 T8 T9 T10 T11 T12 T13 T14 T15 T16 T17 T18 T19 T20 −1.0 −0.5 0.0 0.5 1.0 Figure 4: (Science dataset) Inferred correlations between topics for some specific years. Green edges indicate positive correlations and red edges indicate negative correlations. Table 1: Selected 20 topics associated with the analysis of the Science dataset and top 10 most probable words. Topic#1 Topic#2 Topic#3 Topic#4 Topic#5 Topic#6 Topic#7 Topic#8 Topic#9 Topic#10 cells research field animals energy university science work mice water cell national magnetic brain oil professor scientific research mouse surface normal government solar neurons percent college new scientific type temperature two support energy activity production president scientists laboratory wild soil growth federal spin response fuel department human made fig pressure development development state rats total research men university cells sea tissue new electron control growth institute sciences results human plants body program quantum fig states director knowledge science transgenic solution egg scientific temperature effects electricity society meeting survey animals plant blood basic current days coal school work department mutant air Topic#11 Topic#12 Topic#13 Topic#14 Topic#15 Topic#16 Topic#17 Topic#18 Topic#19 Topic#20 system energy association protein human professor virus energy stars rna nuclear theory science proteins genome university rna electron mass fig new temperature meeting cell sequence society viruses state star mrna systems radiation university membrane chromosome department particles fig temperature protein power atoms american amino gene college tumor two solar site cost surface society sequence genes president mice structure gas sequence computer atomic section binding map director disease reaction data splicing fuel mass president acid data american viral laser density synthesis coal atom committee residues sequences appointed human high surface trna plant time secretary sequences genetic medical infection temperature galaxies rnas 5 Discussion We have proposed a DRFM framework that could be applied to a broad class of applications such as: (i) dynamic topic model for the analysis of time-stamped document collections; (ii) joint analysis of multiple time series, with ordinal valued observations; and (iii) multivariate ordinal dynamic factor analysis or dynamic copula analysis for mixed type of data. The proposed model is a semiparametric methodology, which offers modeling flexibilities and reduces the effect of model misspecification. However, as the marginal likelihood is distribution-free, we could not calculate the model evidence or other evaluation metrics based on it (e.g. held-out likelihood). As a consequence, we are lack of objective evaluation criteria, which allow us to perform formal model comparisons. In our proposed setting, we are able to perform either retrospective analysis or multi-step ahead forecasting (using the recursive equations derived in the FFBS algorithm). Finally, our inference framework is easily adaptable for using sequential Monte Carlo (SMC) methods [33] allowing online learning. Acknowledgments The research reported here was funded in part by ARO, DARPA, DOE, NGA and ONR. The authors are grateful to Jonas Wallin, Lund University, Sweden, for providing efficient package on simulation of the GIG distribution. 8 References [1] J. Aitchison. The statistical analysis of compositional data. J. Roy. Stat. Soc. Ser. B, 44(2):139–177, 1982. [2] S. Chib and R. Winkelmann. Markov chain Monte Carlo analysis of correlated count data. Journal of Business & Economic Statistics, 19(4), 2001. [3] E. Lawrence, D. Bingham, C. Liu, and V. N. Nair. Bayesian inference for multivariate ordinal data using parameter expansion. Technometrics, 50(2), 2008. [4] M. West, P. J. Harrison, and H. S. Migon. Dynamic generalized linear models and Bayesian forecasting. J. Am. Statist. Assoc., 80(389):73–83, 1985. [5] C. Cargnoni, P. M¨uller, and M. West. Bayesian forecasting of multinomial time series through conditionally Gaussian dynamic models. J. Am. Statist. Assoc., 92(438):640–647, 1997. [6] P. D. Hoff. Extending the rank likelihood for semiparametric copula estimation. Ann. Appl. Statist., 1(1):265–283, 2007. [7] D. M. Blei and J. D. Lafferty. Dynamic topic models. In Int. Conf. Machine Learning, 2006. [8] D. M. Blei and J. D. Lafferty. Correlated topic models. In Adv. Neural Inform. Processing Systems, 2006. [9] A. Ahmed and E. P. Xing. Timeline: A dynamic hierarchical dirichlet process model for recovering birth/death and evolution of topics in text stream. 2010. [10] P. D. Hoff. A first course in Bayesian statistical methods. Springer, 2009. [11] A. N. Pettitt. Inference for the linear model using a likelihood based on ranks. J. Roy. Stat. Soc. Ser. B, 44(2):234–243, 1982. [12] J. Aitchison and C. H. Ho. The multivariate Poisson-log normal distribution. Biometrika, 76(4):643–653, 1989. [13] J. S. Murray, D. B. Dunson, L. Carin, and J. E. Lucas. Bayesian Gaussian copula factor models for mixed data. J. Am. Statist. Assoc., 108(502):656–665, 2013. [14] A. Kalaitzis and R. Silva. Flexible sampling of discrete data correlations without the marginal distributions. In Adv. Neural Inform. Processing Systems, 2013. [15] A. Armagan, M. Clyde, and D. B. Dunson. Generalized Beta mixtures of Gaussians. In Adv. Neural Inform. Processing Systems, 2011. [16] N. G. Polson and J. G. Scott. On the half-Cauchy prior for a global scale parameter. Bayesian Analysis, 7(4):887–902, 2012. [17] H. F. Lopes and M. West. Bayesian model assessment in factor analysis. Statistica Sinica, 14(1):41–68, 2004. [18] J. Ghosh and D. B. Dunson. Default prior distributions and efficient posterior computation in Bayesian factor analysis. Journal of Computational and Graphical Statistics, 18(2):306–320, 2009. [19] A. Bhattacharya and D. B. Dunson. Sparse Bayesian infinite factor models. Biometrika, 98(2):291–306, 2011. [20] J. Geweke and G. Zhou. Measuring the pricing error of the arbitrage pricing theory. Review of Financial Studies, 9(2):557–587, 1996. [21] A. Christian, B. Jens, and P. Markus. Bayesian analysis of dynamic factor models: an ex-post approach towards the rotation problem. Kiel Working Papers 1902, Kiel Institute for the World Economy, 2014. [22] C. Gao and B. E. Engelhardt. A sparse factor analysis model for high dimensional latent spaces. In NIPS: Workshop on Analysis Operator Learning vs. Dictionary Learning: Fraternal Twins in Sparse Modeling, 2012. [23] C. K. Carter and R. Kohn. On Gibbs sampling for state space models. Biometrika, 81:541–553, 1994. [24] S. Fr¨uhwirth-Schnatter. Data augmentation and dynamic linear models. Journal of Times Series Analysis, 15:183–202, 1994. [25] D. Inouye, P. Ravikumar, and I. Dhillon. Admixture of Poisson MRFs: A topic model with word dependencies. In Int. Conf. Machine Learning, 2014. [26] D. M. Blei, A. Y. Ng, and M. I. Jordan. Latent Dirichlet allocation. J. Machine Learn. Res., 3:993–1022, 2003. [27] J. Reisinger, A. Waters, B. Silverthorn, and R. J. Mooney. Spherical topic models. In Int. Conf. Machine Learning, 2010. [28] E. A. Reis, E. Salazar, and D. Gamerman. Comparison of sampling schemes for dynamic linear models. International Statistical Review, 74(2):203–214, 2006. [29] A. Korattikara, Y. Chen, and M. Welling. Austerity in MCMC land: cutting the Metropolis-Hastings budget. In Int. Conf. Machine Learning, pages 181–189, 2014. [30] M. Quiroz, M. Villani, and R. Kohn. Speeding up MCMC by efficient data subsampling. arXiv:1404.4178, 2014. [31] C. E. Rasmussen. Gaussian processes in machine learning. Springer, 2004. [32] L. Lin and D. B. Dunson. Bayesian monotone regression using Gaussian process projection. Biometrika, 101(2):303–317, 2014. [33] A. Doucet, D. F. Nando, and N. Gordon. Sequential Monte Carlo methods in practice. Springer, 2001. 9
2014
333
5,440
Consistency of weighted majority votes Daniel Berend Computer Science Department and Mathematics Department Ben Gurion University Beer Sheva, Israel berend@cs.bgu.ac.il Aryeh Kontorovich Computer Science Department Ben Gurion University Beer Sheva, Israel karyeh@cs.bgu.ac.il Abstract We revisit from a statistical learning perspective the classical decision-theoretic problem of weighted expert voting. In particular, we examine the consistency (both asymptotic and finitary) of the optimal Nitzan-Paroush weighted majority and related rules. In the case of known expert competence levels, we give sharp error estimates for the optimal rule. When the competence levels are unknown, they must be empirically estimated. We provide frequentist and Bayesian analyses for this situation. Some of our proof techniques are non-standard and may be of independent interest. The bounds we derive are nearly optimal, and several challenging open problems are posed. 1 Introduction Imagine independently consulting a small set of medical experts for the purpose of reaching a binary decision (e.g., whether to perform some operation). Each doctor has some “reputation”, which can be modeled as his probability of giving the right advice. The problem of weighting the input of several experts arises in many situations and is of considerable theoretical and practical importance. The rigorous study of majority vote has its roots in the work of Condorcet [1]. By the 70s, the field of decision theory was actively exploring various voting rules (see [2] and the references therein). A typical setting is as follows. An agent is tasked with predicting some random variable Y ∈{±1} based on input Xi ∈{±1} from each of n experts. Each expert Xi has a competence level pi ∈ (0, 1), which is the probability of making a correct prediction: P(Xi = Y ) = pi. Two simplifying assumptions are commonly made: (i) Independence: The random variables {Xi : i ∈[n]} are mutually independent conditioned on the truth Y . (ii) Unbiased truth: P(Y = +1) = P(Y = −1) = 1/2. We will discuss these assumptions below in greater detail; for now, let us just take them as given. (Since the bias of Y can be easily estimated from data, only the independence assumption is truly restrictive.) A decision rule is a mapping f : {±1}n →{±1} from the n expert inputs to the agent’s final decision. Our quantity of interest throughout the paper will be the agent’s probability of error, P(f(X) ̸= Y ). (1) A decision rule f is optimal if it minimizes the quantity in (1) over all possible decision rules. It was shown in [2] that, when Assumptions (i)–(ii) hold and the true competences pi are known, the optimal decision rule is obtained by an appropriately weighted majority vote: f OPT(x) = sign n X i=1 wixi ! , (2) 1 where the weights wi are given by wi = log pi 1 −pi , i ∈[n]. (3) Thus, wi is the log-odds of expert i being correct — and the voting rule in (2), also known as naive Bayes [3], may be seen as a simple consequence of the Neyman-Pearson lemma [4]. Main results. The formula in (2) raises immediate questions, which apparently have not previously been addressed. The first one has to do with the consistency of the Nitzan-Paroush optimal rule: under what conditions does the probability of error decay to zero and at what rate? In Section 3, we show that the probability of error is controlled by the committee potential Φ, defined by Φ = n X i=1 (pi −1 2)wi = n X i=1 (pi −1 2) log pi 1 −pi . (4) More precisely, we prove in Theorem 1 that log P(f OPT(X) ̸= Y ) ≍−Φ, where ≍denotes equivalence up to universal multiplicative constants. Another issue not addressed by the Nitzan-Paroush result is how to handle the case where the competences pi are not known exactly but rather estimated empirically by ˆpi. We present two solutions to this problem: a frequentist and a Bayesian one. As we show in Section 4, the frequentist approach does not admit an optimal empirical decision rule. Instead, we analyze empirical decision rules in various settings: high-confidence (i.e., |ˆpi −pi| ≪1) vs. low-confidence, adaptive vs. nonadaptive. The low-confidence regime requires no additional assumptions, but gives weaker guarantees (Theorem 5). In the high-confidence regime, the adaptive approach produces error estimates in terms of the empirical ˆpis (Theorem 7), while the nonadaptive approach yields a bound in terms of the unknown pis, which still leads to useful asymptotics (Theorem 6). The Bayesian solution sidesteps the various cases above, as it admits a simple, provably optimal empirical decision rule (Section 5). Unfortunately, we are unable to compute (or even nontrivially estimate) the probability of error induced by this rule; this is posed as a challenging open problem. 2 Related work Machine learning theory typically clusters weighted majority [5, 6] within the framework of online algorithms; see [7] for a modern treatment. Since the online setting is considerably more adversarial than ours, we obtain very different weighted majority rules and consistency guarantees. The weights wi in (2) bear a striking similarity to the Adaboost update rule [8, 9]. However, the latter assumes weak learners with access to labeled examples, while in our setting the experts are “static”. Still, we do not rule out a possible deeper connection between the Nitzan-Paroush decision rule and boosting. In what began as the influential Dawid-Skene model [10] and is now known as crowdsourcing, one attempts to extract accurate predictions by pooling a large number of experts, typically without the benefit of being able to test any given expert’s competence level. Still, under mild assumptions it is possible to efficiently recover the expert competences to a high accuracy and to aggregate them effectively [11]. Error bounds for the oracle MAP rule were obtained in this model by [12] and minimax rates were given in [13]. In a recent line of work [14, 15, 16] have developed a PAC-Bayesian theory for the majority vote of simple classifiers. This approach facilitates data-dependent bounds and is even flexible enough to capture some simple dependencies among the classifiers — though, again, the latter are learners as opposed to our experts. Even more recently, experts with adversarial noise have been considered [17], and efficient algorithms for computing optimal expert weights (without error analysis) were given [18]. More directly related to the present work are the papers of [19], which characterizes the consistency of the simple majority rule, and [20, 21, 22] which analyze various models of dependence among the experts. 2 3 Known competences In this section we assume that the expert competences pi are known and analyze the consistency of the Nitzan-Paroush optimal decision rule (2). Our main result here is that the probability of error P(f OPT(X) ̸= Y ) is small if and only if the committee potential Φ is large. Theorem 1. Suppose that the experts X = (X1, . . . , Xn) satisfy Assumptions (i)-(ii) and f OPT : {±1}n →{±1} is the Nitzan-Paroush optimal decision rule. Then (i) P(f OPT(X) ̸= Y ) ≤exp −1 2Φ  . (ii) P(f OPT(X) ̸= Y ) ≥ 3 8[1 + exp(2Φ + 4 √ Φ)] . As we show in the full paper [27], the upper and lower bounds are both asymptotically tight. The remainder of this section is devoted to proving Theorem 1. 3.1 Proof of Theorem 1(i) Define the {0, 1}-indicator variables ξi = 1{Xi=Y }, (5) corresponding to the event that the ith expert is correct. A mistake f OPT(X) ̸= Y occurs precisely when1 the sum of the correct experts’ weights fails to exceed half the total mass: P(f OPT(X) ̸= Y ) = P n X i=1 wiξi ≤1 2 n X i=1 wi ! . (6) Since Eξi = pi, we may rewrite the probability in (6) as P X i wiξi ≤E "X i wiξi # − X i (pi −1 2)wi ! . (7) A standard tool for estimating such sum deviation probabilities is Hoeffding’s inequality. Applied to (7), it yields the bound P(f OPT(X) ̸= Y ) ≤exp −2 P i(pi −1 2)wi 2 P i w2 i ! , (8) which is far too crude for our purposes. Indeed, consider a finite committee of highly competent experts with pi’s arbitrarily close to 1 and X1 the most competent of all. Raising X1’s competence sufficiently far above his peers will cause both the numerator and the denominator in the exponent to be dominated by w2 1, making the right-hand-side of (8) bounded away from zero. The inability of Hoeffding’s inequality to guarantee consistency even in such a felicitous setting is an instance of its generally poor applicability to highly heterogeneous sums, a phenomenon explored in some depth in [23]. Bernstein’s and Bennett’s inequalities suffer from a similar weakness (see ibid.). Fortunately, an inequality of Kearns and Saul [24] is sufficiently sharp to yield the desired estimate: For all p ∈[0, 1] and all t ∈R, (1 −p)e−tp + pet(1−p) ≤exp  1 −2p 4 log((1 −p)/p)t2  . (9) Remark. The Kearns-Saul inequality (9) may be seen as a distribution-dependent refinement of Hoeffding’s (which bounds the left-hand-side of (9) by et2/8), and is not nearly as straightforward to prove. An elementary rigorous proof is given in [25]. Following up, [26] gave a “soft” proof based on transportation and information-theoretic techniques. 1 Without loss of generality, ties are considered to be errors. 3 Put θi = ξi −pi, substitute into (6), and apply Markov’s inequality: P(f OPT(X) ̸= Y ) = P − X i wiθi ≥Φ ! ≤e−tΦEexp −t X i wiθi ! . (10) Now Ee−twiθi = pie−(1−pi)wit + (1 −pi)epiwit ≤ exp  −1 + 2pi 4 log(pi/(1 −pi))w2 i t2  = exp  1 2(pi −1 2)wit2 , (11) where the inequality follows from (9). By independence, E exp −t X i wiθi ! = Y i Ee−twiθi ≤exp 1 2 X i (pi −1 2)wit2 ! = exp 1 2Φt2 and hence P(f OPT(X) ̸= Y ) ≤exp 1 2Φt2 −Φt  . Choosing t = 1 yields the bound in Theorem 1(i). 3.2 Proof of Theorem 1(ii) Define the {±1}-indicator variables ηi = 2 · 1{Xi=Y } −1, (12) corresponding to the event that the ith expert is correct and put qi = 1 −pi. The shorthand w · η = Pn i=1 wiηi will be convenient. We will need some simple lemmata, whose proofs are deferred to the journal version [27]. Lemma 2. P(f OPT(X) = Y ) = 1 2 X η∈{±1}n max {P(η), P(−η)} and P(f OPT(X) ̸= Y ) = 1 2 X η∈{±1}n min {P(η), P(−η)} , where P(η) = Q i:ηi=1 pi Q i:ηi=−1 qi. Lemma 3. Suppose that s, s′ ∈(0, ∞)m satisfy Pm i=1(si + s′ i) ≥a and R−1 ≤si/s′ i ≤R, i ∈[m], for some R < ∞. Then Pm i=1 min {si, s′ i} ≥a/(1 + R). Lemma 4. Define the function F : (0, 1) →R by F(x) = x(1 −x) log(x/(1 −x)) 2x −1 . Then sup0<x<1 F(x) = 1 2. Continuing with the main proof, observe that E [w · η] = n X i=1 (pi −qi)wi = 2Φ (13) and Var [w · η] = 4 Pn i=1 piqiw2 i . By Lemma 4, piqiw2 i ≤1 2(pi −qi)wi, and hence Var [w · η] ≤ 4Φ. (14) Define the segment I ⊂R by I = h 2Φ −4 √ Φ, 2Φ + 4 √ Φ i . (15) Chebyshev’s inequality together with (13) and (14) implies that P (w · η ∈I) ≥ 3 4. (16) 4 Consider an atom η ∈{±1}n for which w · η ∈I. The proof of Lemma 2 shows that P(η) P(−η) = exp (w · η) ≤exp(2Φ + 4 √ Φ), (17) where the inequality follows from (15). Lemma 2 further implies that P(f OPT(X) ̸= Y ) ≥1 2 X η∈{±1}n:w·η∈I min {P(η), P(−η)} ≥ 3/4 1 + exp(2Φ + 4 √ Φ) , where the second inequality follows from Lemma 3, (16) and (17). This completes the proof. 4 Unknown competences: frequentist Our goal in this section is to obtain, insofar as possible, analogues of Theorem 1 for unknown expert competences. When the pis are unknown, they must be estimated empirically before any useful weighted majority vote can be applied. There are various ways to model partial knowledge of expert competences [28, 29]. Perhaps the simplest scenario for estimating the pis is to assume that the ith expert has been queried independently mi times, out of which he gave the correct prediction ki times. Taking the {mi} to be fixed, define the committee profile by k = (k1, . . . , kn); this is the aggregate of the agent’s empirical knowledge of the experts’ performance. An empirical decision rule ˆf : (x, k) 7→{±1} makes a final decision based on the expert inputs x together with the committee profile. Analogously to (1), the probability of a mistake is P( ˆf(X, K) ̸= Y ). (18) Note that now the committee profile is an additional source of randomness. Here we run into our first difficulty: unlike the probability in (1), which is minimized by the Nitzan-Paroush rule, the agent cannot formulate an optimal decision rule ˆf in advance without knowing the pis. This is because no decision rule is optimal uniformly over the range of possible pis. Our approach will be to consider weighted majority decision rules of the form ˆf(x, k) = sign n X i=1 ˆw(ki)xi ! (19) and to analyze their consistency properties under two different regimes: low-confidence and highconfidence. These refer to the confidence intervals of the frequentist estimate of pi, given by ˆpi = ki mi . (20) 4.1 Low-confidence regime In the low-confidence regime, the sample sizes mi may be as small as 1, and we define2 ˆw(ki) = ˆwLC i := ˆpi −1 2, i ∈[n], (21) which induces the empirical decision rule ˆf LC. It remains to analyze ˆf LC’s probability of error. Recall the definition of ξi from (5) and observe that E  ˆwLC i ξi  = E[(ˆpi −1 2)ξi] = (pi −1 2)pi, (22) since ˆpi and ξi are independent. As in (6), the probability of error (18) is P n X i=1 ˆwLC i ξi ≤1 2 n X i=1 ˆwLC i ! = P n X i=1 Zi ≤0 ! , (23) 2 For mi min {pi, qi} ≪1, the estimated competences ˆpi may well take values in {0, 1}, in which case log(ˆpi/ˆqi) = ±∞. The rule in (21) is essentially a first-order Taylor approximation to w(·) about p = 1 2. 5 where Zi = ˆwLC i (ξi −1 2). Now the {Zi} are independent random variables, EZi = (pi −1 2)2 (by (22)), and each Zi takes values in an interval of length 1 2. Hence, the standard Hoeffding bound applies: P( ˆf LC(X, K) ̸= Y ) ≤exp  −8 n n X i=1 (pi −1 2)2 !2 . (24) We summarize these calculations in Theorem 5. A sufficient condition for P( ˆf LC(X, K) ̸= Y ) →0 is 1 √n Pn i=1(pi −1 2)2 →∞. Several remarks are in order. First, notice that the error bound in (24) is stated in terms of the unknown {pi}, providing the agent with large-committee asymptotics but giving no finitary information; this limitation is inherent in the low-confidence regime. Secondly, the condition in Theorem 5 is considerably more restrictive than the consistency condition Φ →∞implicit in Theorem 1. Indeed, the empirical decision rule ˆf LC is incapable of exploiting a single highly competent expert in the way that f OPT from (2) does. Our analysis could be sharpened somewhat for moderate sample sizes {mi} by using Bernstein’s inequality to take advantage of the low variance of the ˆpis. For sufficiently large sample sizes, however, the high-confidence regime (discussed below) begins to take over. Finally, there is one sense in which this case is “easier” to analyze than that of known {pi}: since the summands in (23) are bounded, Hoeffding’s inequality gives nontrivial results and there is no need for more advanced tools such as the Kearns-Saul inequality (9) (which is actually inapplicable in this case). 4.2 High-confidence regime In the high-confidence regime, each estimated competence ˆpi is close to the true value pi with high probability. To formalize this, fix some 0 < δ < 1, 0 < ε ≤5, and put qi = 1 −pi, ˆqi = 1 −ˆpi. We will set the empirical weights according to the “plug-in” Nitzan-Paroush rule ˆwHC i := log ˆpi ˆqi , i ∈[n], (25) which induces the empirical decision rule ˆf HC and raises immediate concerns about ˆwHC i = ±∞. We give two kinds of bounds on P( ˆf HC ̸= Y ): nonadaptive and adaptive. In the nonadaptive analysis, we show that for mi min {pi, qi} ≫1, with high probability |wi −ˆwHC i | ≪1, and thus a “perturbed” version of Theorem 1(i) holds (and in particular, wHC i will be finite with high probability). In the adaptive analysis, we allow ˆwHC i to take on infinite values3 and show (perhaps surprisingly) that this decision rule also asymptotically achieves the rate of Theorem 1(i). Nonadaptive analysis. The following result captures our analysis of the nonadaptive agent: Theorem 6. Let 0 < δ < 1 and 0 < ε < min {5, 2Φ/n}. If mi min {pi, qi} ≥3 √4ε + 1 −1 4 −2 log 4n δ , i ∈[n], (26) then P  ˆf HC(X, K) ̸= Y  ≤δ + exp  −(2Φ −εn)2 8Φ  . (27) Remark. For fixed {pi} and mini∈[n] mi →∞, we may take δ and ε arbitrarily small — and in this limiting case, the bound of Theorem 1(i) is recovered. 3 When the decision rule is faced with evaluating sums involving ∞−∞, we automatically count this as an error. 6 Adaptive analysis. Theorem 6 has the drawback of being nonadaptive, in that its assumptions (26) and conclusions (27) depend on the unknown {pi} and hence cannot be evaluated by the agent (the bound in (24) is also nonadaptive4). In the adaptive (fully empirical) approach, all results are stated in terms of empirically observed quantities: Theorem 7. Choose any5 δ ≥ Pn i=1 1 √mi and let R be the event where exp −1 2 Pn i=1(ˆpi −1 2) ˆwHC i  ≤δ 2. Then P  R ∩ n ˆf HC(X, K) ̸= Y o ≤δ. Remark 1. Our interpretation for Theorem 7 is as follows. The agent observes the committee profile K, which determines the {ˆpi, ˆwHC i }, and then checks whether the event R has occurred. If not, the adaptive agent refrains from making a decision (and may choose to fall back on the low-confidence approach described previously). If R does hold, however, the agent predicts Y according to ˆf HC. Observe that the event R will only occur if the empirical committee potential ˆΦ = Pn i=1(ˆpi−1 2) ˆwHC i is sufficiently large — i.e., if enough of the experts’ competences are sufficiently far from 1 2. But if this is not the case, little is lost by refraining from a high-confidence decision and defaulting to a low-confidence one, since near 1 2, the two decision procedures are very similar. As explained above, there does not exist a nontrivial a priori upper bound on P( ˆf HC(X, K) ̸= Y ) absent any knowledge of the pis. Instead, Theorem 7 bounds the probability of the agent being “fooled” by an unrepresentative committee profile.6 Note that we have done nothing to prevent ˆwHC i = ±∞, and this may indeed happen. Intuitively, there are two reasons for infinite ˆwHC i : (a) noisy ˆpi due to mi being too small, or (b) the ith expert is actually highly (in)competent, which causes ˆpi ∈{0, 1} to be likely even for large mi. The 1/√mi term in the bound insures against case (a), while in case (b), choosing infinite ˆwHC i causes no harm (as we show in the proof). Proof of Theorem 7. We will write the probability and expectation operators with subscripts (such as K) to indicate the random variable(s) being summed over. Thus, PK,X,Y  R ∩ n ˆf HC(X, K) ̸= Y o = PK,η R ∩  ˆwHC · η ≤0  = EK  1R · Pη ˆwHC · η ≤0 | K  . Recall that the random variable η ∈{±1}n, with probability mass function P(η) = Q i:ηi=1 pi Q i:ηi=−1 qi, is independent of K, and hence Pη ˆwHC · η ≤0 | K  = Pη ˆwHC · η ≤0  . (28) Define the random variable ˆη ∈{±1}n (conditioned on K) by the probability mass function P(ˆη) = Q i:ηi=1 ˆpi Q i:ηi=−1 ˆqi, and the set A ⊆{±1}n by A =  x : ˆwHC · x ≤0 . Now Pη ˆwHC · η ≤0  −Pˆη ˆwHC · ˆη ≤0  = |Pη (A) −Pˆη (A)| ≤ max A⊆{±1}n |Pη (A) −Pˆη (A)| = ∥Pη −Pˆη∥TV ≤ n X i=1 |pi −ˆpi| =: M, where the last inequality follows from a standard tensorization property of the total variation norm ∥·∥TV, see e.g. [33, Lemma 2.2]. By Theorem 1(i), we have Pˆη ˆwHC · ˆη ≤0  ≤ exp −1 2 Pn i=1(ˆpi −1 2) ˆwHC i  , and hence Pη ˆwHC · η ≤0  ≤M + exp −1 2 Pn i=1(ˆpi −1 2) ˆwHC i  . Invoking (28), we substitute the right-hand side above into (28) to obtain PK,X,Y  R ∩ n ˆf HC(X, K) ̸= Y o ≤ EK " 1R · M + exp −1 2 n X i=1 (ˆpi −1 2) ˆwHC i !!# ≤ EK[M] + EK " 1R exp −1 2 n X i=1 (ˆpi −1 2) ˆwHC i !# . 4The term oracle was suggested by a referee for this setting. 5 Actually, as the proof will show, we may take δ to be a smaller value, but with a more complex dependence on {mi}, which simplifies to 2[1 −(1 −(2√m)−1)n] for mi ≡m. 6These adaptive bounds are similar in spirit to empirical Bernstein methods, [30, 31, 32], where the agent’s confidence depends on the empirical variance. 7 By the definition of R, the second term on the last right-hand side is upper-bounded by δ/2. To estimate M, we invoke a simple mean absolute deviation bound (cf. [34]): EK |pi −ˆpi| ≤ s pi(1 −pi) mi ≤ 1 2√mi , which finishes the proof. Remark. The improvement mentioned in Footnote 5 is achieved via a refinement of the bound ∥Pη −Pˆη∥TV ≤Pn i=1 |pi −ˆpi| to ∥Pη −Pˆη∥TV ≤α ({|pi −ˆpi| : i ∈[n]}), where α(·) is the function defined in [33, Lemma 4.2]. Open problem. As argued in Remark 1, Theorem 7 achieves the optimal asymptotic rate in {pi}. Can the dependence on {mi} be improved, perhaps through a better choice of ˆwHC? 5 Unknown competences: Bayesian A shortcoming of Theorem 7 is that when condition R fails, the agent is left with no estimate of the error probability. An alternative (and in some sense cleaner) approach to handling unknown expert competences pi is to assume a known prior distribution over the competence levels pi. The natural choice of prior for a Bernoulli parameter is the Beta distribution, namely pi ∼Beta(αi, βi) with density p αi−1 i q βi−1 i B(αi,βi) , where αi, βi > 0, qi = 1 −pi and B(x, y) = Γ(x)Γ(y)/Γ(x + y). Our full probabilistic model is as follows. Each of the n expert competences pi is drawn independently from a Beta distribution with known parameters αi, βi. Then the ith expert, i ∈[n], is queried independently mi times, with ki correct predictions and mi−ki incorrect ones. As before, K = (k1, . . . , kn) is the (random) committee profile. Absent direct knowledge of the pis, the agent relies on an empirical decision rule ˆf : (x, k) 7→{±1} to produce a final decision based on the expert inputs x together with the committee profile k. A decision rule ˆf Ba is Bayes-optimal if it minimizes P( ˆf(X, K) ̸= Y ), which is formally identical to (18) but semantically there is a difference: the former is over the pi in addition to (X, Y, K). Unlike the frequentist approach, where no optimal empirical decision rule was possible, the Bayesian approach readily admits one: ˆf Ba(x, k) = sign (Pn i=1 ˆwBa i xi), where ˆwBa i = log αi + ki βi + mi −ki . (29) Notice that for 0 < pi < 1, we have ˆwBa i −→ mi→∞wi, almost surely, both in the frequentist and the Bayesian interpretations. Unfortunately, although P( ˆf Ba(X, K) ̸= Y ) = P( ˆwBa · η ≤0) is a deterministic function of {αi, βi, mi}, we are unable to compute it at this point, or even give a non-trivial bound. The main source of difficulty is the coupling between ˆwBa and η. Open problem. Give a non-trivial estimate for P( ˆf Ba(X, K) ̸= Y ). 6 Discussion The classic and seemingly well-understood problem of the consistency of weighted majority votes continues to reveal untapped depth and suggest challenging unresolved questions. We hope that the results and open problems presented here will stimulate future research. References [1] J.A.N. de Caritat marquis de Condorcet. Essai sur l’application de l’analyse `a la probabilit´e des d´ecisions rendues `a la pluralit´e des voix. AMS Chelsea Publishing Series. Chelsea Publishing Company, 1785. [2] S. Nitzan, J. Paroush. Optimal decision rules in uncertain dichotomous choice situations. International Economic Review, 23(2):289–297, 1982. [3] T. Hastie, R. Tibshirani, J. Friedman. The Elements of Statistical Learning: Data Mining, Inference, and Prediction. 2009. 8 [4] J. Neyman, E. S. Pearson. On the problem of the most efficient tests of statistical hypotheses. Phil. Trans. Royal Soc. A: Math., Physi. Eng. Sci., 231(694-706):289–337, 1933. [5] N. Littlestone, M. K. Warmuth. The weighted majority algorithm. In FOCS, 1989. [6] N. Littlestone, M. K. Warmuth. The weighted majority algorithm. Inf. Comput., 108(2):212–261, 1994. [7] N. Cesa-Bianchi, G. Lugosi. Prediction, learning, and games. 2006. [8] Y. Freund, R. E. Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. J. Comput. Syst. Sci., 55(1):119–139, 1997. [9] R. E. Schapire, Y. Freund. Boosting. Foundations and algorithms. 2012. [10] A. P. Dawid and A. M. Skene. Maximum likelihood estimation of observer error-rates using the EM algorithm. Applied Statistics, 28(1):20–28, 1979. [11] F. Parisi, F. Strino, B. Nadler, Y. Kluger. Ranking and combining multiple predictors without labeled data. Proc. Nat. Acad. Sci., 2014+. [12] H. Li, B. Yu, D. Zhou. Error rate bounds in crowdsourcing models. CoRR, abs/1307.2674, 2013. [13] C. Gao, D. Zhou. Minimax Optimal Convergence Rates for Estimating Ground Truth from Crowdsourced Labels (arXiv:1310.5764), 2014. [14] A. Lacasse, F. Laviolette, M. Marchand, P. Germain, N. Usunier. PAC-Bayes bounds for the risk of the majority vote and the variance of the gibbs classifier. In NIPS, 2006. [15] F. Laviolette, M. Marchand. PAC-Bayes risk bounds for stochastic averages and majority votes of samplecompressed classifiers. JMLR, 8:1461–1487, 2007. [16] J.-F. Roy, F. Laviolette, M. Marchand. From PAC-Bayes bounds to quadratic programs for majority votes. In ICML, 2011. [17] Y. Mansour, A. Rubinstein, M. Tennenholtz. Robust aggregation of experts signals, preprint 2013. [18] E. Eban, E. Mezuman, A. Globerson. Discrete chebyshev classifiers. In ICML (2), 2014. [19] D. Berend, J. Paroush. When is Condorcet’s jury theorem valid? Soc. Choice Welfare, 15(4):481–488, 1998. [20] P. J. Boland, F. Proschan, Y. L. Tong. Modelling dependence in simple and indirect majority systems. J. Appl. Probab., 26(1):81–88, 1989. [21] D. Berend, L. Sapir. Monotonicity in Condorcet’s jury theorem with dependent voters. Social Choice and Welfare, 28(3):507–528, 2007. [22] D. P. Helmbold and P. M. Long. On the necessity of irrelevant variables. JMLR, 13:2145–2170, 2012. [23] D. A. McAllester, L. E. Ortiz. Concentration inequalities for the missing mass and for histogram rule error. JMLR, 4:895–911, 2003. [24] M. J. Kearns, L. K. Saul. Large deviation methods for approximate probabilistic inference. In UAI, 1998. [25] D. Berend, A. Kontorovich. On the concentration of the missing mass. Electron. Commun. Probab., 18(3), 1–7, 2013. [26] M. Raginsky, I. Sason. Concentration of measure inequalities in information theory, communications and coding. Foundations and Trends in Communications and Information Theory, 10(1-2):1–247, 2013. [27] D. Berend, A. Kontorovich. A finite-sample analysis of the naive Bayes classifier. Preprint, 2014. [28] E. Baharad, J. Goldberger, M. Koppel, S. Nitzan. Distilling the wisdom of crowds: weighted aggregation of decisions on multiple issues. Autonomous Agents and Multi-Agent Systems, 22(1):31–42, 2011. [29] E. Baharad, J. Goldberger, M. Koppel, S. Nitzan. Beyond condorcet: optimal aggregation rules using voting records. Theory and Decision, 72(1):113–130, 2012. [30] J.-Y. Audibert, R. Munos, C. Szepesv´ari. Tuning bandit algorithms in stochastic environments. In ALT, 2007. [31] V. Mnih, C. Szepesv´ari, J.-Y. Audibert. Empirical Bernstein stopping. In ICML, 2008. [32] A. Maurer, M. Pontil. Empirical Bernstein bounds and sample-variance penalization. In COLT, 2009. [33] A. Kontorovich. Obtaining measure concentration from Markov contraction. Markov Proc. Rel. Fields, 4:613–638, 2012. [34] D. Berend, A. Kontorovich. A sharp estimate of the binomial mean absolute deviation with applications. Statistics & Probability Letters, 83(4):1254–1259, 2013. 9
2014
334
5,441
Modeling Deep Temporal Dependencies with Recurrent “Grammar Cells” Vincent Michalski Goethe University Frankfurt, Germany vmichals@rz.uni-frankfurt.de Roland Memisevic University of Montreal, Canada roland.memisevic@umontreal.ca Kishore Konda Goethe University Frankfurt, Germany konda.kishorereddy@gmail.com Abstract We propose modeling time series by representing the transformations that take a frame at time t to a frame at time t+1. To this end we show how a bi-linear model of transformations, such as a gated autoencoder, can be turned into a recurrent network, by training it to predict future frames from the current one and the inferred transformation using backprop-through-time. We also show how stacking multiple layers of gating units in a recurrent pyramid makes it possible to represent the ”syntax” of complicated time series, and that it can outperform standard recurrent neural networks in terms of prediction accuracy on a variety of tasks. 1 Introduction The predominant paradigm of modeling time series is based on state-space models, in which a hidden state evolves according to some predefined dynamical law, and an observation model maps the state to the dataspace. In this work, we explore an alternative approach to modeling time series, where learning amounts to finding an explicit representation of the transformation that takes an observation at time t to the observation at time t + 1. Modeling a sequence in terms of transformations makes it very easy to exploit redundancies that would be hard to capture otherwise. For example, very little information is needed to specify an element of the signal class sine-wave, if it is represented in terms of a linear mapping that takes a snippet of signal to the next snippet: given an initial “seed”-frame, any two sine-waves differ only by the amount of phase shift that the linear transformation has to repeatedly apply at each time step. In order to model a signal as a sequence of transformations, it is necessary to make transformations “first-class objects”, that can be passed around and picked up by higher layers in the network. To this end, we use bilinear models (e.g. [1, 2, 3]) which use multiplicative interactions to extract transformations from pairs of observations. We show that deep learning which is proven to be effective in learning structural hierarchies can also learn to capture hierarchies of relations or transformations. A deep model can be built by stacking multiple layers of the transformation model, so that higher layers capture higher-oder transformations (that is, transformations between transformations). To be able to model multiple steps of a time-series, we propose a training scheme called predictive training: after computing a deep representation of the dynamics from the first frames of a time series, the model predicts future frames by repeatedly applying the transformations passed down by higher layers, assuming constancy of the transformation in the top-most layer. Derivatives are computed using back-prop through time (BPTT) [4]. We shall refer to this model as a predictive gating pyramid (PGP) in the following. 1 Since hidden units at each layer encode transformations, not content of their inputs, they capture only structural dependencies and we refer to them as “grammar cells.”1 The model can also be viewed as a higher-order partial difference equation whose parameters are estimated from data. Generating from the model amounts to providing boundary conditions in the form of seed-frames, whose number corresponds to the number of layers (the order of the difference equation). We demonstrate that a two-layer model is already surprisingly effective at capturing whole classes of complicated time series, including frequency-modulated sine-waves (also known as “chirps”) which we found hard to represent using standard recurrent networks. 1.1 Related Work LSTM units [5] also use multiplicative interactions, in conjunction with self-connections of weight 1, to model long-term dependencies and to avoid vanishing gradients problems [6]. Instead of constant self-connections, the lower-layer units in our model can represent long-term structure by using dynamically changing orthogonal transformations as we shall show. Other related work includes [7], where multiplicative interactions are used to let inputs modulate connections between successive hidden states of a recurrent neural network (RNN), with application to modeling text. Our model also bears some similarity to [3] who model MOCAP data using a three-way Restricted Boltzmann Machine, where a second layer of hidden units can be used to model more “abstract” features of the time series. In contrast to that work, our higher-order units which are bi-linear too, are used to explicitly model higher-order transformations. More importantly, we use predictive training using backprop through time for our model, which is crucial for achieving good performance as we show in our experiments. Other approaches to sequence modeling include [8], who compress sequences using a two-layer RNN, where the second layer predicts residuals, which the first layer fails to predict well. In our model, compression amounts to exploiting redundancies in the relations between successive sequence elements. In contrast to [9] who introduce a recursive bi-linear autoencoder for modeling language, our model is recurrent and trained to predict, not reconstruct. The model by [10] is similar to our model in that it learns the dynamics of sequences, but assumes a simple autoregressive, rather than deep, compositional dependence, on the past. An early version of our work is described in [11]. Our work is also loosely related to sequence based invariance [12] and slow feature analysis [13], because hidden units are designed to extract structure that is invariant in time. In contrast to that work, our multi-layer models assume higher-order invariances, that is, invariance of velocity in the case of one hidden layer, of acceleration in the case of two, of jerk (the rate of change of acceleration) in the case of three, etc. 2 Background on Relational Feature Learning In order to learn transformation features, m, that represent the relationship between two observations x(1) and x(2) it is necessary to learn a basis that can represent the correlation structure across the observations. In a time series, knowledge of one frame, x(1), typically highly constrains the distribution over possible next frames, x(2). This suggests modeling x(2) using a feature learning model whose parameters are a function of x(1) [14], giving rise to bi-linear models of transformations, such as the Gated Boltzmann Machine [15, 3], Gated Autoencoder [16], and similar models (see [14] for an overview). Formally, bi-linear models learn to represent a linear transformation, L, between two observations x(1) and x(2), where x(2) = Lx(1). (1) Bi-linear models encode the transformation in a layer of mapping units that get tuned to rotation angles in the invariant subspaces of the transformation class [14]. We shall focus on the gated autoencoder (GAE) in the following but our description could be easily adapted to other bi-linear models. Formally, the response of a layer of mapping units in the GAE takes the form2 m = σ W(Ux(1) · Vx(2))  . (2) 1We dedicate this paper to the venerable grandmother cell, a grandmother of the grammar cell. 2We are only using “factored” [15] bi-linear models in this work, but the framework presented in this work could be applied to unfactored models, too. 2 where U, V and W are parameter matrices, · denotes elementwise multiplication, and σ is an elementwise non-linearity, such as the logistic sigmoid. Given mapping unit activations, m, and the first observation, x(1), the second observation can be reconstructed using ˜x(2) = VTUx(1) · WTm  (3) which amounts to applying the transformation encoded in m to x(1) [16]. As the model is symmetric, the reconstruction of the first observation, given the second, is similarly given by ˜x(1) = UTVx(2) · WTm  . (4) For training one can minimize the symmetric reconstruction error L = ||x(1) −˜x(1)||2 + ||x(2) −˜x(2)||2. (5) Training turns the rows of U and V into filter pairs which reside in the invariant subspaces of the transformation class on which the model was trained. After learning, each pair is tuned to a particular rotation angle in the subspace, and the components of m are consequently tuned to subspace rotation angles. Due to the pooling layer, W, they are furthermore independent of the absolute angles in the subspaces [14]. 3 Higher-Order Relational Features Alternatively, one can think of the bilinear model as performing a first-order Taylor approximation of the input sequence, where the hidden representation models the partial first-order derivatives of the inputs with respect to time. If we assume constancy of the first-order derivatives (or higher-order derivates, as we shall discuss), the complete sequence can be encoded using information about a single frame and the derivatives. This is a very different way of addressing long-range correlations than assuming memory units that explicitly keep state [5]. Instead, here we assume that there is structure in the temporal evolution of the input stream and we focus on capturing this structure. As an intuitive example, consider a sinusoidal signal with unknown frequency and phase. The complete signal can be specified exactly and completely after having seen a few seed frames, making it possible in principle to generate the rest of the signal ad infinitum. 3.1 Learning of Higher-Order Relational Features The first-order partial derivative of a multidimensional discrete-time dynamical system describes the correspondences between observations at subsequent time steps. The fact that relational feature learning applied to subsequent frames may be viewed as a way to learn these derivatives, suggests modeling higher-order derivatives with another layer of relational features. To this end, we suggest cascading relational features in a “pyramid” as depicted in Figure 1 on the left.3 Given a sequence of inputs x(t−2), x(t−1), x(t), first-order relational features m(t−1:t) 1 describe the transformations between two subsequent inputs x(t−1) and x(t). Second-order relational features m(t−2:t) 2 describe correspondences between two first-order relational features m(t−2:t−1) 1 and m(t−1:t) 1 , modeling the “second-order derivatives” of the signal with respect to time. To learn the higher-order features, we can first train a bottom-layer GAE module to represent correspondences between frame pairs using filter matrices U1, V1 and W1 (the subscript index refers to the layer). From the first-layer module we can infer mappings m(t−2:t−1) 1 and m(t−1:t) 1 for overlapping input pairs (x(t−2), x(t−1)) and (x(t−1), x(t)), and use these as inputs to a second-layer GAE module. A second GAE can then learn to represent relations between mappings of the first-layer using parameters U2, V2 and W2. Inference of second-order relational features amounts to computing first- and second-order mappings according to m(t−2:t−1) 1 = σ W1 (U1x(t−2)) · (V1x(t−1))  (6) m(t−1:t) 1 = σ W1 (U1x(t−1)) · (V1x(t))  (7) m(t−2:t) 2 = σ W2 (U2m(t−2:t−1) 1 ) · (V2m(t−1:t) 1 )  . (8) 3Images taken from the NORB data set described in [17] 3 Figure 1: Left: A two-layer model encodes a sequence by assuming constant “acceleration”. Right: Prediction using first-order relational features. Like a mixture of experts, a bi-linear model represents a highly non-linear mapping from x(1) to x(2) as a mixture of linear (and thereby possibly orthogonal) transformations. Similar to the LSTM, this facilitates error back-propagation, because orthogonal transformations do not suffer from vanishing/exploding gradient problems. This may be viewed as a way of generalizing LSTM [5] which uses the identity matrix as the orthogonal transformation. “Grammar units” in contrast try to model long-term structure that is dynamic and compositional rather than remembering a fixed value. Cascading GAE modules in this way can also be motivated from the view of orthogonal transformations as subspace rotations: summing over filter-response products can yield transformation detectors which are sensitive to relative angles (phases in the case of translations) and invariant to the absolute angles [14]. The relative rotation angle (or phase delta) between two projections is itself an angle, and the relation between two such angles represents an “angular acceleration” that can be picked up by another layer. In contrast to a single-layer, two-frame model, the reconstruction error is no longer directly applicable (although a naive way to train the model would be to minimize reconstruction error for each pair of adjacent nodes in each layer). However, a natural way of training the model on sequential data is to replace the reconstruction task with the objective of predicting future frames as we discuss next. 4 Predictive Training 4.1 Single-Step Prediction In the GAE model, given two frames x(1) and x(2) one can compute a prediction of the third frame by first inferring mappings m(1,2) from x(1) and x(2) (see Equation 2) and using these to compute a prediction ˆx(3) by applying the inferred transformation m(1,2) to frame x(2) ˆx(3) = VTUx(2) · WTm(1,2) . (9) See Figure 1 (right side) for an outline of the prediction scheme. The prediction of x(3) is a good prediction under the assumption that frame-to-frame transformations from x(1) to x(2) and from x(2) to x(3) are approximately the same, in other words if transformations themselves are assumed to be approximately constant in time. We shall show later how to relax the assumption of constancy of the transformation by adding layers to the model. The training criterion for this predictive gating pyramid (PGP) is the prediction error L = ||ˆx(3) −x(3)||2 2. (10) Besides allowing us to apply bilinear models to sequences, this training objective, in contrast to the reconstruction objective, can guide the mapping representation to be invariant to the content of each frame, because encoding the content of x(2) will not help predicting x(3) well. 4.2 Multi-Step Prediction and Non-Constant Transformations We can iterate the inference-prediction process in order to look ahead more than one frame in time. To compute a prediction ˆx(4) with the PGP, for example, we can infer the mappings and prediction: m(2:3) = σ W(Ux(2) · Vˆx(3))  , ˆx(4) = VTUˆx(3) · WTm(2:3) . (11) 4 Figure 2: Left: Prediction with a 2-layer PGP. Right: Multi-step prediction with a 3-layer PGP. Then mappings can be inferred again from ˆx(3) and ˆx(4) to compute a prediction of ˆx(5), and so on. When the assumption of constancy of the transformations is violated, one can use an additional layer to model how transformations themselves change over time as described in Section 3. The assumption behind the two-layer PGP is that the second-order relational structure in the sequence is constant. Under this assumption, we compute a prediction ˆx(t+1) in two steps after inferring m(t−2:t) 2 according to Equation 8: First, first-order relational features describing the correspondence between x(t) and x(t+1) are inferred top-down as ˆm(t:t+1) 1 = V2 TU2m(t−1:t) 1 · WT 2 m(t−2:t) 2  , (12) from which we can compute ˆx(t+1) as ˆx(t+1) = V1 TU1x(t) · WT 1 ˆm(t:t+1) 1  . (13) See Figure 2 (left side) for an illustration of the two-layer prediction scheme. To predict multiple steps ahead we repeat the inference-prediction process on x(t−1), x(t) and ˆx(t+1), i.e. by appending the prediction to the sequence and increasing t by one. As outlined in Figure 2 (right side), the concept can be generalized to more than two layers by recursion to yield higher-order relational features. Weights can be shared across layers, but we used untied weights in our experiments. To summarize, the prediction process consists in iteratively computing predictions of the next lower levels activations beginning from the top. To infer the top-level activations themselves, one needs a number of seed frames corresponding to the depth of the model. The models can be trained using BPTT to compute gradients of the k-step prediction error (the sum of prediction errors) with respect to the parameters. We observed that starting with few prediction steps and iteratively increasing the number of prediction steps as training progresses considerably stabilizes the learning. 5 Experiments We tested and compared the models on sequences and videos with varying degrees of complexity, from synthetic constant to synthetic accelerated transformations to more complex real-world transformations. A description of the synthetic shift and rotation data sets is provided in the supplementary material. 5.1 Preprocessing and Initialization For all data sets, except for chirps and bouncing balls, PCA whitening was used for dimensionality reduction, retaining around 95% of the variance. The chirps-data was normalized by subtracting the mean and dividing by the standard deviation of the training set. For the multi-layer models we used greedy layerwise pretraining before predictive training. We found pretraining to be crucial for the predictive training to work well. Each layer was pretrained using a simple GAE, the first layer on input frames, the next layer on the inferred mappings. Stochastic gradient descent (SGD) with learning rate 0.001 and momentum 0.9 was used for all pretraining. 5 Table 1: Classification accuracies (%) on accelerated transformation data using mappings from different layers in the PGP (accuracies after pretraining shown in parentheses). Data set m(1:2) 1 m(2:3) 1 (m(1:2) 1 , m(2:3) 1 ) m(1:3) 2 ACCROT 18.1 (19.4) 29.3 (30.9) 74.0 (64.9) 74.4 (53.7) ACCSHIFT 20.9 (20.6) 34.4 (33.3) 42.7 (38.4) 80.6 (63.4) 5.2 Comparison of Predictive and Reconstructive Training To evaluate whether predictive training (PGP) yields better representations of transformations than training with a reconstruction objective (GAE), we first performed a classification experiment on videos showing artificially transformed natural images. 13 × 13 patches were cropped from the Berkeley Segmentation data set (BSDS300) [18]. Two data sets with videos featuring constant velocity shifts (CONSTSHIFT) and rotations (CONSTROT) were generated. The shift vectors (for CONSTSHIFT) and rotation angles (for CONSTROT) were each grouped into 8 bins to generate labels for classification. The numbers of filter pairs and mapping units were chosen using a grid search. The setting with the best performance on the validation set was 256 filters and 256 mapping units for both training objectives on both data sets. The models were each trained for 1 000 epochs using SGD with learning rate 0.001 and momentum 0.9. Mappings of the first two inputs were used as input to a logistic regression classifier. The experiment was performed three times on both data sets. The mean accuracy (%) on CONSTSHIFT after predictive training was 79.4 compared to 76.4 after reconstructive training. For CONSTROT mean accuracies were 98.2 after predictive and 97.6 after reconstructive training. This confirms that predictive training yields a more explicit representation of transformations, that is less dependent on image content, as discussed in Section 4.1. 5.3 Detecting Acceleration To test the hypothesis that the PGP learns to model second-order correspondences in sequences, image sequences with accelerated shifts (ACCSHIFT) and rotations (ACCROT) of natural image patches were generated. The acceleration vectors (for ACCSHIFT) and angular rotations (for ACCROT) were each grouped into 8 bins to generate output labels for classification. Numbers of filter pairs and mapping units were set to 512 and 256, respectively, after performing a grid search. After pretraining, the PGP was trained using SGD with learning rate 0.0001 and momentum 0.9, for 400 epochs on single-step prediction and then 500 epochs on two-step prediction. After training, first- and second-layer mappings were inferred from the first three frames of the test sequences. The classification accuracies using logistic regression with second-layer mappings of the PGP (m(1:3) 2 ) , with individual first-layer mappings (m(1:2) 1 and m(2:3) 1 ), and with their concatenation (m(1:2) 1 , m(2:3) 1 ) as classifier inputs are compared in Table 1 for both data sets (before and after predictive finetuning). The second-layer mappings achieved a significantly higher accuracy for both data sets after predictive training. For ACCROT, the concatenation of first-layer mappings performs almost as well as the second-layer mappings, which may be because rotations have fewer degrees of freedom than shifts making them easier to model. Note that the accuracy for the first layer mappings also improved with predictive finetuning. These results show that the PGP can learn a better representation of the second-order relational structure in the data than the single-layer model. They further show that predictive training improves performances of both models and is crucial for the PGP. 5.4 Sequence Prediction In these experiments we test the capability of the models to predict previously unseen sequences multiple steps into the future. This allows us to assess to what degree modeling higher order “derivatives” makes it possible to capture the temporal evolution of a signal without resorting to an explicit 6 Figure 3: Multi-step predictions by the PGP trained on accelerated rotations (left) and shifts (right). From top to bottom: ground truth, predictions before and after predictive finetuning. 0 100 200 300 time −2.5 0 2.5 ground truth CRBM RNN PGP 0 5 10 predict-ahead interval 0 1.0 1.8 mean squared error Figure 4: Left: Chirp signal and the predictions of the CRBM, RNN and PGP after seeing the first five 10-frame vectors. Right: The MSE of the three models for each step. representation of a hidden state. Unless mentioned otherwise, the presented sequences were seeded with frames from test data (not seen during training). Accelerated Transformations Figure 3 shows predictions with the PGP on the data sets introduced in Section 5.3 after different stages of training. As can be seen in the figures, the prediction accuracy increases significantly with multi-step training. Chirps Performances of the PGP were compared with that of a standard RNN (trained with BPTT) and a CRBM (trained with contrastive divergence) [19] on a dataset containing chirps (sinusoidal waves that increase or decrease in frequency over time). Training and test set each contain 20, 000 sequences. The 160 frames of each sequence are grouped into 16 non-overlapping 10-frame windows, yielding 10-dimensional input vectors. Given the first 5 windows, the remaining 11 windows have to be predicted. Second-order mappings of the PGP are averaged for the seed windows and then held fixed for prediction. Predictions for one test sequence are shown in Figure 4 (left). Mean-squared errors (MSE) on the test set are 1.159 for the RNN, 1.624 for the CRBM and 0.323 for the PGP. A plot of per-step MSEs is shown in Figure 4 (right). NorbVideos The NORBvideos data set introduced in [20] contains videos of objects from the NORB dataset [17]. The 5 frame videos each show incrementally changed viewpoints of one object. One- and twohidden layer PGP models were trained on this data using the author’s original split. Both models used 2000 features and 1000 mapping units (per layer). The performance of the one-hidden layer model stopped improving at 2000 features, while the two-hidden layer model was able to make use of the additional parameters. Two-step MSEs on test data were 448.4 and 582.1, respectively. Figure 6 shows predictions made by both models. The second-order PGP generates predictions that reflect the 3-D structure in the data. In contrast to the first-order PGP, it is able to extrapolate the observed transformations. Bouncing Balls The PGP is also able to capture the highly non-linear dynamics in the bouncing balls data set4. The sequence shown in Figure 5 contains 56 frames, where the first 5 are from the training sequences and are used as seed for sequence generation (similar to the chirps experiment the average top-layer mapping vector for the seed frames is fixed). Note that the sequences used for training were only 4 The training and test sequences were generated using the script released with [21]. 7 Figure 5: PGP generated sequence of bouncing balls (left-to-right, top-to-bottom). Figure 6: Two-step PGP test predictions on NORBvideos. 20 frames long. The model’s predictions look qualitatively better than most published generated sequences.5 Further results and data can be found on the project website at http://www.ccc. cs.uni-frankfurt.de/people/vincent-michalski/grammar-cells 6 Discussion A major long-standing problem in sequence modeling is dealing with long-range correlations. It has been proposed that deep learning may help address this problem by finding representations that capture better the abstract, semantic content of the inputs [22]. In this work we propose learning representations with the explicit goal of enabling the prediction of the temporal evolution of the input stream multiple time steps ahead. Thus we seek a hidden representation that captures those aspects of the input data which allow us to make predictions about the future. As we discussed, learning the long-term evolution of a sequence can be simplified by modeling it as a sequence of temporally varying orthogonal (and thus, in particular, linear) transformations. Since gating networks are like mixtures-of-experts, the PGP does model its input using a sequence of linear transformations in the lowest layer, it is thus “horizontally linear”. At the same time, it is “vertically compressive”, because its sigmoidal units are encouraged to compute non-linear, sparse representations, like the hidden units in any standard feed-forward neural network. From an optimization perspective this is a very sensible way to model time-series, since gradients have to be back-propagated through many more layers horizontally (in time) than vertically (through the non-linear network). It is interesting to note that predictive training can also be viewed as an analogy making task [15]. It amounts to relating the transformation from frame t −1 to t with the transformation between a later pair of observations, e.g. those at time t and t + 1. The difference is that in a genuine analogy making task, the target observation may be unrelated to the source observation pair, whereas here target and source are related. It would be interesting to apply the model to word representations, or language in general, as this is a domain where both, sequentially structured data and analogical relationships play central roles. Acknowledgments This work was supported by the German Federal Ministry of Education and Research (BMBF) in project 01GQ0841 (BFNT Frankfurt), by an NSERC Discovery grant and by a Google faculty research award. 5compare with http://www.cs.utoronto.ca/˜ilya/pubs/2007/multilayered/index. html and http://www.cs.utoronto.ca/˜ilya/pubs/2008/rtrbm_vid.tar.gz. 8 References [1] R. Memisevic and G. E. Hinton. Unsupervised learning of image transformations. In Proceedings of the 2007 IEEE Conference on Computer Vision and Pattern Recognition, 2007. [2] B. A. Olshausen, C. Cadieu, J. Culpepper, and D. K. Warland. Bilinear models of natural images. 2007. [3] G. W. Taylor, G. E. Hinton, and S. T. Roweis. Two distributed-state models for generating high-dimensional time series. The Journal of Machine Learning Research, 12:1025–1068, 2011. [4] P. J. Werbos. Generalization of backpropagation with application to a recurrent gas market model. Neural Networks, 1(4):339–356, 1988. [5] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735– 1780, 1997. [6] S. Hochreiter. Untersuchungen zu dynamischen neuronalen netzen. diploma thesis, institut f¨ur informatik, lehrstuhl prof. brauer, technische universit¨at m¨unchen. 1991. [7] I. Sutskever, J. Martens, and G. E. Hinton. Generating text with recurrent neural networks. In Proceedings of the 2011 International Conference on Machine Learning, 2011. [8] J. Schmidhuber. Learning complex, extended sequences using the principle of history compression. Neural Computation, 4(2):234–242, 1992. [9] R. Socher, A. Perelygin, J. Wu, J. Chuang, C. D. Manning, A. Y. Ng, and C. Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing. [10] J. Luttinen, T. Raiko, and A. Ilin. Linear state-space model with time-varying dynamics. In Machine Learning and Knowledge Discovery in Databases, pages 338–353. Springer, 2014. [11] V. Michalski. Neural networks for motion understanding: Diploma thesis. Master’s thesis, Goethe-Universit¨at Frankfurt, Frankfurt, Germany, 2013. [12] P. F¨oldi´ak. Learning invariance from transformation sequences. Neural Computation, 3(2):194–200, 1991. [13] L. Wiskott and T. Sejnowski. Slow feature analysis: Unsupervised learning of invariances. Neural computation, 14(4):715–770, 2002. [14] R. Memisevic. Learning to relate images. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1829–1846, 2013. [15] R. Memisevic and G. E. Hinton. Learning to represent spatial transformations with factored higher-order boltzmann machines. Neural Computation, 22(6):1473–1492, 2010. [16] R. Memisevic. Gradient-based learning of higher-order image features. In 2011 IEEE International Conference on Computer Vision, pages 1591–1598. IEEE, 2011. [17] Y. LeCun, F. J. Huang, and L. Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In Proceedings of the 2001 IEEE Conference on Computer Vision and Pattern Recognition, 2001. [18] D. Martin, Fowlkes C., D. Tal, and J. Malik. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In Proceedings of the Eigth IEEE International Conference on Computer Vision, volume 2, pages 416–423, July 2001. [19] G. W. Taylor, G. E. Hinton, and S. T. Roweis. Modeling human motion using binary latent variables. In Advances in Neural Information Processing Systems 20, pages 1345–1352, 2007. [20] R. Memisevic and G. Exarchakis. Learning invariant features by harnessing the aperture problem. In Proceedings of the 30th International Conference on Machine Learning, 2013. [21] I. Sutskever, G. E. Hinton, and G. W. Taylor. The recurrent temporal restricted boltzmann machine. In Advances in Neural Information Processing Systems 21, pages 1601–1608, 2008. [22] Y. Bengio. Learning deep architectures for AI. Foundations and Trends in Machine Learning, 2(1):1–127, 2009. Also published as a book. Now Publishers, 2009. 9
2014
335
5,442
Augur: Data-Parallel Probabilistic Modeling Jean-Baptiste Tristan1, Daniel Huang2, Joseph Tassarotti3, Adam Pocock1, Stephen J. Green1, Guy L. Steele, Jr1 1Oracle Labs {jean.baptiste.tristan, adam.pocock, stephen.x.green, guy.steele}@oracle.com 2Harvard University dehuang@fas.harvard.edu 3Carnegie Mellon University jtassaro@cs.cmu.edu Abstract Implementing inference procedures for each new probabilistic model is timeconsuming and error-prone. Probabilistic programming addresses this problem by allowing a user to specify the model and then automatically generating the inference procedure. To make this practical it is important to generate high performance inference code. In turn, on modern architectures, high performance requires parallel execution. In this paper we present Augur, a probabilistic modeling language and compiler for Bayesian networks designed to make effective use of data-parallel architectures such as GPUs. We show that the compiler can generate data-parallel inference code scalable to thousands of GPU cores by making use of the conditional independence relationships in the Bayesian network. 1 Introduction Machine learning, and especially probabilistic modeling, can be difficult to apply. A user needs to not only design the model, but also implement an efficient inference procedure. There are many different inference algorithms, many of which are conceptually complicated and difficult to implement at scale. This complexity makes it difficult to design and test new models, or to compare inference algorithms. Therefore any effort to simplify the use of probabilistic models is useful. Probabilistic programming [1], as introduced by BUGS [2], is a way to simplify the application of machine learning based on Bayesian inference. It allows a separation of concerns: the user specifies what needs to be learned by describing a probabilistic model, while the runtime automatically generates the how, i.e., the inference procedure. Specifically the programmer writes code describing a probability distribution, and the runtime automatically generates an inference algorithm which samples from the distribution. Inference itself is a computationally intensive and challenging problem. As a result, developing inference algorithms is an active area of research. These include deterministic approximations (such as variational methods) and Monte Carlo approximations (such as MCMC algorithms). The problem is that most of these algorithms are conceptually complicated, and it is not clear, especially to non-experts, which one would work best for a given model. In this paper we present Augur, a probabilistic modeling system, embedded in Scala, whose design is guided by two observations. The first is that if we wish to benefit from advances in hardware we must focus on producing highly parallel inference algorithms. We show that many MCMC inference algorithms are highly data-parallel [3, 4] within a single Markov Chain, if we take advantage of the conditional independence relationships of the input model (e.g., the assumption of i.i.d. data makes the likelihood independent across data points). Moreover, we can automatically generate good data-parallel inference with a compiler. This inference runs efficiently on common highly parallel architectures such as Graphics Processing Units (GPUs). We note that parallelism brings interesting trade-offs to MCMC performance as some inference techniques generate less parallelism and thus scale poorly. 1 The second observation is that a high performance system begins by selecting an appropriate inference algorithm, and this choice is often the hardest problem. For example, if our system only implements Metropolis-Hastings inference, there are models for which our system will be of no use, even given large amounts of computational power. We must design the system so that we can include the latest research on inference while reusing pre-existing analyses and optimizations. Consequently, we use an intermediate representation (IR) for probability distributions that serves as a target for modeling languages and as a basis for inference algorithms, allowing us to easily extend the system. We will show this IR is key to scaling the system to very large networks. We present two main results: first, some inference algorithms are highly data-parallel and a compiler can automatically generate effective GPU implementations; second, it is important to use a symbolic representation of a distribution rather than explicitly constructing a graphical model in memory, allowing the system to scale to much larger models (such as LDA). 2 The Augur Language We present two example model specifications in Augur, latent Dirichlet allocation (LDA) [5], and a multivariate linear regression model. The supplementary material shows how to generate samples from the models, and how to use them for prediction. It also contains six more example probabilistic models in Augur: polynomial regression, logistic regression, a categorical mixture model, a Gaussian Mixture Model (GMM), a Naive Bayes Classifier, and a Hidden Markov Model (HMM). Our language is similar in form to BUGS [2] and Stan [6], except our statements are implicitly parallel. 2.1 Specifying a Model The LDA model specification is shown in Figure 1a. The probability distribution is a Scala object (object LDA) composed of two declarations. First, we declare the support of the probability distribution as a class named sig. The support of the LDA model is composed of four arrays, one each for the distribution of topics per document (theta), the distribution of words per topic (phi), the topics assignments (z), and the words in the corpus (w). The support is used to store the inferred model parameters. These last two arrays are flat representations of ragged arrays, and thus we do not require the documents to be of equal length. The second declaration specifies the probabilistic model for LDA in our embedded domain specific language (DSL) for Bayesian networks. The DSL is marked by the bayes keyword and delimited by the enclosing brackets. The model first declares the parameters of the model: K for the number of topics, V for the vocabulary size, M for the number of documents, and N for the array of document sizes. In the model itself, we define the hyperparameters (values alpha and beta) for the Dirichlet distributions and sample K Dirichlets of dimension V for the distribution of words per topic (phi) and M Dirichlets of dimension K for the distribution of topics per document (theta). Then, for each word in each document, we draw a topic z from theta, and finally a word from phi conditioned on the topic we drew for z. The regression model in Figure 1b is defined in the same way using similar language features. In this example the support comprises the (x, y) data points, the weights w, the bias b, and the noise tau. The model uses an additional sum function to sum across the feature vector. 2.2 Using a Model Once a model is specified, it can be used as any other Scala object by writing standard Scala code. For instance, one may want to use the LDA model with a training corpus to learn a distribution of words per topic and then use it to learn the per-document topic distribution of a test corpus. In the supplementary material we provide a code sample which shows how to use an Augur model for such a task. Each Augur model forms a distribution, and the runtime system generates a Dist interface which provides two methods: map, which implements maximum a posteriori estimation, and sample, which returns a sequence of samples. Both of these calls require a similar set of arguments: a list of additional variables to be observed (e.g., to fix the phi values at test time in LDA), the model hyperparameters, the initial state of the model support, the model support that stores the inferred parameters, the number of MCMC samples and the chosen inference method. 2 1 object LDA { 2 class sig(var phi: Array[Double], 3 var theta: Array[Double], 4 var z: Array[Int], 5 var w: Array[Int]) 6 val model = bayes { 7 (K:Int,V:Int,M:Int,N:Array[Int]) => { 8 val alpha = vector(K,0.1) 9 val beta = vector(V,0.1) 10 val phi = Dirichlet(V,beta).sample(K) 11 val theta = Dirichlet(K,alpha).sample(M) 12 val w = 13 for(i <- 1 to M) yield { 14 for(j <- 1 to N(i)) yield { 15 val z: Int = 16 Categorical(K,theta(i)).sample() 17 Categorical(V,phi(z)).sample() 18 }} 19 observe(w) 20 }}} (a) A LDA model in Augur. The model specifies the distribution p(φ, θ, z | w). 1 object LinearRegression { 2 class sig(var w: Array[Double], 3 var b: Double, 4 var tau: Double, 5 var x: Array[Double], 6 var y: Array[Double]) 7 val model = bayes { 8 (K:Int,N:Int,l:Double,u:Double) => { 9 val w = Gaussian(0,10).sample(K) 10 val b = Gaussian(0,10).sample() 11 val tau = InverseGamma(3.0,1.0).sample() 12 val x = for(i <- 1 to N) 13 yield Uniform(l,u).sample(K) 14 val y = for (i <- 1 to N) yield { 15 val phi = for(j <- 1 to K) yield 16 w(j) * x(i)(j) 17 Gaussian(phi.sum + b,tau).sample() 18 } 19 observe(x, y) 20 }}} (b) A multivariate regression in Augur. The model specifies the distribution p(w, b, τ | x, y). Figure 1: Example Augur programs. 3 System Architecture We now describe how a model specification is transformed into CUDA code running on a GPU. Augur has two distinct compilation phases. The first phase transforms the block of code following the bayes keyword into our IR for probability distributions, and occurs when scalac is invoked. The second phase happens at runtime, when a method is invoked on the model. At that point, the IR is transformed, analyzed, and optimized, and then CUDA code is emitted, compiled, and executed. Due to these two phases, our system is composed of two distinct components that communicate through the IR: the front end, where the DSL is converted into the IR, and the back end, where the IR is compiled down to the chosen inference algorithm (currently Metropolis-Hastings, Gibbs sampling, or Metropolis-Within-Gibbs). We use the Scala macro system to define the modeling language in the front end. The macro system allows us to define a set of functions (called “macros”) that are executed by the Scala compiler on the code enclosed by the macro invocation. We currently focus on Bayesian networks, but other DSLs (e.g., Markov random fields) could be added without modifications to the back end. The implementation of the macros to define the Bayesian network language is conceptually uninteresting so we omit further details. Separating the compilation into two distinct phases provides many advantages. As our language is implemented using Scala’s macro system, it provides automatic syntax highlighting, method name completion, and code refactoring in any IDE which supports Scala. This improves the usability of the DSL as we require no special tools support. We also use Scala’s parser, semantic analyzer (e.g., to check that variables have been defined), and type checker. Additionally we benefit from scalac’s optimizations such as constant folding and dead code elimination. Then, because we compile the IR to CUDA code at run time, we know the values of all the hyperparameters and the size of the dataset. This enables better optimization strategies, and also gives us important insights into how to extract parallelism (Section 4.2). For example, when compiling LDA, we know that the number of topics is much smaller than the number of documents and thus parallelizing over documents produces more parallelism than parallelizing over topics. This is analogous to JIT compilation in modern runtime systems where the compiler can make different decisions at runtime based upon the program state. 4 Generation of Data-Parallel Inference We now explain how Augur generates data-parallel samplers by exploiting the conditional independence structure of the model. We will use the two examples from Section 2 to explain how the compiler analyzes the model and generates the inference code. 3 When we invoke an inference procedure on a model (e.g., by calling model.map), Augur compiles the IR into CUDA inference code for that model. Our aim with the IR is to make the parallelism explicit in the model and to support further analysis of the probability distributions contained within. For example, a Q indicates that each sub-term in the expression can be evaluated in parallel. Informally, our IR expressions are generated from this Backus-Naur Form (BNF) grammar: P ::= p( → X) p( → X | → X) PP 1 P N Y i P Z X P dx {P}c The use of a symbolic representation for the model is key to Augur’s ability to scale to large networks. Indeed, as we show in the experimental study (Section 5), popular probabilistic modeling systems such as JAGS [7] or Stan [8] reify the graphical model, resulting in unreasonable memory consumption for models such as LDA. However, a consequence of our symbolic representation is that it is more difficult to discover conjugacy relationships, a point we return to later. 4.1 Generating data-parallel MH samplers To use Metropolis-Hastings (MH) inference, the compiler emits code for a function f that is proportional to the distribution to be sampled. This code is then linked with our library implementation of MH. The function f is the product of the prior and the model likelihood and is extracted automatically from the model specification. In our regression example this function is: f(x, y, τ, b, w) = p(b)p(τ)p(w)p(x)p(y | x, b, τ, w) which we rewrite to f(x, y, τ, b, w) = p(b)p(τ) K Y k p(wk) ! N Y n p(xn)p(yn | xn · w + b, τ) ! In this form, the compiler knows that the distribution factorizes into a large number of terms that can be evaluated in parallel and then efficiently multiplied together. Each (x, y) contributes to the likelihood independently (i.e., the data is i.i.d.), and each pair can be evaluated in parallel and the compiler can optimize accordingly. In practice, we work in log-space, so we perform summations. The compiler then generates the CUDA code to evaluate f from the IR. This code generation step is conceptually simple and we will not explain it further. It is interesting to note that the code scales well despite the simplicity of this parallelization: there is a large amount of parallelism because it is roughly proportional to the number of data points; uncovering the parallelism in the code does not increase the amount of computation performed; and the ratio of computation to global memory accesses is high enough to hide the memory latency. 4.2 Generating data-parallel Gibbs samplers Alternatively we can generate a Gibbs sampler for conjugate models. We would prefer to generate a Gibbs sampler for LDA, as an MH sampler will have a very low acceptance ratio. To generate a Gibbs sampler, the compiler needs to figure out how to sample from each univariate conditional distribution. As an example, to draw θm as part of the (τ + 1)th sample, the compiler needs to generate code that samples from the following distribution p(θτ+1 m | wτ+1, zτ+1, θτ+1 1 , ..., θτ+1 m−1, θτ m+1, ..., θτ M). As we previously explained, our compiler uses a symbolic representation of the model: the advantage is that we can scale to large networks, but the disadvantage is that it is more challenging to uncover conjugacy and independence relationships between variables. To accomplish this, the compiler uses an algebraic rewrite system that aims to rewrite the above expression in terms of expressions it knows (i.e., the joint distribution of the model). We show a few selected rules below to give a flavor of the rewrite system. The full set of 14 rewrite rules are in the supplementary material. (a) P P ⇒1 (c) NQ i P(xi) ⇒ NQ i {P(xi)}q(i)=T NQ i {P(xi)}q(i)=F (b) R P(x) Q dx ⇒Q R P(x)dx (d) P(x | y) ⇒ P (x,y) R P (x,y) dx Rule (a) states that like terms can be canceled. Rule (b) says that terms that do not depend on the variable of integration can be pulled out of the integral. Rule (c) says that we can partition a product 4 over N terms into two products, one where a predicate q is true on the indexing variable and one where it is false. Rule (d) is a combination of the product and sum rule. Currently, the rewrite system is comprised of rules we found useful in practice, and it is easy to extend the system with more rules. Going back to our example, the compiler rewrites the desired expression into the one below: 1 Z p(θτ+1 m ) N(m) Y j p(zmj|θτ+1 m ) In this form, it is clear that each θ1, . . . , θm is independent of the others after conditioning on the other random variables. As a result, they may all be sampled in parallel. At each step, the compiler can test for a conjugacy relation. In the above form, the compiler recognizes that the zmj are drawn from a categorical distribution and θm is drawn from a Dirichlet, and can exploit the fact that these are conjugate distributions. The posterior distribution for θm is Dirichlet(α + cm) where cm is a vector whose kth entry is the number of z of topic k from document m. Importantly, the compiler now knows that sampling each z requires a counting phase. The case of the φ variables is more interesting. In this case, we want to sample from p(φτ+1 k |wτ+1, zτ+1, θτ+1, φτ+1 1 , ..., φτ+1 k−1, φτ k+1, ..., φτ K) After the applying the rewrite system to this expression, the compiler discovers that it is equal to 1 Z p(φk) M Y i N(i) Y j {p(wi|φzij)}k=zij The key observation that the compiler uses to reach this conclusion is the fact that the z are distributed according to a categorical distribution and are used to index into the φ array. Therefore, they partition the set of words w into K disjoint sets w1 ⊎... ⊎wk, one for each topic. More concretely, the probability of words drawn from topic k can be rewritten in partitioned form using rule (c) as QM i QN(i) j {p(wij|φzij)}k=zij as once a word’s topic is fixed, the word depends upon only one of the φk distributions. In this form, the compiler recognizes that it should draw from Dirichlet(β + ck) where ck is the count of words assigned to topic k. In general, the compiler detects this pattern when it discovers that samples drawn from categorical distributions are being used to index into arrays. Finally, the compiler turns to analyzing the zij. It detects that they can be sampled in parallel but it does not find a conjugacy relationship. However, it discovers that the zij are drawn from discrete distributions, so the univariate distribution can be calculated exactly and sampled from. In cases where the distributions are continuous, it tries to use another approximate sampling method to sample from that variable. One concern with such a rewrite system is that it may fail to find a conjugacy relation if the model has a complicated structure. So far we have found our rewrite system to be robust and it can find all the usual conjugacy relations for models such as LDA, GMMs or HMMs, but it suffers from the same shortcomings as implementations of BUGS when deeper mathematics are required to discover a conjugacy relation (as would be the case for instance for a non-linear regression). In the cases where a conjugacy relation cannot be found, the compiler will (like BUGS) resort to using MetropolisHastings and therefore exploit the inherent parallelism of the model likelihood. Finally, note that the rewrite rules are applied deterministically and the process will always terminate with the same result. Overall, the cost of analysis is negligible compared to the sampling time for large data sets. Although the rewrite system is simple, it enables us to use a concise symbolic representation for the model and thereby scale to large networks. 4.3 Data-parallel Operations on Distributions To produce efficient code, the compiler needs to uncover parallelism, but we also need a library of data-parallel operations for distributions. For instance, in LDA, there are two steps where we sample from many Dirichlet distributions in parallel. When drawing the per document topic distributions, each thread can draw a θi by generating K Gamma variates and normalizing them [9]. Since the 5 number of documents is usually very large, this produces enough parallelism to make full use of the GPU’s cores. However, this may not produce sufficient parallelism when drawing the φk, because the number of topics is usually small compared to the number of cores. Consequently, we use a different procedure which exposes more parallelism (the algorithm is given in the supplementary material). To generate K Dirichlet variates over V categories with concentration parameters α11, . . . , αKV , we first generate a matrix A where Aij ∼Gamma(αij) and then normalize each row of this matrix. To sample the θi, we could launch a thread per row. However, as the number of columns is much larger than the number of rows, we launch a thread to generate the gamma variates for each column, and then separately compute a normalizing constant for each row by multiplying the matrix with a vector of ones using CUBLAS. This is an instance where the two-stage compilation procedure (Section 3) is useful, because the compiler is able to use information about the relative sizes of K and V to decide that the complex scheme will be more efficient than the simple scheme. This sort of optimization is not unique to the Dirichlet distribution. For example, when sampling a large number of multivariate normals by applying a linear transformation to a vector of normal samples, the strategy for extracting parallelism may change based on the number of samples to generate, the dimension of the multinormal, and the number of GPU cores. We found that issues like these were crucial to generating high-performance data-parallel samplers. 4.4 Parallelism & Inference Tradeoffs It is difficult to give a cost model for Augur programs. Traditional approaches are not necessarily appropriate for probabilistic inference because there are tradeoffs between faster sampling times and convergence which are not easy to characterize. In particular, different inference methods may affect the amount of parallelism that can be exploited in a model. For example, in the case of multivariate regression, we can use the Metropolis-Hastings sampler presented above, which lets us sample from all the weights in parallel. However, we may be better off generating a Metropolis-Within-Gibbs sampler where the weights are sampled one at a time. This reduces the amount of exploitable parallelism, but it may converge faster, and there may still be enough parallelism in each calculation of the Hastings ratio by evaluating the likelihood in parallel. Many of the optimizations in the literature that improve the mixing time of a Gibbs sampler, such as blocking or collapsing, reduce the available parallelism by introducing dependencies between previously independent variables. In a system like Augur it is not always beneficial to eliminate variables (e.g., by collapsing) if it introduces more dependencies for the remaining variables. Currently Augur cannot generate a blocked or collapsed sampler, but there is interesting work on automatically blocking or collapsing variables [10] that we wish to investigate in the future. Our experimental results on LDA demonstrate this tradeoff between mixing and runtime. There we show that while a collapsed Gibbs sampler converges more quickly in terms of the number of samples compared to an uncollapsed sampler, the uncollapsed sampler converges more quickly in terms of runtime. This is due to the uncollapsed sampler having much more available parallelism. We hope that as more options and inference strategies are added to Augur, users will be able to experiment further with the tradeoffs of different inference methods in a way that would be too time-consuming to do manually. 5 Experimental Study We provide experimental results for the two examples presented throughout the paper and in the supplementary material for a Gaussian Mixture Model (GMM). More detailed information on the experiments can be found in the supplementary material. To test multivariate regression and the GMM, we compare Augur’s performance to those of two popular languages for statistical modeling, JAGS [7] and Stan [8]. JAGS is an implementation of BUGS, and performs inference using Gibbs sampling, adaptive MH, and slice sampling. Stan uses a No-U-Turn sampler, a variant of Hamiltonian Monte Carlo. For the regression, we configured Augur to use MH1, while for the GMM Augur generated a Gibbs sampler. In our LDA experiments we also compare Augur to a handwritten CUDA implementation of a Gibbs sampler, and also to 1Augur could not generate a Gibbs sampler for regression, as the conjugacy relation for the weights is not a simple application of conjugacy rules[11]. JAGS avoids this issue by adding specific rules for linear regression. 6 0 5 10 15 20 25 30 35 40 45 50 0 10 20 30 40 50 60 70 80 100 200 500 1000 2000 5000 150 3000 7500 100 200 500 1000 2000 5000 Runtime (seconds) RMSE RMSE v. Training Time (winequality-red) Augur Jags Stan (a) Multivariate linear regression results on the UCI WineQuality-red dataset. 1 10 102 103 104 105 −1.65 −1.6 −1.55 −1.5 −1.45 −1.4 −1.35 −1.3 −1.25 ·105 12222324 25 26 27 28 29 210 211 1222 23 24 25 26 27 28 29 210 211 1 2 22 23 24 25 26 27 28 29 210 211 Runtime (seconds) Log10 Predictive Probability Predictive Probability v. Training Time Augur Cuda Factorie(Collapsed) (b) Predictive probability vs time for up to 2048 samples with three LDA implementations: Augur, hand-written CUDA, Factorie’s Collapsed Gibbs. Figure 2: Experimental results on multivariate linear regression and LDA. the collapsed Gibbs sampler [12] from the Factorie library [13]. The former is a comparison for an optimised GPU implementation, while the latter is a baseline for a CPU Scala implementation. 5.1 Experimental Setup For the linear regression experiment, we used data sets from the UCI regression repository [14]. The Gaussian Mixture Model experiments used two synthetic data sets, one generated from 3 clusters, the other from 4 clusters. For the LDA benchmark, we used a corpus extracted from the simple English variant of Wikipedia, with standard stopwords removed. This corpus has 48556 documents, a vocabulary size of 37276 words, and approximately 3.3 million tokens. From that we sampled 1000 documents to use as a test set, removing words which appear only in the test set. To evaluate the model we measure the log predictive probability [15] on the test set. All experiments ran on a single workstation with an Intel Core i7 4820k CPU, 32 GB RAM, and an NVIDIA GeForce Titan Black. The Titan Black uses the Kepler architecture. All probability values are calculated in double precision. The CPU performance results using Factorie are calculated using a single thread, as the multi-threaded samplers are neither stable nor performant in the tested release. The GPU results use all 960 double-precision ALU cores available in the Titan Black. The Titan Black has 2880 single-precision ALU cores, but single precision resulted in poor quality inference results, though the speed was greatly improved. 5.2 Results In general, our results show that once the problem is large enough we can amortize Augur’s startup cost of model compilation to CUDA, nvcc compilation to a GPU binary, and copying the data to and from the GPU. This cost is approximately 9 seconds averaged across all our experiments. After this point Augur scales to larger numbers of samples in shorter runtimes than comparable systems. In this mode we are using Augur to find a likely set of parameters rather than generating a set of samples with a large effective sample size for posterior estimation. We have not investigated the effective sample size vs runtime tradeoff, though the MH approach we use for regression is likely to have a lower effective sample size than the HMC used in Stan. Our linear regression experiments show that Augur’s inference is similar to JAGS in runtime and performance, and better than Stan. Augur takes longer to converge as it uses MH, though once we have amortized the compilation time it draws samples very quickly. The regression datasets tend to be quite small in terms of both number of random variables and number of datapoints, so it is harder to amortize the costs of GPU execution. However, the results are very different for models where the number of inferred parameters grows with the data set. In the GMM example in the supplementary, 7 we show that Augur scales to larger problems than JAGS or Stan. For 100, 000 data points, Augur draws a thousand samples in 3 minutes while JAGS takes more than 21 minutes and Stan requires more than 6 hours. Each system found the correct means and variances for the clusters; our aim was to measure the scaling of runtime with problem size. Results from the LDA experiment are presented in Figure 2b and use predictive probability to monitor convergence over time. We compute the predictive probability and record the time (in seconds) after drawing 2i samples, for i ranging from 0 to 11 inclusive. It takes Augur 8.1 seconds to draw its first sample for LDA. Augur’s performance is very close to that of the hand-written CUDA implementation, and much faster than the Factorie collapsed Gibbs sampler. Indeed, it takes the collapsed LDA implementation 6.7 hours longer than Augur to draw 2048 samples. We note that the collapsed Gibbs sampler appears to have converged after 27 samples, in approximately 27 minutes. The uncollapsed implementations converge after 29 samples, in approximately 4 minutes. We also implemented LDA in JAGS and Stan but they ran into scalability issues. The Stan version of LDA (taken from the Stan user’s manual[6]) uses 55 GB of RAM but failed to draw a sample in a week of computation time. We could not test JAGS as it required more than 128 GB of RAM. In comparison, Augur uses less than 1 GB of RAM for this experiment. 6 Related Work Augur is similar to probabilistic modeling languages such as BUGS [16], Factorie [13], Dimple [17], Infer.net [18], and Stan [8]. This family of languages explicitly represents a probability distribution, restricting the expressiveness of the modeling language to improve performance. For example, Factorie, Dimple, and Infer.net provide languages for factor graphs enabling these systems to take advantage of specific efficient inference algorithms (e.g., Belief Propagation). Stan, while Turing complete, focuses on probabilistic models with continuous variables using a No-U-Turn sampler (recent versions also support discrete variables). In contrast, Augur focuses on Bayesian Networks, allowing a compact symbolic representation, and enabling the generation of data-parallel code. Another family of probabilistic programming languages is characterized by their ability to express all computable generative models by reasoning over execution traces which implicitly represent probability distributions. These are typically a Turing complete language with probabilistic primitives and include Venture [19], Church [20], and Figaro [21]. Augur and the modeling languages described above are less expressive than these languages, and so describe a restricted set of probabilistic programs. However performing inference over program traces generated by a model, instead of the model support itself, makes it more difficult to generate an efficient inference algorithm. 7 Discussion We show that it is possible to automatically generate parallel MCMC inference algorithms, and it is also possible to extract sufficient parallelism to saturate a modern GPU with thousands of cores. The choice of a Single-Instruction Multiple-Data (SIMD) architecture such as a GPU is central to the success of Augur, as it allows many parallel threads with low overhead. Creating thousands of CPU threads is less effective as each thread has too little work to amortize the overhead. GPU threads are comparatively cheap, and this allows for many small parallel tasks (like likelihood calculations for a single datapoint). Our compiler achieves this parallelization with no extra information beyond that which is normally encoded in a graphical model description and uses a symbolic representation that allows scaling to large models (particularly for latent variable models like LDA). It also makes it easy to run different inference algorithms and evaluate the tradeoffs between convergence and sampling time. The generated inference code is competitive in terms of model performance with other probabilistic modeling systems, and can sample from large problems much more quickly. The current version of Augur runs on a single GPU, which introduces another tier into the memory hierarchy as data and samples need to be streamed to and from the GPU’s memory and main memory. We do not currently support this in Augur for problems larger than GPU memory, though it is possible to analyse the generated inference code and automatically generate the data movement code [22]. This movement code can execute concurrently with the sampling process. One area we have not investigated is expanding Augur to clusters of GPUs, though this will introduce the synchronization problems others have encountered when scaling up MCMC [23]. 8 References [1] N. D. Goodman. The principles and practice of probabilistic programming. In Proc. of the 40th ACM Symp. on Principles of Programming Languages, POPL ’13, pages 399–402, 2013. [2] A. Thomas, D. J. Spiegelhalter, and W. R. Gilks. BUGS: A program to perform Bayesian inference using Gibbs sampling. Bayesian Statistics, 4:837 – 842, 1992. [3] W. D. Hillis and G. L. Steele, Jr. Data parallel algorithms. Comm. of the ACM, 29(12):1170– 1183, 1986. [4] G. E. Blelloch. Programming parallel algorithms. Comm. of the ACM, 39:85–97, 1996. [5] D. M. Blei, A. Y. Ng, and M. I. Jordan. Latent Dirichlet allocation. Journal of Machine Learning Research, 3:993–1022, 2003. [6] Stan Dev. Team. Stan Modeling Language Users Guide and Ref. Manual, Version 2.2, 2014. [7] M. Plummer. JAGS: A program for analysis of Bayesian graphical models using Gibbs sampling. In 3rd International Workshop on Distributed Statistical Computing (DSC 2003), pages 20–22, 2003. [8] M.D. Hoffman and A. Gelman. The No-U-Turn Sampler: Adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, 15:1593–1623, 2014. [9] G. Marsaglia and W. W. Tsang. A simple method for generating gamma variables. ACM Trans. Math. Softw., 26(3):363–372, 2000. [10] D. Venugopal and V. Gogate. Dynamic blocking and collapsing for Gibbs sampling. In 29th Conf. on Uncertainty in Artificial Intelligence, UAI’13, 2013. [11] R. Neal. CSC 2541: Bayesian methods for machine learning, 2013. Lecture 3. [12] T. L. Griffiths and M. Steyvers. Finding scientific topics. In Proc. of the National Academy of Sciences, volume 101, 2004. [13] A. McCallum, K. Schultz, and S. Singh. Factorie: Probabilistic programming via imperatively defined factor graphs. In Neural Information Processing Systems 22, pages 1249–1257, 2009. [14] K. Bache and M. Lichman. UCI machine learning repository, 2013. [15] M. Hoffman, D. Blei, C. Wang, and J. Paisley. Stochastic variational inference. Journal of Machine Learning Research, 14:1303–1347, 2013. [16] D. Lunn, D. Spiegelhalter, A. Thomas, and N. Best. The BUGS project: Evolution, critique and future directions. Statistics in Medicine, 2009. [17] S. Hershey, J. Bernstein, B. Bradley, A. Schweitzer, N. Stein, T. Weber, and B. Vigoda. Accelerating inference: Towards a full language, compiler and hardware stack. CoRR, abs/1212.2991, 2012. [18] T. Minka, J.M. Winn, J.P. Guiver, and D.A. Knowles. Infer.NET 2.5, 2012. Microsoft Research Cambridge. [19] V. K. Mansinghka, D. Selsam, and Y. N. Perov. Venture: a higher-order probabilistic programming platform with programmable inference. CoRR, abs/1404.0099, 2014. [20] N. D. Goodman, V. K. Mansinghka, D. Roy, K. Bonawitz, and J. B. Tenenbaum. Church: A language for generative models. In 24th Conf. on Uncertainty in Artificial Intelligence, UAI 2008, pages 220–229, 2008. [21] A. Pfeffer. Figaro: An object-oriented probabilistic programming language. Technical report, Charles River Analytics, 2009. [22] J. Ragan-Kelley, C. Barnes, A. Adams, S. Paris, F. Durand, and S. Amarasinghe. Halide: a language and compiler for optimizing parallelism, locality, and recomputation in image processing pipelines. ACM SIGPLAN Notices, 48(6):519–530, 2013. [23] A. Smola and S. Narayanamurthy. An architecture for parallel topic models. Proceedings of the VLDB Endowment, 3(1-2):703–710, 2010. 9
2014
336
5,443
Augmentative Message Passing for Traveling Salesman Problem and Graph Partitioning Siamak Ravanbakhsh Department of Computing Science University of Alberta Edmonton, AB T6G 2E8 mravanba@ualberta.ca Reihaneh Rabbany Department of Computing Science University of Alberta Edmonton, AB T6G 2E8 rabbanyk@ualberta.ca Russell Greiner Department of Computing Science University of Alberta Edmonton, AB T6G 2E8 rgreiner@ualberta.ca Abstract The cutting plane method is an augmentative constrained optimization procedure that is often used with continuous-domain optimization techniques such as linear and convex programs. We investigate the viability of a similar idea within message passing – for integral solutions in the context of two combinatorial problems: 1) For Traveling Salesman Problem (TSP), we propose a factor-graph based on HeldKarp formulation, with an exponential number of constraint factors, each of which has an exponential but sparse tabular form. 2) For graph-partitioning (a.k.a. community mining) using modularity optimization, we introduce a binary variable model with a large number of constraints that enforce formation of cliques. In both cases we are able to derive simple message updates that lead to competitive solutions on benchmark instances. In particular for TSP we are able to find nearoptimal solutions in the time that empirically grows with N 3, demonstrating that augmentation is practical and efficient. 1 Introduction Probabilistic Graphical Models (PGMs) provide a principled approach to approximate constraint optimization for NP-hard problems. This involves a message passing procedure (such as max-product Belief Propagation; BP) to find an approximation to maximum a posteriori (MAP) solution. Message passing methods are also attractive as they are easily mass parallelize. This has contributed to their application in approximating many NP-hard problems, including constraint satisfaction [1, 2], constrained optimization [3, 4], min-max optimization [5], and integration [6]. The applicability of PGMs to discrete optimization problems is limited by the size and number of factors in the factor-graph. While many recent attempts have been made to reduce the complexity of message passing over high-order factors [7, 8, 9], to our knowledge no published result addresses the issues of dealing with large number of factors. We consider a scenario where a large number of factors represent hard constraints and ask whether it is possible to find a feasible solution by considering only a small fraction of these constraints. The idea is to start from a PGM corresponding to a tractible subsset of constraints, and after obtaining an approximate MAP solution using min-sum BP, augment the PGM with the set of constraints that are violated in the current solution. This general idea has been extensively studied under the 1 term cutting plane methods in different settings. Dantzig et al. [10] first investigated this idea in the context of TSP and Gomory et al.[11] provided a elegant method to generate violated constraints in the context of finding integral solutions to linear programs (LP). It has since been used to also solve a variety of nonlinear optimization problems. In the context of PGMs, Sontag and Jaakkola use cutting plane method to iteratively tighten the marginal polytope – that enforces the local consistency of marginals – in order to improve the variational approximation [12]. This differs from our approach, where the augmentation changes the factor-graph (i.e., the inference problem) rather than improving the approximation of inference. Recent studies show that message passing can be much faster than LP in finding approximate MAP assignments for structured optimization problems [13]. This further motivates our inquiry regarding the viability of augmentation for message passing. We present an affirmative answer to this question in application to two combinatorial problems. Section 2 introduces our factor-graph formulations for Traveling Salesman Problem (TSP) and graph-partitioning. Section 3 derives simple message update equations for these factor-graphs and reviews our augmentation scheme. Finally, Section 4 presents experimental results for both applications. 2 Background and Representation Let x = {x1, . . . , xD} ∈X = X1 × X2 . . . × XD denote an instance of a tuple of discrete variables. Let xI refer to a sub-tuple, where I ⊆{1, . . . , D} indexes a subset of these variables. Define the energy function f(x) ≜ P I∈F fI(xI) where F denotes the set of factors. Here the goal of inference is to find an assignment with minimum energy x∗= argx min f(x). This model can be conveniently represented using a bipartite graph, known as factor-graph [14], where a factor node fI(xI) is connected to a variable node xi iff i ∈I. 2.1 Traveling Salesman Problem A Traveling Salesman Problem (TSP) seeks the minimum length tour of N cities that visits each city exactly once. TSP is NP-hard, and for general distances, no constant factor approximation to this problem is possible [15]. The best known exact solver, due to Held et al.[16], uses dynamic programming to reduce the cost of enumerating all orderings from O(N!) to O(N 22N). The development of many (now) standard optimization techniques, such as simulated annealing, mixed integer linear programming, dynamic programming, and ant colony optimization are closely linked with advances in solving TSP. Since Dantzig et al.[10] manually applied the cutting plane method to 49-city problem, a combination of more sophisticated cuts, used with branch-and-bound techniques [17], has produced the state-of-the-art TSP-solver, Concorde [18]. Other notable results on very large instances have been reported by LinKernighan heuristic [19] that continuously improves a solution by exchanging nodes in the tour. In a related work, Wang et al.[20] proposed a message passing solution to TSP. However their method does not scale beyond small toy problems (authors experimented with N = 5 cities). For a readable historical background of the state-of-the-art in TSP and its various applications, see [21]. 2.1.1 TSP Factor-Graph Let G = (V, E) denote a graph, where V = {v1, . . . , vN} is the set of nodes and the set of edges E contains ei−j iff vi and vj are connected. Let x = {xe1, . . . , xeM } ∈X = {0, 1}M be a set of binary variables, one for each edge in the graph (i.e., M = |E|) where we will set xem = 1 iff em is in the tour. For each node vi, let ∂vi = {ei−j | ei−j ∈E} denote the edges adjacent to vi. Given a distance function d : E →ℜ, define the local factors for each edge e ∈E as fe(xe) = xe d(e) – so this is either d(e) or zero. Any valid tour satisfies the following necessary and sufficient constraints – a.k.a. Held-Karp constraints [22]: 1. Degree constraints: Exactly two edges that are adjacent to each vertex should be in the tour. Define the factor f∂vi(x∂vi) : {0, 1}|∂vi| →{0, ∞} to enforce this constraint f∂vi(x∂vi) ≜I∞ X e∈∂vi xe = 2 ! ∀vi ∈V 2 where I∞(condition) ≜0 iff the condition is satisfied and +∞otherwise. 2. Subtour constraints: Ensure that there are no short-circuits – i.e., there are no loops that contain strict subsets of nodes. To enforce this, for each S ⊂V, define δ(S) ≜{ei−j ∈E | vi ∈S, vj /∈S} to be the set of edges, with one end in S and the other end in V \ S. We need to have at least two edges leaving each subset S. The following set of factors enforce these constraints fδ(S)(xδ(S)) = I∞ X xe∈S xe ≥2 ! ∀S ⊂V, S ̸= ∅ These three types of factors define a factor-graph, whose minimum energy configuration is the smallest tour for TSP. 2.2 Graph Partitioning Graph partitioning –a.k.a. community mining– is an active field of research that has recently produced a variety of community detection methods (e.g., see [23] and its references), a notable one of which is Modularity maximization [24]. However, exact optimization of Modularity is NP-hard [25]. Modularity is closely related to fully connected Potts graphical models [26]. However, due to full connectivity of PGM, message passing is not able to find good solutions. Many have proposed various other heuristics for modularity optimization [27, 28, 26, 29, 30]. We introduce a factor-graph representation of this problem that has a large number of factors. We then discuss a stochastic but sparse variation of modularity that enables us to efficiently partition relatively large sparse graphs. 2.2.1 Clustering Factor-Graph Let G = (V, E) be a graph, with a weight function eω : V × V →ℜ, where eω(vi, vj) ̸= 0 iff ei:j ∈E. Let Z = P v1,v2∈V eω(v1, v2) and ω(vi, vj) ≜ eω 2Z be the normalized weights. Also let ω(∂vi) ≜P vj ω(vi, vj) denote the normalized degree of node vi. Graph clustering using modularity optimization seeks a partitioning of the nodes into unspecified number of clusters C = {C1, . . . , CK}, maximizing q(C) = X Ci∈C X vi,vj∈Ci  ω(vi, vj) −ω(∂vi) ω(∂vj)  (1) The first term of modularity is proportional to within-cluster edge-weights. The second term is proportional to the expected number of within cluster edge-weights for a null model with the same weighted node degrees for each node vi. Here the null model is a fully-connected graph. We generate a random sparse null model with Mnull < αM weighted edges (Enull), by randomly sampling two nodes, each drawn independently from P(vi) ∝ p ω(∂vi), and connecting them with a weight proportional to eωnull(vi, vj) ∝ p ω(∂vi)ω(∂vj). If they have been already connected, this weight is added to their current weight. We repeat this process αM times, however since some of the edges are repeated, the total number of edges in the null model may be under αM. Finally the normalized edge-weight in the sparse null model is ωnull(vi, vj) ≜ eωnull(vi,vj) 2 P vi,vj eωnull(vi,vj). It is easy to see that this generative process in expectation produces the fully connected null model.1 Here we use the following binary-valued factor-graph formulation. Let x = {xi1:j1, . . . , xiL:jL} = {0, 1}L be a set of binary variables, one for each edge ei:j ∈E ∪Enull – i.e., |E ∪Enull| = L. Define the local factor for each variable as fi:j(xi:j) = −xi−j(ω(vi, vj) −ωnull(vi, vj)). The idea is to enforce formation of cliques, while minimizing the sum of local factors. By doing so the 1The choice of using square root of weighted degrees for both sampling and weighting is to reduce the variance. One may also use pure importance sampling (i.e., use the product of weighted degrees for sampling and set the edge-weights in the null model uniformly), or uniform sampling of edges, where the edge-weights of the null model are set to the product of weighted degrees. 3 negative sum of local factors evaluates to modularity (eq 1). For each three edges ei:j, ej:k, ei:k ∈ E ∪Enull, i < j < k that form a triangle, define a clique constraint as f{i:j,j:k,i:k}(xi:j, xj:k, xi:k) ≜I∞(xi:j + xj:k + xi:k ̸= 2) These factors ensure the formation of cliques – i.e., if the weights of two edges that are adjacent to the same node are non-zero, the third edge in the triangle should also have non-zero weight. The computational challenge here is the large number of clique constraints. Brandes et al.[25] use a similar LP formulation. However, since they include all the constraints from the beginning and the null model is fully connected, their method is only applied to small toy problems. 3 Message Passing Min-sum belief propagation is an inference procedure, in which a set of messages are exchanged between variables and factors. The factor-to-variable (νI→e) and variable-to-factor (νe→I) messages are defined as νe→I(xe) ≜ X I′∋e,I′̸=I νI′→e(xe) (2) νI→e(xe) ≜ min  fI(xI\e, xe) X e′∈I\e νe′→I(xe′)  xI\e (3) where I ∋e indexes all factors that are adjacent to the variable xe on the factor-graph. Starting from an initial set of messages, this recursive update is performed until convergence. This procedure is exact on trees, factor-graphs with single cycle as well as some special settings [4]. However it is found to produce good approximations in general loopy graphs. When BP is exact, the set of local beliefs µe(xe) ≜P I∋e νI→e(xe) indicate the minimum value that can be obtained for a particular assignment of xe. When there are no ties, the joint assignment x∗, obtained by minimizing individual local beliefs, is optimal. When BP is not exact or the marginal beliefs are tied, a decimation procedure can improve the quality of final assignment. Decimation involves fixing a subset of variables to their most biased values, and repeating the BP update. This process is repeated until all variables are fixed. Another way to improve performance of BP when applied to loopy graphs is to use damping, which often prevents oscillations: νI→e(xe) = λeνI→e(xe) + (1 −λ)νI→e(xe). Here eνI→e is the new message as calculated by eq 3 and λ ∈(0, 1] is the damping parameter. Damping can also be applied to variable-to-factor messages. When applying BP equations eqs 2, 3 to the TSP and clustering factor-graphs, as defined above, we face two computational challenges: (a) Degree constraints for TSP can depend on N variables, resulting in O(2N) time complexity of calculating factor-to-variable messages. For subtour constraints, this is even more expensive as fS(xδ(S)) depends on O(M) (recall M = |E| which can be O(N 2)) variables. (b) The complete TSP factor-graph has O(2N) subtour constraints. Similarly the clustering factor-graph can contain a large number of clique constraints. For the fully connected null model, we need O(N 3) such factors and even using the sparse null model – assuming a random edge probability a.k.a. Erdos-Reny graph – there are O( L3 N 6 N 3) = O( L3 N 3 ) triangles in the graph (recall that L = |E ∪Enull|). In the next section, we derive the compact form of BP messages for both problems. In the case of TSP, we show how to exploit the sparsity of degree and subtour constraints to calculate the factor-to-variable messages in O(N) and O(M) respectively. 3.1 Closed Form of Messages For simplicity we work with normalized message νI→e ≜νI→e(1) −νI→e(0), which is equivalent to assuming νI→e(0) = 0 ∀I, e. The same notation is used for variable-to-factor message, and marginal belief. We refer to the normalized marginal belief, µe = µe(1) −µ(0)e as bias. Despite their exponentially large tabular form, both degree and subtour constraint factors for TSP are sparse. Similar forms of factors is studied in several previous works [7, 8, 9]. By calculating 4 Figure 1: (left) The message passing results after each augmentation step for the complete graph of printing board instance from [31]. The blue lines in each figure show the selected edges at the end of message passing. The pale red lines show the edges with the bias that, although negative (µe < 0), were close to zero. (middle) Clustering of power network (N = 4941) by message passing. Different clusters have different colors and the nodes are scaled by their degree. (right) Clustering of politician blogs network (N = 1490) by message passing and by meta-data – i.e., liberal or conservative. the closed form of these messages for TSP factor-graph, we observe that they have a surprisingly simple form. Rewriting eq 3 for degree constraint factors, we get: ν∂vi→e(1) = min{νe′→∂vi}e′∈∂vi\e , ν∂vi→e(0) = min{νe′→∂vi + νe′′→∂vi}e′,e′′∈∂vi\e (4) where we have dropped the summation and the factor from eq 3. For xe = 1, in order to have f∂vi(x∂i) < ∞, only one other xe′ ∈x∂vi should be non-zero. On the other hand, we know that messages are normalized such that νe→∂vi(0) = 0 ∀vi, e ∈∂vi, which means they can be ignored in the summation. For xe = 0, in order to satisfy the constraint factor, two of the adjacent variables should have a non-zero value. Therefore we seek two such incoming messages with minimum values. Let min[k]A denote the kth smallest value in the set A – i.e., min A ≡min[1]A. We combine the updates above to get a “normalized message”, ν∂vi→e, which is simply the negative of the second largest incoming message (excluding νe→∂vi) to the factor f∂vi: ν∂vi→e = ν∂vi→e(1) −ν∂vi→e(0) = −min[2]{νe′→∂vi}e′∈∂vi\e (5) Following a similar procedure, factor-to-variable messages for subtour constraints is given by νδ(S)→e = −max{0, min[2]{νe′→δ(S)}e′∈δ(S)\e}} (6) Here while we are searching for the minimum incoming message, if we encounter two messages with negative or zero values, we can safely assume νδ(S)→e = 0, and stop the search. This results in significant speedup in practice. Note that both eq 5 and eq 6 only need to calculate the second smallest message in the set {νe′→δ(S)}e′∈δ(S)\e. In the asynchronous calculation of messages, this minimization should be repeated for each outgoing message. However in a synchronous update by finding three smallest incoming messages to each factor, we can calculate all the factor-to-variable messages at the same time. For the clustering factor-graph, the clique factor is satisfied only if either zero, one, or all three of the variables in its domain are non-zero. The factor-to-variable messages are given by ν{i:j,j:k,i:k}→i:j(0) = min{0, νj:k→{i:j,j:k,i:k}, νi:k→{i:j,j:k,i:k}} ν{i:j,j:k,i:k}→i:j(1) = min{0, νj:k→{i:j,j:k,i:k} + νi:k→{i:j,j:k,i:k}} (7) For xi:j = 0, the minimization is over three feasible cases (a) xj:k = xi:k = 0, (b) xj:k = 1, xi:k = 0 and (c) xj:k = 0, xi:k = 1. For xi:j = 1, there are two feasible cases (a) xj:k = xi:k = 0 and (b) xj:k = xi:k = 1. Normalizing these messages we have ν{i:j,j:k,i:k}→i:j = min{0, νj:k→{i:j,j:k,i:k} + νi:k→{i:j,j:k,i:k}}− (8) min{0, νj:k→{i:j,j:k,i:k}, νi:k→{i:j,j:k,i:k}} 3.2 Finding Violations Due to large number of factors, message passing for the full factor-graph in our applications is not practical. Our solution is to start with a minimal set of constraints. For TSP, we start with no subtour constraints and for clustering, we start with no clique constraint. We then use message passing to find marginal beliefs µe and select the edges with positive bias µe > 0. 5 Figure 2: Results of message passing for TSP on different benchmark problems. From left to right, the plots show: (a) running time, (b) optimality ratio (compared to Concorde), (c) iterations of augmentation and (d) number of subtours constraints – all as a function of number of nodes. The optimality is relative to the result reported by Concorde. Note that all plots except optimality are log-log plots where a linear trend shows a monomial relation (y = axm) between the values on the x and y axis, where the slope shows the power m. We then find the constraints that are violated. For TSP, this is achieved by finding connected components C = {Si ⊂V} of the solution in O(N) time and define new subtour constraints for each Si ∈C (see Figure 1(left)). For graph partitioning, we simply look at pairs of positively fixed edges around each node and if the third edge of the triangle is not positively fixed, we add the corresponding clique factor to the factor-graph; see Appendix A for more details. 4 Experiments 4.1 TSP Here we evaluate our method over five benchmark datasets: (I) TSPLIB, which contains a variety of real-world benchmark instances, the majority of which are 2D or 3D Euclidean or geographic 6 Table 1: Comparison of different modularity optimization methods. message passing (full) message passing (sparse) Spin-glass L-Eigenvector FastGreedy Louvian Problem Weighted? Nodes Edges L Cost Modularity Time L Cost Modularity Time Modularity Time Modularity Time Modularity Time Modularity Time polbooks y 105 441 5461 5.68% 0.511 .07 3624 13.55% 0.506 .04 0.525 1.648 0.467 0.179 0.501 0.643 0.489 0.03 football y 115 615 6554 27.85% 0.591 0.41 5635 17.12% 0.594 0.14 0.601 0.87 0.487 0.151 0.548 0.08 0.602 0.019 wkarate n 34 78 562 12.34% 0.431 0 431 15.14% 0.401 0 0.444 0.557 0.421 0.095 0.410 0.085 0.443 0.027 netscience n 1589 2742 NA NA NA NA 53027 .0004% 0.941 2.01 0.907 8.459 0.889 0.303 0.926 0.154 0.948 0.218 dolphins y 62 159 1892 14.02% 0.508 0.01 1269 6.50% 0.521 0.01 0.523 0.728 0.491 0.109 0.495 0.107 0.517 0.011 lesmis n 77 254 2927 5.14% 0.531 0 1601 1.7% 0.534 0.01 0.529 1.31 0.483 0.081 0.472 0.073 0.566 0.011 celegansneural n 297 2359 43957 16.70% 0.391 10.89 21380 3.16% 0.404 2.82 0.406 5.849 0.278 0.188 0.367 0.12 0.435 0.031 polblogs y 1490 19090 NA NA NA NA 156753 .14% 0.411 32.75 0.427 67.674 0.425 0.33 0.427 0.305 0.426 0.099 karate y 34 78 562 14.32% 0.355 0 423 17.54% 0.390 0 0.417 0.531 0.393 0.086 0.380 0.079 0.395 0.009 distances.2 (II) Euclidean distance between random points in 2D. (III) Random (symmetric) distance matrices. (IV) Hamming distance between random binary vectors with fixed length (20 bits). This appears in applications such as data compression [32] and radiation hybrid mapping in genomics [33]. (V) Correlation distance between random vectors with 5 random features (e.g., using TSP for gene co-clustering [34]). In producing random points and features as well as random distances (in (III)), we used uniform distribution over [0, 1]. For each of these cases, we report the (a) run-time, (b) optimality, (c) number of iterations of augmentation and (d) number of subtour factors at the final iteration. In all of the experiments, we use Concorde [18] with its default settings to obtain the optimal solution.3 Since there are very large number of TSP solvers, comparison with any particular method is pointless. Instead we evaluate the quality of message passing against the “optimal” solution. The results in Figure 2(2nd column from left) reports the optimality ratio – i.e., ratio of the tour found by message passing, to the optimal tour. To demonstrate the non-triviality of these instance, we also report the optimality ratio for two heuristics that have optimality guarantees for metric instances [35]: (a) nearest neighbour heuristic (O(N 2)), which incrementally adds the to any end of the current path the closest city that does not form a loop; (b) greedy algorithm (O(N 2 log(N))), which incrementally adds a lowest cost edge to the current edge-set, while avoiding subtours. In all experiments, we used the full graph G = (V, E), which means each iteration of message passing is O(N 2τ), where τ is the number of subtour factors. All experiments use Tmax = 200 iterations, ϵmax = median{d(e)}e∈E and damping with λ = .2. We used decimation, and fixed 10% of the remaining variables (out of N) per iteration of decimation.4 This increases the cost of message passing by an O(log(N)) multiplicative factor, however it often produces better results. All the plots in Figure 2, except for the second column, are in log-log format. When using log-log plot, a linear trend shows a monomial relation between x and y axes – i.e., y = axm. Here m indicates the slope of the line in the plot and the intercept corresponds to log(a). By studying the slope of the linear trend in the run-time (left column) in Figure 2, we observe that, for almost all instances, message passing seems to grow with N 3 (i.e., slope of ∼3). Exceptions are TSPLIB instances, which seem to pose a greater challenge, and random distance matrices which seem to be easier for message passing. A similar trend is suggested by the number of subtour constraints and iterations of augmentation, which has a slope of ∼1, suggesting a linear dependence on N. Again the exceptions are TSPLIB instances that grow faster than N and random distance matrices that seem to grow sub-linearly.5 Finally, the results in the second column suggests that message passing is able to find near optimal (in average ∼1.1-optimal) solutions for almost all instances and the quality of tours does not degrade with increasing number of nodes. 2Geographic distance is the distance on the surface of the earth as a large sphere. 3For many larger instances, Concorde (with default setting and using CPLEX as LP solver) was not able to find the optimal solution. Nevertheless we used the upper-bound on the optimal produced by Concord in evaluating our method. 4Note that here we are only fixing the top N variables with positive bias. The remaining M −N variables are automatically clamped to zero. 5Since we measured the time in milliseconds, the first column does not show the instances that had a running time of less than a millisecond. 7 4.2 Graph Partitioning For graph partitioning, we experimented with a set of classic benchmarks6. Since the optimization criteria is modularity, we compared our method only against best known “modularity optimization” heuristics: (a) FastModularity[27], (b) Louvain [30], (c) Spin-glass [26] and (d) Leading eigenvector [28]. For message passing, we use λ = .1, ϵmax = median{|ω(e) −ωnull(e)|}e∈E∪Enull and Tmax = 10. Here we do not perform any decimation and directly fix the variables based on their bias µe > 0 ⇔xe = 1. Table 1 summarizes our results (see also Figure 1(middle,right)). Here for each method and each data-set, we report the time (in seconds) and the Modularity of the communities found by each method. The table include the results of message passing for both full and sparse null models, where we used a constant α = 20 to generate our stochastic sparse null model. For message passing, we also included L = |E + Enull| and the saving in the cost using augmentation. This column shows the percentage of the number of all the constraints considered by the augmentation. For example, the cost of .14% for the polblogs data-set shows that augmentation and sparse null model meant using .0014 times fewer clique-factors, compared to the full factor-graph. Overall, the results suggest that our method is comparable to state-of-the-art in terms both time and quality of clustering. But more importantly it shows that augmentative message passing is able to find feasible solutions using a small portion of the constraints. 5 Conclusion We investigate the possibility of using cutting-plane-like, augmentation procedures with message passing. We used this procedure to solve two combinatorial problems; TSP and modularity optimization. In particular, our polynomial-time message passing solution to TSP often finds near-optimal solutions to a variety of benchmark instances. Despite losing the guarantees that make cutting plane method very powerful, our approach has several advantages: First, message passing is more efficient than LP for structured optimization [13] and it is highly parallelizable. Moreover by directly obtaining integral solutions, it is much easier to find violated constraints. (Note the cutting plane method for combinatorial problems operates on fractional solutions, whose rounding may eliminate its guarantees.) For example, for TSPs, our method simply adds violated constraints by finding connected components. However, due to non-integral assignments, cutting plane methods require sophisticated tricks to find violations [21]. Although powerful branch-and-cut methods, such as Concorde, are able to exactly solve instances with few thousands of variables, their general run-time on benchmark instances remains exponential [18, p495], while our approximation appears to be O(N 3). Overall our studies indicate that augmentative message passing is an efficient procedure for constraint optimization with large number of constraints. References [1] M. Mezard, G. Parisi, and R. Zecchina, “Analytic and algorithmic solution of random satisfiability problems,” Science, 2002. [2] S. Ravanbakhsh and R. Greiner, “Perturbed message passing for constraint satisfaction problems,” arXiv preprint arXiv:1401.6686, 2014. [3] B. Frey and D. Dueck, “Clustering by passing messages between data points,” Science, 2007. [4] M. Bayati, D. Shah, and M. Sharma, “Maximum weight matching via max-product belief propagation,” in ISIT, 2005. [5] S. Ravanbakhsh, C. Srinivasa, B. Frey, and R. Greiner, “Min-max problems on factor-graphs,” ICML, 2014. [6] B. Huang and T. Jebara, “Approximating the permanent with belief propagation,” arXiv preprint arXiv:0908.1769, 2009. 6Obtained form Mark Newman’s website: http://www-personal.umich.edu/˜mejn/ netdata/ 8 [7] B. Potetz and T. S. Lee, “Efficient belief propagation for higher-order cliques using linear constraint nodes,” Computer Vision and Image Understanding, vol. 112, no. 1, pp. 39–54, 2008. [8] R. Gupta, A. A. Diwan, and S. Sarawagi, “Efficient inference with cardinality-based clique potentials,” in ICML, 2007. [9] D. Tarlow, I. E. Givoni, and R. S. Zemel, “Hop-map: Efficient message passing with high order potentials,” in International Conference on Artificial Intelligence and Statistics, pp. 812–819, 2010. [10] G. Dantzig, R. Fulkerson, and S. Johnson, “Solution of a large-scale traveling-salesman problem,” J Operations Research society of America, 1954. [11] R. E. Gomory et al., “Outline of an algorithm for integer solutions to linear programs,” Bulletin of the American Mathematical Society, vol. 64, no. 5, pp. 275–278, 1958. [12] D. Sontag and T. S. Jaakkola, “New outer bounds on the marginal polytope,” in Advances in Neural Information Processing Systems, pp. 1393–1400, 2007. [13] C. Yanover, T. Meltzer, and Y. Weiss, “Linear programming relaxations and belief propagation–an empirical study,” JMLR, 2006. [14] F. Kschischang and B. Frey, “Factor graphs and the sum-product algorithm,” Information Theory, IEEE, 2001. [15] C. H. Papadimitriou, “The euclidean travelling salesman problem is np-complete,” Theoretical Computer Science, vol. 4, no. 3, pp. 237–244, 1977. [16] M. Held and R. M. Karp, “A dynamic programming approach to sequencing problems,” Journal of the Society for Industrial & Applied Mathematics, vol. 10, no. 1, p. 196210, 1962. [17] M. Padberg and G. Rinaldi, “A branch-and-cut algorithm for the resolution of large-scale symmetric traveling salesman problems,” SIAM review, vol. 33, no. 1, pp. 60–100, 1991. [18] D. Applegate, R. Bixby, V. Chvatal, and W. Cook, “Concorde TSP solver,” 2006. [19] K. Helsgaun, “General k-opt submoves for the lin–kernighan tsp heuristic,” Mathematical Programming Computation, 2009. [20] C. Wang, J. Lai, and W. Zheng, “Message-passing for the traveling salesman problem,” [21] D. Applegate, The traveling salesman problem: a computational study. Princeton, 2006. [22] M. Held and R. Karp, “The traveling-salesman problem and minimum spanning trees,” Operations Research, 1970. [23] J. Leskovec, K. Lang, and M. Mahoney, “Empirical comparison of algorithms for network community detection,” in WWW, 2010. [24] M. Newman and M. Girvan, “Finding and evaluating community structure in networks,” Physical Review E, 2004. [25] U. Brandes, D. Delling, et al., “on clustering,” IEEE KDE, 2008. [26] J. Reichardt and S. Bornholdt, “Detecting fuzzy community structures in complex networks with a potts model,” Physical Review Letters, vol. 93, no. 21, p. 218701, 2004. [27] A. Clauset, “Finding local community structure in networks,” Physical Review E, 2005. [28] M. Newman, “Finding community structure in networks using the eigenvectors of matrices,” Physical review E, 2006. [29] P. Ronhovde and Z. Nussinov, “Local resolution-limit-free potts model for community detection,” Physical Review E, vol. 81, no. 4, p. 046114, 2010. [30] V. Blondel, J. Guillaume, et al., “Fast unfolding of communities in large networks,” J Statistical Mechanics, 2008. [31] G. Reinelt, “Tspliba traveling salesman problem library,” ORSA journal on computing, vol. 3, no. 4, pp. 376–384, 1991. [32] D. Johnson, S. Krishnan, J. Chhugani, S. Kumar, and S. Venkatasubramanian, “Compressing large Boolean matrices using reordering techniques,” in VLDB, 2004. [33] A. Ben-Dor and B. Chor, “On constructing radiation hybrid maps,” J Computational Biology, 1997. [34] S. Climer and W. Zhang, “Take a walk and cluster genes: A TSP-based approach to optimal rearrangement clustering,” in ICML, 2004. [35] D. Johnson and L. McGeoch, “The traveling salesman problem: A case study in local optimization,” Local search in combinatorial optimization, 1997. 9
2014
337
5,444
Mondrian Forests: Efficient Online Random Forests Balaji Lakshminarayanan Gatsby Unit University College London Daniel M. Roy Department of Engineering University of Cambridge Yee Whye Teh Department of Statistics University of Oxford Abstract Ensembles of randomized decision trees, usually referred to as random forests, are widely used for classification and regression tasks in machine learning and statistics. Random forests achieve competitive predictive performance and are computationally efficient to train and test, making them excellent candidates for real-world prediction tasks. The most popular random forest variants (such as Breiman’s random forest and extremely randomized trees) operate on batches of training data. Online methods are now in greater demand. Existing online random forests, however, require more training data than their batch counterpart to achieve comparable predictive performance. In this work, we use Mondrian processes (Roy and Teh, 2009) to construct ensembles of random decision trees we call Mondrian forests. Mondrian forests can be grown in an incremental/online fashion and remarkably, the distribution of online Mondrian forests is the same as that of batch Mondrian forests. Mondrian forests achieve competitive predictive performance comparable with existing online random forests and periodically retrained batch random forests, while being more than an order of magnitude faster, thus representing a better computation vs accuracy tradeoff. 1 Introduction Despite being introduced over a decade ago, random forests remain one of the most popular machine learning tools due in part to their accuracy, scalability, and robustness in real-world classification tasks [3]. (We refer to [6] for an excellent survey of random forests.) In this paper, we introduce a novel class of random forests—called Mondrian forests (MF), due to the fact that the underlying tree structure of each classifier in the ensemble is a so-called Mondrian process. Using the properties of Mondrian processes, we present an efficient online algorithm that agrees with its batch counterpart at each iteration. Not only are online Mondrian forests faster and more accurate than recent proposals for online random forest methods, but they nearly match the accuracy of state-of-the-art batch random forest methods trained on the same dataset. The paper is organized as follows: In Section 2, we describe our approach at a high-level, and in Sections 3, 4, and 5, we describe the tree structures, label model, and incremental updates/predictions in more detail. We discuss related work in Section 6, demonstrate the excellent empirical performance of MF in Section 7, and conclude in Section 8 with a discussion about future work. 2 Approach Given N labeled examples (x1, y1), . . . , (xN, yN) 2 RD ⇥Y as training data, our task is to predict labels y 2 Y for unlabeled test points x 2 RD. We will focus on multi-class classification where Y := {1, . . . , K}, however, it is possible to extend the methodology to other supervised learning tasks such as regression. Let X1:n := (x1, . . . , xn), Y1:n := (y1, . . . , yn), and D1:n := (X1:n, Y1:n). A Mondrian forest classifier is constructed much like a random forest: Given training data D1:N, we sample an independent collection T1, . . . , TM of so-called Mondrian trees, which we will describe in the next section. The prediction made by each Mondrian tree Tm is a distribution pTm(y|x, D1:N) over the class label y for a test point x. The prediction made by the Mondrian forest is the average 1 M PM m=1 pTm(y|x, D1:N) of the individual tree predictions. As M ! 1, the average converges at the standard rate to the expectation ET ⇠MT(λ,D1:N)[ pT (y|x, D1:N)], where MT (λ, D1:N) is the distribution of a Mondrian tree. As the limiting expectation does not depend on M, we would not expect to see overfitting behavior as M increases. A similar observation was made by Breiman in his seminal article [2] introducing random forests. Note that the averaging procedure above is ensemble model combination and not Bayesian model averaging. In the online learning setting, the training examples are presented one after another in a sequence of trials. Mondrian forests excel in this setting: at iteration N + 1, each Mondrian tree T ⇠ MT (λ, D1:N) is updated to incorporate the next labeled example (xN+1, yN+1) by sampling an extended tree T 0 from a distribution MTx(λ, T, DN+1). Using properties of the Mondrian process, we can choose a probability distribution MTx such that T 0 = T on D1:N and T 0 is distributed according to MT (λ, D1:N+1), i.e., T ⇠MT (λ, D1:N) T 0 | T, D1:N+1 ⇠MTx(λ, T, DN+1) implies T 0 ⇠MT (λ, D1:N+1) . (1) Therefore, the distribution of Mondrian trees trained on a dataset in an incremental fashion is the same as that of Mondrian trees trained on the same dataset in a batch fashion, irrespective of the order in which the data points are observed. To the best of our knowledge, none of the existing online random forests have this property. Moreover, we can sample from MTx(λ, T, DN+1) efficiently: the complexity scales with the depth of the tree, which is typically logarithmic in N. While treating the online setting as a sequence of larger and larger batch problems is normally computationally prohibitive, this approach can be achieved efficiently with Mondrian forests. In the following sections, we define the Mondrian tree distribution MT (λ, D1:N), the label distribution pT (y|x, D1:N), and the update distribution MTx(λ, T, DN+1). 3 Mondrian trees For our purposes, a decision tree on RD will be a hierarchical, binary partitioning of RD and a rule for predicting the label of test points given training data. More carefully, a rooted, strictly-binary tree is a finite tree T such that every node in T is either a leaf or internal node, and every node is the child of exactly one parent node, except for a distinguished root node, represented by ✏, which has no parent. Let leaves(T) denote the set of leaf nodes in T. For every internal node j 2 T \ leaves(T), there are exactly two children nodes, represented by left(j) and right(j). To each node j 2 T, we associate a block Bj ✓RD of the input space as follows: We let B✏:= RD. Each internal node j 2 T\leaves(T) is associated with a split " δj, ⇠j # , where δj 2 {1, 2, . . . , D} denotes the dimension of the split and ⇠j denotes the location of the split along dimension δj. We then define Bleft(j) := {x 2 Bj : xδj ⇠j} and Bright(j) := {x 2 Bj : xδj > ⇠j}. (2) We may write Bj = " `j1, uj1 ⇤ ⇥. . . ⇥ " `jD, ujD ⇤ , where `jd and ujd denote the `ower and upper bounds, respectively, of the rectangular block Bj along dimension d. Put `j = {`j1, `j2, . . . , `jD} and uj = {uj1, uj2, . . . , ujD}. The decision tree structure is represented by the tuple T = (T, δ, ⇠). We refer to Figure 1(a) for a simple illustration of a decision tree. It will be useful to introduce some additional notation. Let parent(j) denote the parent of node j. Let N(j) denote the indices of training data points at node j, i.e., N(j) = {n 2 {1, . . . , N} : xn 2 Bj}. Let DN(j) = {XN(j), YN(j)} denote the features and labels of training data points at node j. Let `x jd and ux jd denote the lower and upper bounds of training data points (hence the superscript x) respectively in node j along dimension d. Let Bx j = " `x j1, ux j1 ⇤ ⇥. . . ⇥ " `x jD, ux jD ⇤ ✓Bj denote the smallest rectangle that encloses the training data points in node j. 3.1 Mondrian process distribution over decision trees Mondrian processes, introduced by Roy and Teh [19], are families {Mt : t 2 [0, 1)} of random, hierarchical binary partitions of RD such that Mt is a refinement of Ms whenever t > s.1 Mondrian processes are natural candidates for the partition structure of random decision trees, but Mondrian 1Roy and Teh [19] studied the distribution of {Mt : t λ} and refered to λ as the budget. See [18, Chp. 5] for more details. We will refer to t as time, not be confused with discrete time in the online learning setting. 2 x1 > 0.37 x2 > 0.5 , ⌅,⌅ F,F ⌅ ⌅ F F x2 x1 0 1 1 Bj (a) Decision Tree x1 > 0.37 x2 > 0.5 , ⌅,⌅ F,F − − − − 0 0.42 0.7 1 ⌅ ⌅ F F x2 x1 0 1 1 Bx j (b) Mondrian Tree Figure 1: Example of a decision tree in [0, 1]2 where x1 and x2 denote horizontal and vertical axis respectively: Figure 1(a) shows tree structure and partition of a decision tree, while Figure 1(b) shows a Mondrian tree. Note that the Mondrian tree is embedded on a vertical time axis, with each node associated with a time of split and the splits are committed only within the range of the training data in each block (denoted by gray rectangles). Let j denote the left child of the root: Bj = (0, 0.37] ⇥(0, 1] denotes the block associated with red circles and Bx j ✓Bj is the smallest rectangle enclosing the two data points. processes on RD are, in general, infinite structures that we cannot represent all at once. Because we only care about the partition on a finite set of observed data, we introduce Mondrian trees, which are restrictions of Mondrian processes to a finite set of points. A Mondrian tree T can be represented by a tuple (T, δ, ⇠, ⌧), where (T, δ, ⇠) is a decision tree and ⌧= {⌧j}j2T associates a time of split ⌧j ≥0 with each node j. Split times increase with depth, i.e., ⌧j > ⌧parent(j). We abuse notation and define ⌧parent(✏) = 0. Given a non-negative lifetime parameter λ and training data D1:n, the generative process for sampling Mondrian trees from MT (λ, D1:n) is described in the following two algorithms: Algorithm 1 SampleMondrianTree " λ, D1:n # 1: Initialize: T = ;, leaves(T) = ;, δ = ;, ⇠= ;, ⌧= ;, N(✏) = {1, 2, . . . , n} 2: SampleMondrianBlock " ✏, DN(✏), λ # . Algorithm 2 Algorithm 2 SampleMondrianBlock " j, DN(j), λ # 1: Add j to T 2: For all d, set `x jd = min(XN(j),d), ux jd = max(XN(j),d) . dimension-wise min and max 3: Sample E from exponential distribution with rate P d(ux jd −`x jd) 4: if ⌧parent(j) + E < λ then . j is an internal node 5: Set ⌧j = ⌧parent(j) + E 6: Sample split dimension δj, choosing d with probability proportional to ux jd −`x jd 7: Sample split location ⇠j uniformly from interval [`x jδj, ux jδj] 8: Set N(left(j)) = {n 2 N(j) : Xn,δj ⇠j} and N(right(j)) = {n 2 N(j) : Xn,δj > ⇠j} 9: SampleMondrianBlock " left(j), DN(left(j)), λ # 10: SampleMondrianBlock " right(j), DN(right(j)), λ # 11: else . j is a leaf node 12: Set ⌧j = λ and add j to leaves(T) The procedure starts with the root node ✏and recurses down the tree. In Algorithm 2, we first compute the `x ✏and ux ✏i.e. the lower and upper bounds of Bx ✏, the smallest rectangle enclosing XN(✏). We sample E from an exponential distribution whose rate is the so-called linear dimension of Bx ✏, given by P d(ux ✏d −`x ✏d). Since ⌧parent(✏) = 0, E + ⌧parent(✏) = E. If E ≥λ, the time of split is not within the lifetime λ; hence, we assign ✏to be a leaf node and the procedure halts. (Since E[E] = 1/ "P d(ux jd −`x jd) # , bigger rectangles are less likely to be leaf nodes.) Else, ✏is an internal node and we sample a split (δ✏, ⇠✏) from the uniform split distribution on Bx ✏. More precisely, we first sample the dimension δ✏, taking the value d with probability proportional to ux ✏d −`x ✏d, and then sample the split location ⇠✏uniformly from the interval [`x ✏δ✏, ux ✏δ✏]. The procedure then recurses along the left and right children. Mondrian trees differ from standard decision trees (e.g. CART, C4.5) in the following ways: (i) the splits are sampled independent of the labels YN(j); (ii) every node j is associated with a split 3 time denoted by ⌧j; (iii) the lifetime parameter λ controls the total number of splits (similar to the maximum depth parameter for standard decision trees); (iv) the split represented by an internal node j holds only within Bx j and not the whole of Bj. No commitment is made in Bj \ Bx j . Figure 1 illustrates the difference between decision trees and Mondrian trees. Consider the family of distributions MT (λ, F), where F ranges over all possible finite sets of data points. Due to the fact that these distributions are derived from that of a Mondrian process on RD restricted to a set F of points, the family MT (λ, ·) will be projective. Intuitively, projectivity implies that the tree distributions possess a type of self-consistency. In words, if we sample a Mondrian tree T from MT (λ, F) and then restrict the tree T to a subset F 0 ✓F of points, then the restricted tree T 0 has distribution MT (λ, F 0). Most importantly, projectivity gives us a consistent way to extend a Mondrian tree on a data set D1:N to a larger data set D1:N+1. We exploit this property to incrementally grow a Mondrian tree: we instantiate the Mondrian tree on the observed training data points; upon observing a new data point DN+1, we extend the Mondrian tree by sampling from the conditional distribution of a Mondrian tree on D1:N+1 given its restriction to D1:N, denoted by MTx(λ, T, DN+1) in (1). Thus, a Mondrian process on RD is represented only where we have observed training data. 4 Label distribution: model, hierarchical prior, and predictive posterior So far, our discussion has been focused on the tree structure. In this section, we focus on the predictive label distribution, pT (y|x, D1:N), for a tree T = (T, δ, ⇠, ⌧), dataset D1:N, and test point x. Let leaf(x) denote the unique leaf node j 2 leaves(T) such that x 2 Bj. Intuitively, we want the predictive label distribution at x to be a smoothed version of the empirical distribution of labels for points in Bleaf(x) and in Bj0 for nearby nodes j0. We achieve this smoothing via a hierarchical Bayesian approach: every node is associated with a label distribution, and a prior is chosen under which the label distribution of a node is similar to that of its parent’s. The predictive pT (y|x, D1:N) is then obtained via marginalization. As is common in the decision tree literature, we assume the labels within each block are independent of X given the tree structure. For every j 2 T, let Gj denote the distribution of labels at node j, and let G = {Gj : j 2 T} be the set of label distributions at all the nodes in the tree. Given T and G, the predictive label distribution at x is p(y|x, T, G) = Gleaf(x), i.e., the label distribution at the node leaf(x). In this paper, we focus on the case of categorical labels taking values in the set {1, . . . , K}, and so we abuse notation and write Gj,k for the probability that a point in Bj is labeled k. We model the collection Gj, for j 2 T, as a hierarchy of normalized stable processes (NSP) [24]. A NSP prior is a distribution over distributions and is a special case of the Pitman-Yor process (PYP) prior where the concentration parameter is taken to zero [17].2 The discount parameter d 2 (0, 1) controls the variation around the base distribution; if Gj ⇠NSP(d, H), then E[Gjk] = Hk and Var[Gjk] = (1 −d)Hk(1 −Hk). We use a hierarchical NSP (HNSP) prior over Gj as follows: G✏|H ⇠NSP(d✏, H), and Gj|Gparent(j) ⇠NSP(dj, Gparent(j)). (3) This hierarchical prior was first proposed by Wood et al. [24]. Here we take the base distribution H to be the uniform distribution over the K labels, and set dj = exp " −γ(⌧j −⌧parent(j)) # . Given training data D1:N, the predictive distribution pT (y|x, D1:N) is obtained by integrating over G, i.e., pT (y|x, D1:N) = EG⇠pT (G|D1:N)[Gleaf(x),y] = Gleaf(x),y, where the posterior pT (G|D1:N) / pT (G) QN n=1 Gleaf(xn),yn. Posterior inference in the HNSP, i.e., computation of the posterior means Gleaf(x), is a special case of posterior inference in the hierarchical PYP (HPYP). In particular, Teh [22] considers the HPYP with multinomial likelihood (in the context of language modeling). The model considered here is a special case of [22]. Exact inference is intractable and hence we resort to approximations. In particular, we use a fast approximation known as the interpolated Kneser-Ney (IKN) smoothing [22], a popular technique for smoothing probabilities in language modeling [13]. The IKN approximation in [22] can be extended in a straightforward fashion to the online setting, and the computational complexity of adding a new training instance is linear in the depth of the tree. We refer the reader to Appendix A for further details. 2Taking the discount parameter to zero leads to a Dirichlet process . Hierarchies of NSPs admit more tractable approximations than hierarchies of Dirichlet processes [24], hence our choice here. 4 5 Online training and prediction In this section, we describe the family of distributions MTx(λ, T, DN+1), which are used to incrementally add a data point, DN+1, to a tree T. These updates are based on the conditional Mondrian algorithm [19], specialized to a finite set of points. In general, one or more of the following three operations may be executed while introducing a new data point: (i) introduction of a new split ‘above’ an existing split, (ii) extension of an existing split to the updated extent of the block and (iii) splitting an existing leaf node into two children. To the best of our knowledge, existing online decision trees use just the third operation, and the first two operations are unique to Mondrian trees. The complete pseudo-code for incrementally updating a Mondrian tree T with a new data point D according to MTx(λ, T, D) is described in the following two algorithms. Figure 2 walks through the algorithms on a toy dataset. Algorithm 3 ExtendMondrianTree(T, λ, D) 1: Input: Tree T = (T, δ, ⇠, ⌧), new training instance D = (x, y) 2: ExtendMondrianBlock(T, λ, ✏, D) . Algorithm 4 Algorithm 4 ExtendMondrianBlock(T, λ, j, D) 1: Set e` = max(`x j −x, 0) and eu = max(x −ux j , 0) . e` = eu = 0D if x 2 Bx j 2: Sample E from exponential distribution with rate P d(e` d + eu d) 3: if ⌧parent(j) + E < ⌧j then . introduce new parent for node j 4: Sample split dimension δ, choosing d with probability proportional to e` d + eu d 5: Sample split location ⇠uniformly from interval [ux j,δ, xδ] if xδ > ux j,δ else [xδ, `x j,δ]. 6: Insert a new node ˜| just above node j in the tree, and a new leaf j00, sibling to j, where 7: δ˜| = δ, ⇠˜| = ⇠, ⌧˜| = ⌧parent(j) + E, `x ˜| = min(`x j , x), ux ˜| = max(ux j , x) 8: j00 = left(˜|) iff xδ˜| ⇠˜| 9: SampleMondrianBlock " j00, D, λ # 10: else 11: Update `x j min(`x j , x), ux j max(ux j , x) . update extent of node j 12: if j /2 leaves(T) then . return if j is a leaf node, else recurse down the tree 13: if xδj ⇠j then child(j) = left(j) else child(j) = right(j) 14: ExtendMondrianBlock(T, λ, child(j), D) . recurse on child containing D In practice, random forest implementations stop splitting a node when all the labels are identical and assign it to be a leaf node. To make our MF implementation comparable, we ‘pause’ a Mondrian block when all the labels are identical; if a new training instance lies within Bj of a paused leaf node j and has the same label as the rest of the data points in Bj, we continue pausing the Mondrian block. We ‘un-pause’ the Mondrian block when there is more than one unique label in that block. Algorithms 9 and 10 in the supplementary material discuss versions of SampleMondrianBlock and ExtendMondrianBlock for paused Mondrians. Prediction using Mondrian tree Let x denote a test data point. If x is already ‘contained’ in the tree T, i.e., if x 2 Bx j for some leaf j 2 leaves(T), then the prediction is taken to be Gleaf(x). Otherwise, we somehow need to incorporate x. One choice is to extend T by sampling T 0 from MTx(λ, T, x) as described in Algorithm 3, and set the prediction to Gj, where j 2 leaves(T0) is the leaf node containing x. A particular extension T 0 might lead to an overly confident prediction; hence, we average over every possible extension T 0. This integration can be carried out analytically and the computational complexity is linear in the depth of the tree. We refer to Appendix B for further details. 6 Related work The literature on random forests is vast and we do not attempt to cover it comprehensively; we provide a brief review here and refer to [6] and [8] for a recent review of random forests in batch and online settings respectively. Classic decision tree induction procedures choose the best split dimension and location from all candidate splits at each node by optimizing some suitable quality criterion (e.g. information gain) in a greedy manner. In a random forest, the individual trees are randomized to de-correlate their predictions. The most common strategies for injecting randomness are (i) bagging [1] and (ii) randomly subsampling the set of candidate splits within each node. 5 x2 x1 0 1 1 a b x2 x1 0 1 1 a b c x2 x1 0 1 1 a b c x2 x1 0 1 1 a b c d x2 x1 0 1 1 a b c d x2 x1 0 1 1 a b c d (a) (b) (c) (d) (e) (f) x2 > 0.23 a b − − − − − 0 1.01 2.42 3.97 1 x1 > 0.75 x2 > 0.23 a b c x1 > 0.75 x2 > 0.23 x1 > 0.47 a b c d (g) (h) (i) Figure 2: Online learning with Mondrian trees on a toy dataset: We assume that λ = 1, D = 2 and add one data point at each iteration. For simplicity, we ignore class labels and denote location of training data with red circles. Figures 2(a), 2(c) and 2(f) show the partitions after the first, second and third iterations, respectively, with the intermediate figures denoting intermediate steps. Figures 2(g), 2(h) and 2(i) show the trees after the first, second and third iterations, along with a shared vertical time axis. At iteration 1, we have two training data points, labeled as a, b. Figures 2(a) and 2(g) show the partition and tree structure of the Mondrian tree. Note that even though there is a split x2 > 0.23 at time t = 2.42, we commit this split only within Bx j (shown by the gray rectangle). At iteration 2, a new data point c is added. Algorithm 3 starts with the root node and recurses down the tree. Algorithm 4 checks if the new data point lies within Bx ✏by computing the additional extent e` and eu. In this case, c does not lie within Bx ✏. Let Rab and Rabc respectively denote the small gray rectangle (enclosing a, b) and big gray rectangle (enclosing a, b, c) in Figure 2(b). While extending the Mondrian from Rab to Rabc, we could either introduce a new split in Rabc outside Rab or extend the split in Rab to the new range. To choose between these two options, we sample the time of this new split: we first sample E from an exponential distribution whose rate is the sum of the additional extent, i.e., P d(e` d + eu d), and set the time of the new split to E + ⌧parent(✏). If E + ⌧parent(✏) ⌧✏, this new split in Rabc can precede the old split in Rab and a split is sampled in Rabc outside Rab. In Figures 2(c) and 2(h), E + ⌧parent(✏) = 1.01 + 0 2.42, hence a new split x1 > 0.75 is introduced. The farther a new data point x is from Bx j , the higher the rate P d(e` d + eu d), and subsequently the higher the probability of a new split being introduced, since E[E] = 1/ "P d(e` d + eu d) #. A new split in Rabc is sampled such that it is consistent with the existing partition structure in Rab (i.e., the new split cannot slice through Rab). In the final iteration, we add data point d. In Figure 2(d), the data point d lies within the extent of the root node, hence we traverse to the left side of the root and update Bx j of the internal node containing {a, b} to include d. We could either introduce a new split or extend the split x2 > 0.23. In Figure 2(e), we extend the split x2 > 0.23 to the new extent, and traverse to the leaf node in Figure 2(h) containing b. In Figures 2(f) and 2(i), we sample E = 1.55 and since ⌧parent(j) + E = 2.42 + 1.55 = 3.97 λ = 1, we introduce a new split x1 > 0.47. Two popular random forest variants in the batch setting are Breiman-RF [2] and Extremely randomized trees (ERT) [12]. Breiman-RF uses bagging and furthermore, at each node, a random k-dimensional subset of the original D features is sampled. ERT chooses a k dimensional subset of the features and then chooses one split location each for the k features randomly (unlike Breiman-RF which considers all possible split locations along a dimension). ERT does not use bagging. When k = 1, the ERT trees are totally randomized and the splits are chosen independent of the labels; hence the ERT-1 method is very similar to MF in the batch setting in terms of tree induction. (Note that unlike ERT, MF uses HNSP to smooth predictive estimates and allows a test point to branch off into its own node.) Perfect random trees (PERT), proposed by Cutler and Zhao [7] for classification problems, produce totally randomized trees similar to ERT-1, although there are some slight differences [12]. Existing online random forests (ORF-Saffari [20] and ORF-Denil [8]) start with an empty tree and grow the tree incrementally. Every leaf of every tree maintains a list of k candidate splits and associated quality scores. When a new data point is added, the scores of the candidate splits at the corresponding leaf node are updated. To reduce the risk of choosing a sub-optimal split based on noisy quality scores, additional hyper parameters such as the minimum number of data points at a leaf node before a decision is made and the minimum threshold for the quality criterion of the best split, are used to assess ‘confidence’ associated with a split. Once these criteria are satisfied at a leaf node, the best split is chosen (making this node an internal node) and its two children are the new leaf nodes (with their own candidate splits), and the process is repeated. These methods could be 6 memory inefficient for deep trees due to the high cost associated with maintaining candidate quality scores for the fringe of potential children [8]. There has been some work on incremental induction of decision trees, e.g. incremental CART [5], ITI [23], VFDT [11] and dynamic trees [21], but to the best of our knowledge, these are focused on learning decision trees and have not been generalized to online random forests. We do not compare MF to incremental decision trees, since random forests are known to outperform single decision trees. Bayesian models of decision trees [4, 9] typically specify a distribution over decision trees; such distributions usually depend on X and lack the projectivity property of the Mondrian process. More importantly, MF performs ensemble model combination and not Bayesian model averaging over decision trees. (See [10] for a discussion on the advantages of ensembles over single models, and [15] for a comparison of Bayesian model averaging and model combination.) 7 Empirical evaluation The purpose of these experiments is to evaluate the predictive performance (test accuracy) of MF as a function of (i) fraction of training data and (ii) training time. We divide the training data into 100 mini-batches and we compare the performance of online random forests (MF, ORF-Saffari [20]) to batch random forests (Breiman-RF, ERT-k, ERT-1) which are trained on the same fraction of the training data. (We compare MF to dynamic trees as well; see Appendix F for more details.) Our scripts are implemented in Python. We implemented the ORF-Saffari algorithm as well as ERT in Python for timing comparisons. The scripts can be downloaded from the authors’ webpages. We did not implement the ORF-Denil [8] algorithm since the predictive performance reported in [8] is very similar to that of ORF-Saffari and the computational complexity of the ORF-Denil algorithm is worse than that of ORF-Saffari. We used the Breiman-RF implementation in scikit-learn [16].3 We evaluate on four of the five datasets used in [20] — we excluded the mushroom dataset as even very simple logical rules achieve > 99% accuracy on this dataset.4 We re-scaled the datasets such that each feature takes on values in the range [0, 1] (by subtracting the min value along that dimension and dividing by the range along that dimension, where range = max −min). As is common in the random forest literature [2], we set the number of trees M = 100. For Mondrian forests, we set the lifetime λ = 1 and the HNSP discount parameter γ = 10D. For ORF-Saffari, we set num epochs = 20 (number of passes through the training data) and set the other hyper parameters to the values used in [20]. For Breiman-RF and ERT, the hyper parameters are set to default values. We repeat each algorithm with five random initializations and report the mean performance. The results are shown in Figure 3. (The * in Breiman-RF* indicates scikit-learn implementation.) Comparing test accuracy vs fraction of training data on usps, satimages and letter datasets, we observe that MF achieves accuracy very close to the batch RF versions (Breiman-RF, ERT-k, ERT-1) trained on the same fraction of the data. MF significantly outperforms ORF-Saffari trained on the same fraction of training data. In batch RF versions, the same training data can be used to evaluate candidate splits at a node and its children. However, in the online RF versions (ORF-Saffari and ORF-Denil), incoming training examples are used to evaluate candidate splits just at a current leaf node and new training data are required to evaluate candidate splits every time a new leaf node is created. Saffari et al. [20] recommend multiple passes through the training data to increase the effective number of training samples. In a realistic streaming data setup, where training examples cannot be stored for multiple passes, MF would require significantly fewer examples than ORF-Saffari to achieve the same accuracy. Comparing test accuracy vs training time on usps, satimages and letter datasets, we observe that MF is at least an order of magnitude faster than re-trained batch versions and ORF-Saffari. For ORF-Saffari, we plot test accuracy at the end of every additional pass; hence it contains additional markers compared to the top row which plots results after a single pass. Re-training batch RF using 100 mini-batches is unfair to MF; in a streaming data setup where the model is updated when a new training instance arrives, MF would be significantly faster than the re-trained batch versions. 3The scikit-learn implementation uses highly optimized C code, hence we do not compare our runtimes with the scikit-learn implementation. The ERT implementation in scikit-learn achieves very similar test accuracy as our ERT implementation, hence we do not report those results here. 4https://archive.ics.uci.edu/ml/machine-learning-databases/mushroom/agaricus-lepiota.names 7 Assuming trees are balanced after adding each data point, it can be shown that computational cost of MF scales as O(N log N) whereas that of re-trained batch RF scales as O(N 2 log N) (Appendix C). Appendix E shows that the average depth of the forests trained on above datasets scales as O(log N). It is remarkable that choosing splits independent of labels achieves competitive classification performance. This phenomenon has been observed by others as well—for example, Cutler and Zhao [7] demonstrate that their PERT classifier (which is similar to batch version of MF) achieves test accuracy comparable to Breiman-RF on many real world datasets. However, in the presence of irrelevant features, methods which choose splits independent of labels (MF, ERT-1) perform worse than Breiman-RF and ERT-k (but still better than ORF-Saffari) as indicated by the results on the dna dataset. We trained MF and ERT-1 using just the most relevant 60 attributes amongst the 180 attributes5—these results are indicated as MF† and ERT-1† in Figure 3. We observe that, as expected, filtering out irrelevant features significantly improves performance of MF and ERT-1. usps satimages letter dna 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 MF ERT-k ERT-1 ORF-Saffari Breiman-RF* 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.76 0.78 0.80 0.82 0.84 0.86 0.88 0.90 0.92 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 MF† ERT-1† 101 102 103 104 105 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 MF ERT-k ERT-1 ORF-Saffari 101 102 103 104 0.75 0.80 0.85 0.90 101 102 103 104 105 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 101 102 103 104 0.5 0.6 0.7 0.8 0.9 1.0 1.1 MF† ERT-1† Figure 3: Results on various datasets: y-axis is test accuracy in both rows. x-axis is fraction of training data for the top row and training time (in seconds) for the bottom row. We used the pre-defined train/test split. For usps dataset D = 256, K = 10, Ntrain = 7291, Ntest = 2007; for satimages dataset D = 36, K = 6, Ntrain = 3104, Ntest = 2000; letter dataset D = 16, K = 26, Ntrain = 15000, Ntest = 5000; for dna dataset D = 180, K = 3, Ntrain = 1400, Ntest = 1186. 8 Discussion We have introduced Mondrian forests, a novel class of random forests, which can be trained incrementally in an efficient manner. MF significantly outperforms existing online random forests in terms of training time as well as number of training instances required to achieve a particular test accuracy. Remarkably, MF achieves competitive test accuracy to batch random forests trained on the same fraction of the data. MF is unable to handle lots of irrelevant features (since splits are chosen independent of the labels)—one way to use labels to guide splits is via recently proposed Sequential Monte Carlo algorithm for decision trees [14]. The computational complexity of MF is linear in the number of dimensions (since rectangles are represented explicitly) which could be expensive for high dimensional data; we will address this limitation in future work. Random forests have been tremendously influential in machine learning for a variety of tasks; hence lots of other interesting extensions of this work are possible, e.g. MF for regression, theoretical bias-variance analysis of MF, extensions of MF that use hyperplane splits instead of axis-aligned splits. Acknowledgments We would like to thank Charles Blundell, Gintare Dziugaite, Creighton Heaukulani, Jos´e Miguel Hern´andez-Lobato, Maria Lomeli, Alex Smola, Heiko Strathmann and Srini Turaga for helpful discussions and feedback on drafts. BL gratefully acknowledges generous funding from the Gatsby Charitable Foundation. This research was carried out in part while DMR held a Research Fellowship at Emmanuel College, Cambridge, with funding also from a Newton International Fellowship through the Royal Society. YWT’s research leading to these results was funded in part by the European Research Council under the European Union’s Seventh Framework Programme (FP7/2007-2013) ERC grant agreement no. 617411. 5https://www.sgi.com/tech/mlc/db/DNA.names 8 References [1] L. Breiman. Bagging predictors. Mach. Learn., 24(2):123–140, 1996. [2] L. Breiman. Random forests. Mach. Learn., 45(1):5–32, 2001. [3] R. Caruana and A. Niculescu-Mizil. An empirical comparison of supervised learning algorithms. In Proc. Int. Conf. Mach. Learn. (ICML), 2006. [4] H. A. Chipman, E. I. George, and R. E. McCulloch. Bayesian CART model search. J. Am. Stat. Assoc., pages 935–948, 1998. [5] S. L. Crawford. Extensions to the CART algorithm. Int. J. Man-Machine Stud., 31(2):197–217, 1989. [6] A. Criminisi, J. Shotton, and E. Konukoglu. Decision forests: A unified framework for classification, regression, density estimation, manifold learning and semi-supervised learning. Found. Trends Comput. Graphics and Vision, 7(2–3):81–227, 2012. [7] A. Cutler and G. Zhao. PERT - Perfect Random Tree Ensembles. Comput. Sci. and Stat., 33: 490–497, 2001. [8] M. Denil, D. Matheson, and N. de Freitas. Consistency of online random forests. In Proc. Int. Conf. Mach. Learn. (ICML), 2013. [9] D. G. T. Denison, B. K. Mallick, and A. F. M. Smith. A Bayesian CART algorithm. Biometrika, 85(2):363–377, 1998. [10] T. G. Dietterich. Ensemble methods in machine learning. In Multiple classifier systems, pages 1–15. Springer, 2000. [11] P. Domingos and G. Hulten. Mining high-speed data streams. In Proc. 6th ACM SIGKDD Int. Conf. Knowl. Discov. Data Min. (KDD), pages 71–80. ACM, 2000. [12] P. Geurts, D. Ernst, and L. Wehenkel. Extremely randomized trees. Mach. Learn., 63(1):3–42, 2006. [13] J. T. Goodman. A bit of progress in language modeling. Comput. Speech Lang., 15(4):403–434, 2001. [14] B. Lakshminarayanan, D. M. Roy, and Y. W. Teh. Top-down particle filtering for Bayesian decision trees. In Proc. Int. Conf. Mach. Learn. (ICML), 2013. [15] T. P. Minka. Bayesian model averaging is not model combination. MIT Media Lab note. http://research.microsoft.com/en-us/um/people/minka/papers/bma.html, 2000. [16] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res., 12:2825–2830, 2011. [17] J. Pitman. Combinatorial stochastic processes, volume 32. Springer, 2006. [18] D. M. Roy. Computability, inference and modeling in probabilistic programming. PhD thesis, Massachusetts Institute of Technology, 2011. http://danroy.org/papers/Roy-PHD-2011.pdf. [19] D. M. Roy and Y. W. Teh. The Mondrian process. In Adv. Neural Inform. Proc. Syst. (NIPS), volume 21, pages 27–36, 2009. [20] A. Saffari, C. Leistner, J. Santner, M. Godec, and H. Bischof. On-line random forests. In Computer Vision Workshops (ICCV Workshops). IEEE, 2009. [21] M. A. Taddy, R. B. Gramacy, and N. G. Polson. Dynamic trees for learning and design. J. Am. Stat. Assoc., 106(493):109–123, 2011. [22] Y. W. Teh. A hierarchical Bayesian language model based on Pitman–Yor processes. In Proc. 21st Int. Conf. on Comp. Ling. and 44th Ann. Meeting Assoc. Comp. Ling., pages 985–992. Assoc. for Comp. Ling., 2006. [23] P. E. Utgoff. Incremental induction of decision trees. Mach. Learn., 4(2):161–186, 1989. [24] F. Wood, C. Archambeau, J. Gasthaus, L. James, and Y. W. Teh. A stochastic memoizer for sequence data. In Proc. Int. Conf. Mach. Learn. (ICML), 2009. 9
2014
338
5,445
A Probabilistic Framework for Multimodal Retrieval using Integrative Indian Buffet Process Bahadir Ozdemir Department of Computer Science University of Maryland College Park, MD 20742 USA ozdemir@cs.umd.edu Larry S. Davis Institute for Advanced Computer Studies University of Maryland College Park, MD 20742 USA lsd@umiacs.umd.edu Abstract We propose a multimodal retrieval procedure based on latent feature models. The procedure consists of a Bayesian nonparametric framework for learning underlying semantically meaningful abstract features in a multimodal dataset, a probabilistic retrieval model that allows cross-modal queries and an extension model for relevance feedback. Experiments on two multimodal datasets, PASCAL-Sentence and SUN-Attribute, demonstrate the effectiveness of the proposed retrieval procedure in comparison to the state-of-the-art algorithms for learning binary codes. 1 Introduction As the number of digital images which are available online is constantly increasing due to rapid advances in digital camera technology, image processing tools and photo sharing platforms, similaritypreserving binary codes have received significant attention for image search and retrieval in largescale image collections [1, 2]. Encoding high-dimensional descriptors into compact binary strings has become a very popular representation for images because of their high efficiency in query processing and storage capacity [3, 4, 5, 6]. The most widely adapted strategy for similarity-preserving binary codes is to find a projection of data points from the original feature space to Hamming space. A broad range of hashing techniques can be categorized as data independent and dependent schemes. Locality sensitive hashing [3] is one of the most widely known data-independent hashing techniques. This technique has been extended to various hashing functions with kernels [4, 5]. Notable data-dependent hashing techniques include spectral hashing [1], iterative quantization [6] and spherical hashing [7]. Despite the increasing amount of multimodal data, especially in multimedia domains e.g. images with tags, most existing hashing techniques, unfortunately, focus on unimodal data. Hence, they inevitably suffer from the semantic gap, which is defined in [8] as the lack of coincidence between low level visual features and high level semantic interpretation of an image. On the other hand, joint analysis of multimodal data offers improved search and cross-view retrieval capabilities e.g. text-to-image queries by bridging the semantic gap. However, it also poses challenges associated with handling cross-view similarity. Most recent studies have concentrated on multimodal hashing. Bronstein et al. proposed crossmodality similarity learning via a boosting procedure [9]. Kumar and Udupa presented a cross-view similarity search [10] by generalizing spectral hashing [1] for multi-view data objects. Zhen and Yeung described two recent methods: Co-regularized hashing [11] based on a boosted co-regularization framework and a probabilistic generative approach called multimodal latent binary embedding [12] based on binary latent factors. Nitish and Salakhutdinov proposed a deep Boltzmann machine for multimodal data [13]. Recently, Rastegari et al. proposed a predictable dual-view hashing [14] that aims to minimize the Hamming distance between binary codes obtained from two different views by utilizing multiple SVMs. Most of the multimodal hashing techniques are computationally ex1 pensive, especially when dealing with large-scale data. High computational and storage complexity restricts their scalability. Although many hashing approaches rely on supervised information like semantic class labels, class memberships are not available for many image datasets. In addition, some supervised approaches cannot be generalized to unseen classes that are not used during training [15] even though new classes emerge in the process of adding new images to online image databases. Besides, every user’s need is different and time varying [16]. Therefore, user judgments indicating the relevance of an image retrieved for a query are utilized to achieve better retrieval performance in the revised ranking of images [17]. Development of an efficient retrieval system that embeds information from multiple domains into short binary codes and takes relevance feedback into account is quite challenging. In this paper, we propose a multimodal retrieval method based on latent features. A probabilistic approach is employed for learning binary codes, and also for modeling relevance and user preferences in image retrieval. Our model is built on the assumption that each image can be explained by a set of semantically meaningful abstract features which have both visual and textual components. For example, if an image in the dataset contains a side view of a car, the words “car”, “automobile” or “vehicle” will probably appear in the description; also an object detector trained for vehicles will detect the car in the image. Therefore, each image can be represented as a binary vector, with entries indicating the presence or absence of each abstract feature. Our contributions can be summarized in three aspects: 1. We propose a Bayesian nonparametric framework based on the Indian Buffet Process (IBP) [18] for integrating multimodal data in a latent space. Since the IBP is a nonparametric prior in an infinite latent feature model, the proposed method offers a flexible way to determine the number of underlying abstract features in a dataset. 2. We develop a retrieval system that can respond to cross-modal queries by introducing new random variables indicating relevance to a query. We present a Markov chain Monte Carlo (MCMC) algorithm for inference of the relevance from data. 3. We formulate relevance feedback as pseudo-images to alter the distribution of images in the latent space so that the ranking of images for a query is influenced by user preferences. The rest of the paper is organized as follows: Section 2 describes the proposed integrative procedure for learning binary codes, retrieval model and processing relevance feedback in detail. Performance evaluation and comparison to state-of-the-art methods are presented in Section 3, and Section 4 provides conclusions. 2 Our Approach In our data model, each image has both textual and visual components. To facilitate the discussion, we assume that the dataset is composed of two full matrices; our approach can easily handle images with only one component and it can be generalized to more than two modalities as well. We denote the data in the textual and visual space by Xτ and Xv, respectively. X∗is an N × D∗matrix whose rows corresponds to images in either space where ∗is a placeholder used for either v or τ. The values in each column of X∗are centered by subtracting the sample mean of that column. The dimensionality of the textual space Dτ and the dimensionality of the visual space Dv can be different. We use X to represent the set {Xτ, Xv}. 2.1 Integrative Latent Feature Model We focus on how textual and visual values of an image are generated by a linear-Gaussian model and its extension for retrieval systems. Given a multimodal image dataset, the textual and visual data matrices, Xτ and Xv, can be approximated by ZAτ and ZAv, respectively. Z is an N × K binary matrix where Znk equals to one if abstract feature k is present in image n and zero otherwise. A∗is a K × D∗matrix where the textual and visual values for abstract feature k are stored in row k of Aτ and Av, respectively (See Figure 1 for an illustration). The set {Aτ, Av} is denoted by A. 2 Our initial goal is to learn abstract features present in the dataset. Given X, we wish to compute the posterior distribution of Z and A using Bayes’ rule p(Z, A|X) ∝p(Xτ|Z, Aτ)p(Aτ)p(Xv|Z, Av)p(Av)p(Z) (1) where Z, Aτ and Av are assumed to be a priori independent. In our model, the vectors for textual and visual properties of an image are generated from Gaussian distributions with covariance matrix (σ∗ x)2I and expectation E[X∗] equal to ZA∗. Similarly, a prior on A∗is defined to be Gaussian with zero mean vector and covariance matrix (σ∗ a)2I. Since we do not know the exact number of abstract features present in the dataset, we employ the Indian Buffet Process (IBP) to generate Z, which provides a flexible prior that allows K to be determined at inference time (See [18] for details). The graphical model of our integrative approach is shown in Figure 2. Abstract features for image Unobserved Observed Visual features for image visual textual Textual features for image Figure 1: The latent abstract feature model proposes that visual data Xv is a product of Z and Av with some noise; and similarly the textual data Xτ is a product of Z and Aτ with some noise. Figure 2: Graphical model for the integrative IBP approach where circles indicate random variables, shaded circles denote observed values, and the blue square boxes are hyperparameters. The exchangeability property of the IBP leads directly to a Gibbs sampler which takes image n as the last customer to have entered the buffet. Then, we can sample Znk for all initialized features k via p(Znk = 1|Z−nk, X) ∝p(Znk = 1|Z−nk)p(X|Z). (2) where Z−nk denotes entries of Z other than Znk. In the finite latent feature model (where K is fixed), the conditional distribution for any Znk is given by p(Znk = 1|Z−nk) = m−n,k + α K N + α K (3) where m−n,k is the number of images possessing abstract feature k apart from image n. In the infinite case like the IBP, we obtain p(Znk = 1|Z−nk) = m−n,k N for any k such that m−n,k > 0. We also need to draw new features associated with image n from Poisson α N  , and the likelihood term is now conditioned on Z with new additional columns set to one for image n. 3 For the linear-Gaussian model, the collapsed likelihood function p(X|Z) = p(Xτ|Z)p(Xv|Z) can be computed using p(X∗|Z) = Z p(X∗|Z, A∗)p(A∗) dA∗= exp  − 1 2(σ∗x)2 tr X∗T (I −ZMZT )X∗ (2π) ND∗ 2 (σ∗x)(N−K)D∗(σ∗a)KD∗|M| −D∗ 2 (4) where M = ZT Z + (σ∗ x)2 (σ∗a)2 I −1 and tr(·) is the trace of a matrix [18]. To reduce the computational complexity, Doshi-Velez and Ghahramani proposed an accelerated sampling in [19] by maintaining the posterior distribution of A∗conditioned on partial X∗and Z. We use this approach to learn binary codes, i.e. the feature-assignment matrix Z, for multimodal data. Unlike the hashing methods that learn optimal hyperplanes from training data [6, 7, 14], we only sample Z without specifying the length of binary codes in this process. Therefore, the binary codes can be updated efficiently if new images are added in a long run of the retrieval system. 2.2 Retrieval Model We extend the integrative IBP model for image retrieval. Given a query, we need to sort the images in the dataset with respect to their relevance to the query. A query can be comprised of textual and visual data, or either component can be absent. Let qτ be a Dτ-dimensional vector for the textual values and qv be a Dv-dimensional vector for the visual values of the query. We can write Q = {qτ, qv}. As for the images in X, we consider a query to be generated by the same model described in the previous section with the exception of the prior on abstract features. In the retrieval part, we consider Z as a known quantity and we fix the number abstract features to K. Therefore, the feature-assignments for the dataset are not affected by queries. In addition, queries are explained by known abstract features only. We extend the Indian restaurant metaphor to construct the retrieval model. A query corresponds to the (N + 1)th customer to enter the buffet. The previous customers are divided into two classes as friends and non-friends based on their relevance to the new customer. The new customer now samples from at most K dishes in proportion to their popularity among friends and also their unpopularity among non-friends. Consequently, the dishes sampled by the new customer are expected to be similar to those of friends and dissimilar to those of non-friends. Let r be an N-dimensional vector where rn equals to one if customer n is a friend of the new customer and zero otherwise. For this finitely long buffet, the sampling probability of dish k by the new customer can be written as m′ k+α/K N+1+α/K where m′ k = PN n=1(Znk)rn(1 −Znk)1−rn, that is the total number of friends who tried dish k and non-friends who did not sample dish k. Let z′ be a K-dimensional vector where z′ k records if the new customer (query) sampled dish k. We place a prior over rn as Bernoulli(θ). Then, we can sample z′ k from p(z′ k = 1|z′ −k, Q, Z, X) ∝p(z′ k = 1|Z)p(Q|z′, Z, X). (5) The probability p(z′ k = 1|Z) can be computed efficiently for k = 1, . . . , K by marginalizing over r as below: p(z′ k = 1|Z) = X r∈{0,1}N p(z′ k = 1|r, Z)p(r) = θmk + (1 −θ)(N −mk) + α K N + 1 + α K . (6) The collapsed likelihood of the query, p(Q|z′, Z, X), is given by the product of textual and visual likelihood values, p(qτ|z′, Z, Xτ)p(qv|z′, Z, Xv). If either textual or visual component is missing, we can simply integrate out the missing one by omitting the corresponding term from the equation. The likelihood of each part can be calculated as follows: p(q∗|z′, Z, X∗) = Z p(q∗|z′, A∗)p(A∗|Z, X∗) dA∗= N(q∗; µ∗ q, Σ∗ q). (7) where the mean and covariance matrix of the normal distribution are given by µ∗ q = z′MZT X∗and Σ∗ q = (σ∗ x)2(z′Mz′T + I), akin to the update equation in [19] (Refer to (4) for M). Finally, we use the conditional expectation of r to rank images in the dataset with respect to their relevance to the given query. Calculating the expectation E[r|Q, Z, X] is computationally expensive; 4 however, it can be empirically estimated using the Monte Carlo method as follows: ˆE[rn|Q, Z, X] = 1 I I X i=1 p(rn = 1|z′(i), Z) = θ I I X i=1 K Y k=1 p z′(i) k |rn = 1, Z  p z′(i) k |Z  (8) where z′(i) represents i.i.d. samples from (5) for i = 1, . . . , I. The last equation required for computing (8) is p(z′ k = 1|rn = 1, Z) = Znk + θm−n,k + (1 −θ)(N −1 −m−n,k) + α K N + 1 + α K . (9) The retrieval system returns a set of top ranked images to the user. Note that we compute the expectation of relevance vector instead of sampling directly since binary values indicating the relevance are less stable and they hinder the ranking of images. 2.3 Relevance Feedback Model In our data model, user preferences can be described over abstract features. For instance, if abstract feature k is present in the most of positive samples i.e. images judged as relevant by the user and it is absent in the irrelevant ones, then we can say that the user is more interested in the semantic subspace represented by abstract feature k. In the revised query, the images having abstract feature k are expected to be ranked in higher positions in comparison to the initial query. We can achieve this desirable property from query-specific alterations to the sampling probability in (5) for the corresponding abstract features. Our approach is to add pseudo-images to the feature-assignment matrix Z before the computations of the revised query. For the Indian restaurant analogy, pseudoimages correspond to some additional friends of the new customer (query), who do not really exist in the restaurant. The distribution of dishes sampled by those imaginary customers reflects user relevance feedback. Thus, the updated expectation of the relevance vector has a bias towards user preferences. Let Zu be an Nu×K feature-assignment matrix for pseudo-images only; then the number of pseudoimages, Nu, determines the influence of relevance feedback. Therefore, we set an upper limit on Nu as the number of real images, N, by placing a prior distribution as Nu ∼Binomial(γ, N) where γ is a parameter that controls the weight of feedback. Let mu,k be the number of pseudo-images containing abstract feature k; then this number has an upper bound Nu by definition. For abstract feature k, a prior distribution conditioned on Nu can be defined as mu,k|Nu ∼Binomial(φk, Nu) where φk is a parameter that can be tuned by relevance judgments. Let z′′ be a K-dimensional feature-assignment vector for the revised query; then we can sample each z′′ k via p(z′′ k = 1|z′′ −k, Q, Z, X) ∝p(z′′ k = 1|Z)p(Q|z′′, Z, X) (10) where the computation of the collapsed likelihood is already shown in (7). Note that we do not actually generate all entries of Zu but only the sum of its columns mu and number of rows Nu for computing the sampling probability. We can write the first term as: p(z′′ k = 1|Z) = N X Nu=0 p(Nu) Nu X mu,k=0 p(mu,k|Nu) X r∈{0,1}N p(z′′ k = 1|r, Zu, Z)p(r) = N X j=0 N j  γj(1 −γ)N−j θmk + (1 −θ)(N −mk) + α K + φkj N + 1 + α K + j (11) Unfortunately, this expression has no compact analytic form; however, it can be efficiently computed numerically by contemporary scientific computing software even for large values of N. In this equation, one can alternatively fix rn to 1 if the user marks observation n as relevant or 0 if it is indicated to be irrelevant. Finally, the expectation of r is updated using (8) with new i.i.d. samples z′′(i) from (10) and the system constructs the revised set of images. 5 3 Experiments The experiments were performed in two phases. We first compared the performance of our method in category retrieval with several state-of-the-art hashing techniques. Next, we evaluated the improvement in the performance of our method with relevance feedback. We used the same multimodal datasets as [14], namely PASCAL-Sentence 2008 dataset [20] and the SUN-Attribute dataset [21]. In the quantitative analysis, we used the mean of the interpolated precision at standard recall levels for comparing the retrieval performance. In the qualitative analysis, we present the images retrieved by our proposed method for a set of text-to-image and image-to-image queries. All experiments were performed in the Matlab environment1. 3.1 Datasets The PASCAL-Sentence 2008 dataset is formed from the PASCAL 2008 images by randomly selecting 50 images belonging to each of the 20 categories. In experiments, we used the precomputed visual and textual features provided by Farhadi et al. [20]. Amazon Mechanical Turk workers annotate five sentences for each of the 1000 images. Each image is labelled by a triplet of <object, action, scene> representing the semantics of the image from these sentences. For each image, the semantic similarity between each word in its triplet and all words in a dictionary constructed from the entire dataset is computed by the Lin similarity measure [22] using the WordNet hierarchy. The textual features of an image are the sum of all similarity vectors for the words in its triplet. Visual features are built from various object detectors, image classifiers and scene classifiers. These features contain the coordinates and confidence values that object detectors fire and the responses of image and scene classifiers trained on low-level image descriptors. The SUN-Attribute dataset [21], a large-scale dataset of attribute-labeled scenes, is built on top of the existing SUN categorical dataset [23]. The dataset contains 102 attribute labels annotated by 3 Amazon Mechanical Turk workers for each of the 14,340 images from 717 categories. Each category has 20 annotated images. The precomputed visual features [21, 23] include gist, 2×2 histogram of oriented gradient, self-similarity measure, and geometric context color histograms. The attribute features is computed by averaging the binary labels from multiple annotators where each image is annotated with attributes from five types: materials, surface properties, functions or affordances, spatial envelope attributes and object presence. 3.2 Experimental Setup Firstly, all features were centered to zero and normalized to unit length; also duplicate features were removed from the data. We reduced the dimensionality of visual features in the SUN dataset from 19,080 to 1,000 by random feature selection, which is preferable to PCA for preserving the variance among visual features. The Gibbs sampler was initialized with a randomly sampled feature assignment matrix Z from a IBP prior. We set α = 1 in all experiments to keep binary codes short. The other hyperparameters σ∗ a and σ∗ x were determined by adding Metropolis steps to the MCMC algorithm in order to prevent one modality from dominating the inference process. In the retrieval part, the relevance probability θ was set to 0.5 so that all abstract features have equal prior probability from (6). Feature assignments of a query were initialized with all zero bits. For relevance feedback analysis, we set γ = 1 (equal significance for the data and feedback) and we decide each φk as follows: Let ¯z′ k = 1 I PI i=1 z′(i) k where each z′(i) is drawn from (5) for a given query; and ˆz′ k = 1 T PT t=1(Ztk)rt(1 −Ztk)1−rt where t represents the index of each image judged by the user and T is the size of relevance feedback. The difference between these two quantities, δk = ¯z′ k −ˆz′ k, controls φk which is defined by a logistic function as φk = 1 1 + e−(cδk+β0,k) (12) where c is a constant and β0,k = ln p(z′ k=1|Z) p(z′ k=0|Z) (refer to (6) for p(z′ k|Z)). We set c = 5 in our experiments. Note that φk = p(z′ k = 1|Z) when ¯z′ k is equal to ˆz′ k. 1Our code is available at http://www.cs.umd.edu/∼ozdemir/iibp 6 3.3 Experimental Results We compared our method, called integrative IBP (iIBP), with several hashing methods including locality sensitive hashing (LSH) [3], spectral hashing (SH) [1], spherical hashing (SpH) [7], iterative quantization (ITQ) [6], multimodal deep Boltzmann machine (mDBM) [13] and predictable dualview hashing (PDH) [14]. We divided each dataset into two equal sized train and test segments. The train segment was first used for learning the feature assignment matrix Z by iIBP. Then, the other binary code methods were trained with the same code length K. We used supervised ITQ coupled with CCA [24] and took the dual-view approach [14] to construct basis vectors in a common subspace. However, LSH, SH and SpH were applied on single-view data since they do not support cross-view queries. All images in the test segment were used as both image and text queries. Given a query, images in the train set were ranked by iIBP with respect to (8). For all other methods, we use Hamming distance between binary codes in the nearest-neighbor search. Mean precision curves are presented in Figure 3 for both datasets. Unlike the experiments in [14] performed in a supervised manner, the performance on the SUN-Attribute dataset is very low due to the small number of positive samples compared to the number of categories (Figure 3b). There are only 10 relevant images among 7,170 training images. Therefore, we also used Euclidean neighbor ground truth labels computed from visual data as in [6] (Figure 3c). As seen in the figure, our method (iIBP) outperforms all other methods. Although unimodal hashing methods perform well on text queries, they suffer badly on image queries because the semantic similarity to the query does not necessarily require visual similarity (Figures 3-4 in the supplementary material). By the joint analysis of visual and textual spaces, our approach improves the performance for image queries by bridging the semantic gap [8]. iIBP mDBM PDH ITQ SpH SH LSH Recall 0 0.2 0.4 0.6 0.8 1 Mean Precision 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 (a) PASCAL-Sentence Dataset (K = 23) Recall 0 0.2 0.4 0.6 0.8 1 Mean Precision 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 (b) SUN Dataset – Class label ground truth (K = 45) Recall 0 0.2 0.4 0.6 0.8 1 Mean Precision 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 (c) SUN Dataset – Euclidean ground truth (K = 45) Figure 3: The result of category retrieval for all query types (image-to-image and text-to-image queries). Our method (iIBP) is compared with the-state-of-the-art methods. For qualitative analysis, Figure 4a shows the top-5 retrieved images from the PASCAL-Sentence 2008 dataset for image queries. Thanks to the integrative approach, the retrieved images share remarkable semantic similarity with the query images. Similarly, most of the retrieved images for the text-to-image queries in Figure 4b comprise the semantic structure in the query sentences. In the second phase of analyses, we utilized the rankings in the first phase to decide relevance feedback parameters independently for each query. We picked the top two relevant images as positive samples and top two irrelevant images as negative samples. We set each φk by (12) and reordered the images using the relevance feedback model excluding the ones used as user relevance judgements. Those images were omitted from precision-recall calculations as well. Figure 5 illustrates that relevance feedback slightly boosts the retrieval performance, especially for the PASCAL-Sentence dataset. The computational complexity of an iteration is O(K2 +KD∗) for a query and O(N(K2 +KDτ + KDv)) for training [19]. The feature assignment vector z′ of a query usually converges in a few 7 Query Retrieval Set (a) Image-to-image queries A fower pot placed in a house A furniture located in a room A child sitting in a room A boat sailing along a river A bird perching on a tree (b) Text-to-image queries Figure 4: Sample images retrieved from the PASCAL-Sentence dataset by our method (iIBP) iterations. A typical query took less than 1 second in our experiments for I = 50 with our optimized Matlab code. Text Query w/ feedback Text Query w/o feedback Image Query w/ feedback Image Query w/o feedback Recall 0 0.2 0.4 0.6 0.8 1 Mean Precision 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 (a) PASCAL-Sentence Dataset (K = 23) Recall 0 0.2 0.4 0.6 0.8 1 Mean Precision 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 (b) SUN Dataset – Class label ground truth (K = 45) Recall 0 0.2 0.4 0.6 0.8 1 Mean Precision 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 (c) SUN Dataset – Euclidean ground truth (K = 45) Figure 5: The result of category retrieval by our approach (iIBP) with relevance feedback for text and image queries. Revised retrieval with relevance feedback is compared with initial retrieval. 4 Conclusion We proposed a novel retrieval scheme based on binary latent features for multimodal data. We also describe how to utilize relevance feedback for better retrieval performance. The experimental results on real world data demonstrate that our method outperforms state-of-the-art hashing techniques. In our future work, we would like to develop a user inference to get relevance feedback and a deterministic variational method for inference the integrative IBP based on a truncated stick-breaking approximation. Acknowledgments This work was supported by the NSF Grant 12621215 EAGER: Video Analytics in Large Heterogeneous Repositories. 8 References [1] Y. Weiss, A. Torralba, and R. Fergus. Spectral hashing. In Advances in Neural Information Processing Systems 21, pages 1753–1760, 2009. [2] A. Torralba, R. Fergus, and Y. Weiss. Small codes and large image databases for recognition. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2008, pages 1–8, June 2008. [3] A. Gionis, P. Indyk, and R. Motwani. Similarity search in high dimensions via hashing. In Proceedings of the 25th International Conference on Very Large Data Bases, VLDB ’99, pages 518–529, 1999. [4] B. Kulis and K. Grauman. Kernelized locality-sensitive hashing for scalable image search. In IEEE 12th International Conference on Computer Vision, 2009, pages 2130–2137, Sept 2009. [5] M. Raginsky and S. Lazebnik. Locality-sensitive binary codes from shift-invariant kernels. In Advances in Neural Information Processing Systems 22, pages 1509–1517, 2009. [6] Y. Gong and S. Lazebnik. Iterative quantization: A procrustean approach to learning binary codes. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2011, pages 817–824, June 2011. [7] J.-P. Heo, Y. Lee, J. He, S.-F. Chang, and S.-E. Yoon. Spherical hashing. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2012, pages 2957–2964, June 2012. [8] A. W. M. Smeulders, M. Worring, S. Santini, A. Gupta, and R. Jain. Content-based image retrieval at the end of the early years. IEEE Transactions on Pattern Analysis and Machine Intelligence, 22(12):1349– 1380, Dec 2000. [9] M. M. Bronstein, E. M. Bronstein, F. Michel, and N. Paragios. Data fusion through cross-modality metric learning using similarity-sensitive hashing. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2010, pages 3594–3601, June 2010. [10] S. Kumar and R. Udupa. Learning hash functions for cross-view similarity search. In Proceedings of the Twenty-Second International Joint Conference on Artificial Intelligence - Volume Two, IJCAI’11, pages 1360–1365, 2011. [11] Y. Zhen and D.-Y. Yeung. Co-regularized hashing for multimodal data. In Advances in Neural Information Processing Systems 25, pages 1376–1384, 2012. [12] Y. Zhen and D.-Y. Yeung. A probabilistic model for multimodal hash function learning. In Proceedings of the 18th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’12, pages 940–948, 2012. [13] Nitish Srivastava and Ruslan Salakhutdinov. Multimodal learning with deep boltzmann machines. In Advances in Neural Information Processing Systems 25, pages 2222–2230, 2012. [14] M. Rastegari, J. Choi, S. Fakhraei, H. Daume III, and L. S. Davis. Predictable Dual-View Hashing. Proceedings of The 30th International Conference on Machine Learning, pages 1328–1336, 2013. [15] A. Sharma, A. Kumar, H. Daume III, and D. W. Jacobs. Generalized multiview analysis: A discriminative latent space. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2012, pages 2160–2167, June 2012. [16] X. S. Zhou and T. S. Huang. Relevance feedback in image retrieval: A comprehensive review. Multimedia Systems, 8(6):536–544, 2003. [17] Y. Yang, F. Nie, D. Xu, J. Luo, Y. Zhuang, and Y. Pan. A multimedia retrieval framework based on semi-supervised ranking and relevance feedback. IEEE Transactions on Pattern Analysis and Machine Intelligence, 34(4):723–742, April 2012. [18] Z. Ghahramani and T. L. Griffiths. Infinite latent feature models and the indian buffet process. In Advances in Neural Information Processing Systems 18, pages 475–482, 2005. [19] F. Doshi-Velez and Z. Ghahramani. Accelerated sampling for the indian buffet process. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, pages 273–280, 2009. [20] A. Farhadi, M. Hejrati, M. A. Sadeghi, P. Young, C. Rashtchian, J. Hockenmaier, and D. Forsyth. Every picture tells a story: Generating sentences from images. In Proceedings of the 11th European Conference on Computer Vision: Part IV, ECCV’10, pages 15–29, Berlin, Heidelberg, 2010. [21] G. Patterson and J. Hays. Sun attribute database: Discovering, annotating, and recognizing scene attributes. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2012, pages 2751– 2758, June 2012. [22] D. Lin. An information-theoretic definition of similarity. In Proceedings of the Fifteenth International Conference on Machine Learning, ICML ’98, pages 296–304, 1998. [23] J. Xiao, J. Hays, K. A. Ehinger, A. Oliva, and A. Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2010, pages 3485–3492, June 2010. [24] H. Hotelling. Relations Between Two Sets of Variates. Biometrika, 28(3/4):321–377, December 1936. 9
2014
339
5,446
Identifying and attacking the saddle point problem in high-dimensional non-convex optimization Yann N. Dauphin Razvan Pascanu Caglar Gulcehre Kyunghyun Cho Universit´e de Montr´eal dauphiya@iro.umontreal.ca, r.pascanu@gmail.com, gulcehrc@iro.umontreal.ca, kyunghyun.cho@umontreal.ca Surya Ganguli Stanford University sganguli@standford.edu Yoshua Bengio Universit´e de Montr´eal, CIFAR Fellow yoshua.bengio@umontreal.ca Abstract A central challenge to many fields of science and engineering involves minimizing non-convex error functions over continuous, high dimensional spaces. Gradient descent or quasi-Newton methods are almost ubiquitously used to perform such minimizations, and it is often thought that a main source of difficulty for these local methods to find the global minimum is the proliferation of local minima with much higher error than the global minimum. Here we argue, based on results from statistical physics, random matrix theory, neural network theory, and empirical evidence, that a deeper and more profound difficulty originates from the proliferation of saddle points, not local minima, especially in high dimensional problems of practical interest. Such saddle points are surrounded by high error plateaus that can dramatically slow down learning, and give the illusory impression of the existence of a local minimum. Motivated by these arguments, we propose a new approach to second-order optimization, the saddle-free Newton method, that can rapidly escape high dimensional saddle points, unlike gradient descent and quasi-Newton methods. We apply this algorithm to deep or recurrent neural network training, and provide numerical evidence for its superior optimization performance. 1 Introduction It is often the case that our geometric intuition, derived from experience within a low dimensional physical world, is inadequate for thinking about the geometry of typical error surfaces in high-dimensional spaces. To illustrate this, consider minimizing a randomly chosen error function of a single scalar variable, given by a single draw of a Gaussian process. (Rasmussen and Williams, 2005) have shown that such a random error function would have many local minima and maxima, with high probability over the choice of the function, but saddles would occur with negligible probability. On the other-hand, as we review below, typical, random Gaussian error functions over N scalar variables, or dimensions, are increasingly likely to have saddle points rather than local minima as N increases. Indeed the ratio of the number of saddle points to local minima increases exponentially with the dimensionality N. A typical problem for both local minima and saddle-points is that they are often surrounded by plateaus of small curvature in the error. While gradient descent dynamics are repelled away from a saddle point to lower error by following directions of negative curvature, this repulsion can occur slowly due to the plateau. Second order methods, like the Newton method, are designed to rapidly descend plateaus surrounding local minima by multiplying the gradient steps with the inverse of the Hessian matrix. However, the Newton method does not treat saddle points appropriately; as argued below, saddle-points instead become attractive under the Newton dynamics. Thus, given the proliferation of saddle points, not local minima, in high dimensional problems, the entire theoretical justification for quasi-Newton methods, i.e. the ability to rapidly descend to the bottom of a convex local minimum, becomes less relevant in high dimensional non-convex optimization. In this work, which 1 is an extension of the previous report Pascanu et al. (2014), we first want to raise awareness of this issue, and second, propose an alternative approach to second-order optimization that aims to rapidly escape from saddle points. This algorithm leverages second-order curvature information in a fundamentally different way than quasi-Newton methods, and also, in numerical experiments, outperforms them in some high dimensional problems involving deep or recurrent networks. 2 The prevalence of saddle points in high dimensions Here we review arguments from disparate literatures suggesting that saddle points, not local minima, provide a fundamental impediment to rapid high dimensional non-convex optimization. One line of evidence comes from statistical physics. Bray and Dean (2007); Fyodorov and Williams (2007) study the nature of critical points of random Gaussian error functions on high dimensional continuous domains using replica theory (see Parisi (2007) for a recent review of this approach). One particular result by Bray and Dean (2007) derives how critical points are distributed in the ϵ vs α plane, where α is the index, or the fraction of negative eigenvalues of the Hessian at the critical point, and ϵ is the error attained at the critical point. Within this plane, critical points concentrate on a monotonically increasing curve as α ranges from 0 to 1, implying a strong correlation between the error ϵ and the index α: the larger the error the larger the index. The probability of a critical point to be an O(1) distance off the curve is exponentially small in the dimensionality N, for large N. This implies that critical points with error ϵ much larger than that of the global minimum, are exponentially likely to be saddle points, with the fraction of negative curvature directions being an increasing function of the error. Conversely, all local minima, which necessarily have index 0, are likely to have an error very close to that of the global minimum. Intuitively, in high dimensions, the chance that all the directions around a critical point lead upward (positive curvature) is exponentially small w.r.t. the number of dimensions, unless the critical point is the global minimum or stands at an error level close to it, i.e., it is unlikely one can find a way to go further down. These results may also be understood via random matrix theory. We know that for a large Gaussian random matrix the eigenvalue distribution follows Wigner’s famous semicircular law (Wigner, 1958), with both mode and mean at 0. The probability of an eigenvalue to be positive or negative is thus 1/2. Bray and Dean (2007) showed that the eigenvalues of the Hessian at a critical point are distributed in the same way, except that the semicircular spectrum is shifted by an amount determined by ϵ. For the global minimum, the spectrum is shifted so far right, that all eigenvalues are positive. As ϵ increases, the spectrum shifts to the left and accrues more negative eigenvalues as well as a density of eigenvalues around 0, indicating the typical presence of plateaus surrounding saddle points at large error. Such plateaus would slow the convergence of first order optimization methods, yielding the illusion of a local minimum. The random matrix perspective also concisely and intuitively crystallizes the striking difference between the geometry of low and high dimensional error surfaces. For N =1, an exact saddle point is a 0–probability event as it means randomly picking an eigenvalue of exactly 0. As N grows it becomes exponentially unlikely to randomly pick all eigenvalues to be positive or negative, and therefore most critical points are saddle points. Fyodorov and Williams (2007) review qualitatively similar results derived for random error functions superimposed on a quadratic error surface. These works indicate that for typical, generic functions chosen from a random Gaussian ensemble of functions, local minima with high error are exponentially rare in the dimensionality of the problem, but saddle points with many negative and approximate plateau directions are exponentially likely. However, is this result for generic error landscapes applicable to the error landscapes of practical problems of interest? Baldi and Hornik (1989) analyzed the error surface of a multilayer perceptron (MLP) with a single linear hidden layer. Such an error surface shows only saddle-points and no local minima. This result is qualitatively consistent with the observation made by Bray and Dean (2007). Indeed Saxe et al. (2014) analyzed the dynamics of learning in the presence of these saddle points, and showed that they arise due to scaling symmetries in the weight space of a deep linear MLP. These scaling symmetries enabled Saxe et al. (2014) to find new exact solutions to the nonlinear dynamics of learning in deep linear networks. These learning dynamics exhibit plateaus of high error followed by abrupt transitions to better performance. They qualitatively recapitulate aspects of the hierarchical development of semantic concepts in infants (Saxe et al., 2013). In (Saad and Solla, 1995) the dynamics of stochastic gradient descent are analyzed for soft committee machines. This work explores how well a student network can learn to imitate a randomly chosen teacher network. Importantly, it was observed that learning can go through an initial phase of being trapped in the symmetric submanifold of weight space. In this submanifold, the student’s hidden units compute similar functions over the distribution of inputs. The slow learning dynamics within this submanifold originates from saddle point structures (caused by permutation symmetries among hidden units), and their associated 2 MNIST (a) (b) CIFAR-10 (c) (d) Figure 1: (a) and (c) show how critical points are distributed in the ϵ–α plane. Note that they concentrate along a monotonically increasing curve. (b) and (d) plot the distributions of eigenvalues of the Hessian at three different critical points. Note that the y axes are in logarithmic scale. The vertical lines in (b) and (d) depict the position of 0. plateaus (Rattray et al., 1998; Inoue et al., 2003). The exit from the plateau associated with the symmetric submanifold corresponds to the differentiation of the student’s hidden units to mimic the teacher’s hidden units. Interestingly, this exit from the plateau is achieved by following directions of negative curvature associated with a saddle point. sin directions perpendicular to the symmetric submanifold. Mizutani and Dreyfus (2010) look at the effect of negative curvature on learning and implicitly at the effect of saddle points in the error surface. Their findings are similar. They show that the error surface of a single layer MLP has saddle points where the Hessian matrix is indefinite. 3 Experimental validation of the prevalence of saddle points In this section, we experimentally test whether the theoretical predictions presented by Bray and Dean (2007) for random Gaussian fields hold for neural networks. To our knowledge, this is the first attempt to measure the relevant statistical properties of neural network error surfaces and to test if the theory developed for random Gaussian fields generalizes to such cases. In particular, we are interested in how the critical points of a single layer MLP are distributed in the ϵ–α plane, and how the eigenvalues of the Hessian matrix at these critical points are distributed. We used a small MLP trained on a down-sampled version of MNIST and CIFAR-10. Newton method was used to identify critical points of the error function. The results are in Fig. 1. More details about the setup are provided in the supplementary material. This empirical test confirms that the observations by Bray and Dean (2007) qualitatively hold for neural networks. Critical points concentrate along a monotonically increasing curve in the ϵ–α plane. Thus the prevalence of high error saddle points do indeed pose a severe problem for training neural networks. While the eigenvalues do not seem to be exactly distributed according to the semicircular law, their distribution does shift to the left as the error increases. The large mode at 0 indicates that there is a plateau around any critical point of the error function of a neural network. 4 Dynamics of optimization algorithms near saddle points Given the prevalence of saddle points, it is important to understand how various optimization algorithms behave near them. Let us focus on non-degenerate saddle points for which the Hessian is not singular. These critical points can be locally analyzed by re-parameterizing the function according to Morse’s lemma below (see chapter 7.3, Theorem 7.16 in Callahan (2010) or the supplementary material for details): f(θ∗+∆θ)=f(θ∗)+ 1 2 nθ X i=1 λi∆v2 i , (1) where λi represents the ith eigenvalue of the Hessian, and ∆vi are the new parameters of the model corresponding to motion along the eigenvectors ei of the Hessian of f at θ∗. If finding the local minima of our function is the desired outcome of our optimization algorithm, we argue that an optimal algorithm would move away from the saddle point at a speed that is inverse proportional with the flatness of the error surface and hence depndented of how trustworthy this descent direction is further away from the current position. 3 A step of the gradient descent method always points away from the saddle point close to it (SGD in Fig. 2). Assuming equation (1) is a good approximation of our function we will analyze the optimality of the step according to how well the resulting ∆v optimizes the right hand side of (1). If an eigenvalue λi is positive (negative), then the step moves toward (away) from θ∗along ∆vi because the restriction of f to the corresponding eigenvector direction ∆vi, achieves a minimum (maximum) at θ∗. The drawback of the gradient descent method is not the direction, but the size of the step along each eigenvector. The step, along any direction ei, is given by −λi∆vi, and so small steps are taken in directions corresponding to eigenvalues of small absolute value. (a) (b) Figure 2: Behaviors of different optimization methods near a saddle point for (a) classical saddle structure 5x2−y2; (b) monkey saddle structure x3−3xy2. The yellow dot indicates the starting point. SFN stands for the saddle-free Newton method we proposed. The Newton method solves the slowness problem by rescaling the gradients in each direction with the inverse of the corresponding eigenvalue, yielding the step −∆vi. However, this approach can result in moving toward the saddle point. Specifically, if an eigenvalue is negative, the Newton step moves along the eigenvector in a direction opposite to the gradient descent step, and thus moves in the direction of θ∗. θ∗becomes an attractor for the Newton method (see Fig. 2), which can get stuck in this saddle point and not converge to a local minima. This justifies using the Newton method to find critical points of any index in Fig. 1. A trust region approach is one approach of scaling second order methods to non-convex problems. In one such method, the Hessian is damped to remove negative curvature by adding a constant α to its diagonal, which is equivalent to adding α to each of its eigenvalues. If we project the new step along the different eigenvectors of the modified Hessian, it is equivalent to rescaling the projections of the gradient on this direction by the inverse of the modified eigenvalues λi+α yields the step − λi/λi+α  ∆vi. To ensure the algorithm does not converge to the saddle point, one must increase the damping coefficient α enough so that λmin+α>0 even for the most negative eigenvalue λmin. This ensures that the modified Hessian is positive definnite. However, the drawback is again a potentially small step size in many eigen-directions incurred by a large damping factor α (the rescaling factors in each eigen-direction are not proportional to the curvature anymore). Besides damping, another approach to deal with negative curvature is to ignore them. This can be done regardless of the approximation strategy used for the Newton method such as a truncated Newton method or a BFGS approximation (see Nocedal and Wright (2006) chapters 4 and 7). However, such algorithms cannot escape saddle points, as they ignore the very directions of negative curvature that must be followed to achieve escape. Natural gradient descent is a first order method that relies on the curvature of the parameter manifold. That is, natural gradient descent takes a step that induces a constant change in the behaviour of the model as measured by the KL-divergence between the model before and after taking the step. The resulting algorithm is similar to the Newton method, except that it relies on the Fisher Information matrix F. It is argued by Rattray et al. (1998); Inoue et al. (2003) that natural gradient descent can address certain saddle point structures effectively. Specifically, it can resolve those saddle points arising from having units behaving very similarly. Mizutani and Dreyfus (2010), however, argue that natural gradient descent also suffers with negative curvature. One particular known issue is the over-realizable regime, where around the stationary solution θ∗, the Fisher matrix is rank-deficient. Numerically, this means that the Gauss-Newton direction can be orthogonal to the gradient at some distant point from θ∗(Mizutani and Dreyfus, 2010), causing optimization to converge to some non-stationary point. Another weakness is that the difference S between the Hessian and the Fisher Information Matrix can be large near certain saddle points that exhibit strong negative curvature. This means that the landscape close to these critical points may be dominated by S, meaning that the rescaling provided by F−1 is not optimal in all directions. The same is true for TONGA (Le Roux et al., 2007), an algorithm similar to natural gradient descent. It uses the covariance of the gradients as the rescaling factor. As these gradients vanish approaching a critical point, their covariance will result in much larger steps than needed near critical points. 4 5 Generalized trust region methods In order to attack the saddle point problem, and overcome the deficiencies of the above methods, we will define a class of generalized trust region methods, and search for an algorithm within this space. This class involves a straightforward extension of classical trust region methods via two simple changes: (1) We allow the minimization of a first-order Taylor expansion of the function instead of always relying on a second-order Taylor expansion as is typically done in trust region methods, and (2) we replace the constraint on the norm of the step ∆θ by a constraint on the distance between θ and θ+∆θ. Thus the choice of distance function and Taylor expansion order specifies an algorithm. If we define Tk(f,θ,∆θ) to indicate the k-th order Taylor series expansion of f around θ evaluated at θ+∆θ, then we can summarize a generalized trust region method as: ∆θ=argmin ∆θ Tk{f,θ,∆θ} with k∈{1,2}s. t. d(θ,θ+∆θ)≤∆. (2) For example, the α-damped Newton method described above arises as a special case with k = 2 and d(θ,θ+∆θ)=||∆θ||2 2, where α is implicitly a function of ∆. 6 Attacking the saddle point problem Algorithm 1 Approximate saddle-free Newton Require: Function f(θ) to minimize for i=1→M do V←k Lanczos vectors of ∂2f ∂θ2 s(α)=f(θ+Vα) | ˆH|← ∂2s ∂α2 by using an eigen decomposition of ˆH for j=1→m do g←−∂s ∂α λ←argminλs((| ˆH|+λI)−1g) θ←θ+V(| ˆH|+λI)−1g end for end for We now search for a solution to the saddle-point problem within the family of generalized trust region methods. In particular, the analysis of optimization algorithms near saddle points discussed in Sec. 4 suggests a simple heuristic solution: rescale the gradient along each eigen-direction ei by 1/|λi|. This achieves the same optimal rescaling as the Newton method, while preserving the sign of the gradient, thereby turning saddle points into repellers, not attractors, of the learning dynamics. The idea of taking the absolute value of the eigenvalues of the Hessian was suggested before. See, for example, (Nocedal and Wright, 2006, chapter 3.4) or Murray (2010, chapter 4.1). However, we are not aware of any proper justification of this algorithm or even a detailed exploration (empirical or otherwise) of this idea. One cannot simply replace H by |H|, where |H| is the matrix obtained by taking the absolute value of each eigenvalue of H, without proper justification. While we might be able to argue that this heuristic modification does the right thing near critical points, is it still the right thing far away from the critical points? How can we express this step in terms of the existing methods ? Here we show this heuristic solution arises naturally from our generalized trust region approach. Unlike classical trust region approaches, we consider minimizing a first-order Taylor expansion of the loss (k =1 in Eq. (2)). This means that the curvature information has to come from the constraint by picking a suitable distance measure d (see Eq. (2)). Since the minimum of the first order approximation of f is at infinity, we know that this optimization dynamics will always jump to the border of the trust region. So we must ask how far from θ can we trust the first order approximation of f? One answer is to bound the discrepancy between the first and second order Taylor expansions of f by imposing the following constraint: d(θ,θ+∆θ)= f(θ)+∇f∆θ+ 1 2∆θ⊤H∆θ−f(θ)−∇f∆θ = 1 2 ∆θ⊤H∆θ ≤∆, (3) where ∇f is the partial derivative of f with respect to θ and ∆∈R is some small value that indicates how much discrepancy we are willing to accept. Note that the distance measure d takes into account the curvature of the function. Eq. (3) is not easy to solve for ∆θ in more than one dimension. Alternatively, one could take the square of the distance, but this would yield an optimization problem with a constraint that is quartic in ∆θ, and therefore also difficult to solve. We circumvent these difficulties through a Lemma: 5 MNIST (a) (b) (c) CIFAR-10 (d) (e) (f) Figure 3: Empirical evaluation of different optimization algorithms for a single-layer MLP trained on the rescaled MNIST and CIFAR-10 dataset. In (a) and (d) we look at the minimum error obtained by the different algorithms considered as a function of the model size. (b) and (e) show the optimal training curves for the three algorithms. The error is plotted as a function of the number of epochs. (c) and (f) track the norm of the largest negative eigenvalue. Lemma 1. Let A be a nonsingular square matrix in Rn×Rn, and x∈Rn be some vector. Then it holds that |x⊤Ax|≤x⊤|A|x, where |A| is the matrix obtained by taking the absolute value of each of the eigenvalues of A. Proof. See the supplementary material for the proof. Instead of the originally proposed distance measure in Eq. (3), we approximate the distance by its upper bound ∆θ|H|∆θ based on Lemma 1. This results in the following generalized trust region method: ∆θ=argmin ∆θ f(θ)+∇f∆θ s. t. ∆θ⊤|H|∆θ≤∆. (4) Note that as discussed before, we can replace the inequality constraint with an equality one, as the first order approximation of f has a minimum at infinity and the algorithm always jumps to the border of the trust region. Similar to (Pascanu and Bengio, 2014), we use Lagrange multipliers to obtain the solution of this constrained optimization. This gives (up to a scalar that we fold into the learning rate) a step of the form: ∆θ=−∇f|H|−1 (5) This algorithm, which we call the saddle-free Newton method (SFN), leverages curvature information in a fundamentally different way, to define the shape of the trust region, rather than Taylor expansion to second order, as in classical methods. Unlike gradient descent, it can move further (less) in the directions of low (high) curvature. It is identical to the Newton method when the Hessian is positive definite, but unlike the Newton method, it can escape saddle points. Furthermore, unlike gradient descent, the escape is rapid even along directions of weak negative curvature (see Fig. 2). The exact implementation of this algorithm is intractable in a high dimensional problem, because it requires the exact computation of the Hessian. Instead we use an approach similar to Krylov subspace descent (Vinyals and Povey, 2012). We optimize that function in a lower-dimensional Krylov subspace ˆf(α)=f(θ+αV). The k Krylov subspace vectors V are found through Lanczos iteration of the Hessian. These vectors will span the k biggest eigenvectors of the Hessian with high-probability. This reparametrization through α greatly reduces the dimensionality and allows us to use exact saddle-free Newton in the subspace.1 See Alg. 1 for the pseudocode. 1 In the Krylov subspace, ∂ˆf ∂α =V ∂f ∂θ ⊤and ∂2ˆf ∂α2 =V  ∂2f ∂θ2  V⊤. 6 Deep Autoencoder (a) (b) Recurrent Neural Network (c) (d) Figure 4: Empirical results on training deep autoencoders on MNIST and recurrent neural network on Penn Treebank. (a) and (c): The learning curve for SGD and SGD followed by saddle-free Newton method. (b) The evolution of the magnitude of the most negative eigenvalue and the norm of the gradients w.r.t. the number of epochs (deep autoencoder). (d) The distribution of eigenvalues of the RNN solutions found by SGD and the SGD continued with saddle-free Newton method. 7 Experimental validation of the saddle-free Newton method In this section, we empirically evaluate the theory suggesting the existence of many saddle points in high-dimensional functions by training neural networks. 7.1 Existence of Saddle Points in Neural Networks In this section, we validate the existence of saddle points in the cost function of neural networks, and see how each of the algorithms we described earlier behaves near them. In order to minimize the effect of any type of approximation used in the algorithms, we train small neural networks on the scaled-down version of MNIST and CIFAR-10, where we can compute the update directions by each algorithm exactly. Both MNIST and CIFAR-10 were downsampled to be of size 10×10. We compare minibatch stochastic gradient descent (MSGD), damped Newton and the proposed saddle-free Newton method (SFN). The hyperparameters of SGD were selected via random search (Bergstra and Bengio, 2012), and the damping coefficients for the damped Newton and saddle-free Newton2 methods were selected from a small set at each update. The theory suggests that the number of saddle points increases exponentially as the dimensionality of the function increases. From this, we expect that it becomes more likely for the conventional algorithms such as SGD and Newton methods to stop near saddle points, resulting in worse performance (on training samples). Figs. 3 (a) and (d) clearly confirm this. With the smallest network, all the algorithms perform comparably, but as the size grows, the saddle-free Newton algorithm outperforms the others by a large margin. A closer look into the different behavior of each algorithm is presented in Figs. 3 (b) and (e) which show the evolution of training error over optimization. We can see that the proposed saddle-free Newton escapes, or does not get stuck at all, near a saddle point where both SGD and Newton methods appear trapped. Especially, at the 10-th epoch in the case of MNIST, we can observe the saddle-free Newton method rapidly escaping from the saddle point. Furthermore, Figs. 3 (c) and (f) provide evidence that the distribution of eigenvalues shifts more toward the right as error decreases for all algorithms, consistent with the theory of random error functions. The distribution shifts more for SFN, suggesting it can successfully avoid saddle-points on intermediary error (and large index). 7.2 Effectiveness of saddle-free Newton Method in Deep Feedforward Neural Networks Here, we further show the effectiveness of the proposed saddle-free Newton method in a larger neural network having seven hidden layers. The neural network is a deep autoencoder trained on (full-scale) MNIST and considered a standard benchmark problem for assessing the performance of optimization algorithms on neural networks (Sutskever et al., 2013). In this large-scale problem, we used the Krylov subspace descent approach described earlier with 500 subspace vectors. We first trained the model with SGD and observed that learning stalls after achieving the mean-squared error (MSE) of 1.0. We then continued with the saddle-free Newton method which rapidly escaped the (approximate) plateau at which SGD was stuck (See Fig. 4 (a)). Furthermore, even in these large scale 2Damping is used for numerical stability. 7 experiments, we were able to confirm that the distribution of Hessian eigenvalues shifts right as error decreases, and that the proposed saddle-free Newton algorithm accelerates this shift (See Fig. 4 (b)). The model trained with SGD followed by the saddle-free Newton method was able to get the state-of-the-art MSE of 0.57 compared to the previous best error of 0.69 achieved by the Hessian-Free method (Martens, 2010). Saddle free Newton method does better. 7.3 Recurrent Neural Networks: Hard Optimization Problem Recurrent neural networks are widely known to be more difficult to train than feedforward neural networks (see, e.g., Bengio et al., 1994; Pascanu et al., 2013). In practice they tend to underfit, and in this section, we want to test if the proposed saddle-free Newton method can help avoiding underfitting, assuming that that it is caused by saddle points. We trained a small recurrent neural network having 120 hidden units for the task of character-level language modeling on Penn Treebank corpus. Similarly to the previous experiment, we trained the model with SGD until it was clear that the learning stalled. From there on, training continued with the saddle-free Newton method. In Fig. 4 (c), we see a trend similar to what we observed with the previous experiments using feedforward neural networks. The SGD stops progressing quickly and does not improve performance, suggesting that the algorithm is stuck in a plateau, possibly around a saddle point. As soon as we apply the proposed saddle-free Newton method, we see that the error drops significantly. Furthermore, Fig. 4 (d) clearly shows that the solution found by the saddle-free Newton has fewer negative eigenvalues, consistent with the theory of random Gaussian error functions. In addition to the saddle-free Newton method, we also tried continuing with the truncated Newton method with damping, however, without much success. 8 Conclusion In summary, we have drawn from disparate literatures spanning statistical physics and random matrix theory to neural network theory, to argue that (a) non-convex error surfaces in high dimensional spaces generically suffer from a proliferation of saddle points, and (b) in contrast to conventional wisdom derived from low dimensional intuition, local minima with high error are exponentially rare in high dimensions. Moreover, we have provided the first experimental tests of these theories by performing new measurements of the statistical properties of critical points in neural network error surfaces. These tests were enabled by a novel application of Newton’s method to search for critical points of any index (fraction of negative eigenvalues), and they confirmed the main qualitative prediction of theory that the index of a critical point tightly and positively correlates with its error level. Motivated by this theory, we developed a framework of generalized trust region methods to search for algorithms that can rapidly escape saddle points. This framework allows us to leverage curvature information in a fundamentally different way than classical methods, by defining the shape of the trust region, rather than locally approximating the function to second order. Through further approximations, we derived an exceedingly simple algorithm, the saddle-free Newton method, which rescales gradients by the absolute value of the inverse Hessian. This algorithm had previously remained heuristic and theoretically unjustified, as well as numerically unexplored within the context of deep and recurrent neural networks. Our work shows that near saddle points it can achieve rapid escape by combining the best of gradient descent and Newton methods while avoiding the pitfalls of both. Moreover, through our generalized trust region approach, our work shows that this algorithm is sensible even far from saddle points. Finally, we demonstrate improved optimization on several neural network training problems. For the future, we are mainly interested in two directions. The first direction is to explore methods beyond Kyrylov subspaces, such as one in (Sohl-Dickstein et al., 2014), that allow the saddle-free Newton method to scale to high dimensional problems, where we cannot easily compute the entire Hessian matrix. In the second direction, the theoretical properties of critical points in the problem of training a neural network will be further analyzed. More generally, it is likely that a deeper understanding of the statistical properties of high dimensional error surfaces will guide the design of novel non-convex optimization algorithms that could impact many fields across science and engineering. Acknowledgments We would like to thank the developers of Theano (Bergstra et al., 2010; Bastien et al., 2012). We would also like to thank CIFAR, and Canada Research Chairs for funding, and Compute Canada, and Calcul Qu´ebec for providing computational resources. Razvan Pascanu is supported by a DeepMind Google Fellowship. Surya Ganguli thanks the Burroughs Wellcome and Sloan Foundations for support. 8 References Baldi, P. and Hornik, K. (1989). Neural networks and principal component analysis: Learning from examples without local minima. Neural Networks, 2(1), 53–58. Bastien, F., Lamblin, P., Pascanu, R., Bergstra, J., Goodfellow, I. J., Bergeron, A., Bouchard, N., and Bengio, Y. (2012). Theano: new features and speed improvements. Bengio, Y., Simard, P., and Frasconi, P. (1994). Learning long-term dependencies with gradient descent is difficult. 5(2), 157–166. Special Issue on Recurrent Neural Networks, March 94. Bergstra, J. and Bengio, Y. (2012). Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13, 281–305. Bergstra, J., Breuleux, O., Bastien, F., Lamblin, P., Pascanu, R., Desjardins, G., Turian, J., Warde-Farley, D., and Bengio, Y. (2010). Theano: a CPU and GPU math expression compiler. In Proceedings of the Python for Scientific Computing Conference (SciPy). Bray, A. J. and Dean, D. S. (2007). Statistics of critical points of gaussian fields on large-dimensional spaces. Physics Review Letter, 98, 150201. Callahan, J. (2010). Advanced Calculus: A Geometric View. Undergraduate Texts in Mathematics. Springer. Fyodorov, Y. V. and Williams, I. (2007). Replica symmetry breaking condition exposed by random matrix calculation of landscape complexity. Journal of Statistical Physics, 129(5-6), 1081–1116. Inoue, M., Park, H., and Okada, M. (2003). On-line learning theory of soft committee machines with correlated hidden units steepest gradient descent and natural gradient descent. Journal of the Physical Society of Japan, 72(4), 805–810. Le Roux, N., Manzagol, P.-A., and Bengio, Y. (2007). Topmoumoute online natural gradient algorithm. Advances in Neural Information Processing Systems. Martens, J. (2010). Deep learning via hessian-free optimization. In International Conference in Machine Learning, pages 735–742. Mizutani, E. and Dreyfus, S. (2010). An analysis on negative curvature induced by singularity in multi-layer neuralnetwork learning. In Advances in Neural Information Processing Systems, pages 1669–1677. Murray, W. (2010). Newton-type methods. Technical report, Department of Management Science and Engineering, Stanford University. Nocedal, J. and Wright, S. (2006). Numerical Optimization. Springer. Parisi, G. (2007). Mean field theory of spin glasses: statistics and dynamics. Technical Report Arxiv 0706.0094. Pascanu, R. and Bengio, Y. (2014). Revisiting natural gradient for deep networks. In International Conference on Learning Representations. Pascanu, R., Mikolov, T., and Bengio, Y. (2013). On the difficulty of training recurrent neural networks. In ICML’2013. Pascanu, R., Dauphin, Y., Ganguli, S., and Bengio, Y. (2014). On the saddle point problem for non-convex optimization. Technical Report Arxiv 1405.4604. Rasmussen, C. E. and Williams, C. K. I. (2005). Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning). The MIT Press. Rattray, M., Saad, D., and Amari, S. I. (1998). Natural Gradient Descent for On-Line Learning. Physical Review Letters, 81(24), 5461–5464. Saad, D. and Solla, S. A. (1995). On-line learning in soft committee machines. Physical Review E, 52, 4225–4243. Saxe, A., McClelland, J., and Ganguli, S. (2013). Learning hierarchical category structure in deep neural networks. Proceedings of the 35th annual meeting of the Cognitive Science Society, pages 1271–1276. Saxe, A., McClelland, J., and Ganguli, S. (2014). Exact solutions to the nonlinear dynamics of learning in deep linear neural network. In International Conference on Learning Representations. Sohl-Dickstein, J., Poole, B., and Ganguli, S. (2014). Fast large-scale optimization by unifying stochastic gradient and quasi-newton methods. In ICML’2014. Sutskever, I., Martens, J., Dahl, G. E., and Hinton, G. E. (2013). On the importance of initialization and momentum in deep learning. In S. Dasgupta and D. Mcallester, editors, Proceedings of the 30th International Conference on Machine Learning (ICML-13), volume 28, pages 1139–1147. JMLR Workshop and Conference Proceedings. Vinyals, O. and Povey, D. (2012). Krylov Subspace Descent for Deep Learning. In AISTATS. Wigner, E. P. (1958). On the distribution of the roots of certain symmetric matrices. The Annals of Mathematics, 67(2), 325–327. 9
2014
34
5,447
A Multi-World Approach to Question Answering about Real-World Scenes based on Uncertain Input Mateusz Malinowski Mario Fritz Max Planck Institute for Informatics Saarbr¨ucken, Germany {mmalinow,mfritz}@mpi-inf.mpg.de Abstract We propose a method for automatically answering questions about images by bringing together recent advances from natural language processing and computer vision. We combine discrete reasoning with uncertain predictions by a multiworld approach that represents uncertainty about the perceived world in a bayesian framework. Our approach can handle human questions of high complexity about realistic scenes and replies with range of answer like counts, object classes, instances and lists of them. The system is directly trained from question-answer pairs. We establish a first benchmark for this task that can be seen as a modern attempt at a visual turing test. 1 Introduction As vision techniques like segmentation and object recognition begin to mature, there has been an increasing interest in broadening the scope of research to full scene understanding. But what is meant by “understanding” of a scene and how do we measure the degree of “understanding”? Most often “understanding” refers to a correct labeling of pixels, regions or bounding boxes in terms of semantic annotations. All predictions made by such methods inevitably come with uncertainties attached due to limitations in features or data or even inherent ambiguity of the visual input. Equally strong progress has been made on the language side, where methods have been proposed that can learn to answer questions solely from question-answer pairs [1]. These methods operate on a set of facts given to the system, which is refered to as a world. Based on that knowledge the answer is inferred by marginalizing over multiple interpretations of the question. However, the correctness of the facts is a core assumption. We like to unite those two research directions by addressing a question answering task based on realworld images. To combine the probabilistic output of state-of-the-art scene segmentation algorithms, we propose a Bayesian formulation that marginalizes over multiple possible worlds that correspond to different interpretations of the scene. To date, we are lacking a substantial dataset that serves as a benchmark for question answering on real-world images. Such a test has high demands on “understanding” the visual input and tests a whole chain of perception, language understanding and deduction. This very much relates to the “AI-dream” of building a turing test for vision. While we are still not ready to test our vision system on completely unconstrained settings that were envisioned in early days of AI, we argue that a question-answering task on complex indoor scenes is a timely step in this direction. Contributions: In this paper we combine automatic, semantic segmentations of real-world scenes with symbolic reasoning about questions in a Bayesian framework by proposing a multi-world approach for automatic question answering. We introduce a novel dataset of more than 12,000 1 question-answer pairs on RGBD images produced by humans, as a modern approach to a visual turing test. We benchmark our approach on this new challenge and show the advantages of our multi-world approach. Furthermore, we provide additional insights regarding the challenges that lie ahead of us by factoring out sources of error from different components. 2 Related work Semantic parsers: Our work is mainly inspired by [1] that learns the semantic representation for the question answering task solely based on questions and answers in natural language. Although the architecture learns the mapping from weak supervision, it achieves comparable results to the semantic parsers that rely on manual annotations of logical forms ([2], [3]). In contrast to our work, [1] has never used the semantic parser to connect the natural language to the perceived world. Language and perception: Previous work [4, 5] has proposed models for the language grounding problem with the goal of connecting the meaning of the natural language sentences to a perceived world. Both methods use images as the representation of the physical world, but concentrate rather on constrained domain with images consisting of very few objects. For instance [5] considers only two mugs, monitor and table in their dataset, whereas [4] examines objects such as blocks, plastic food, and building bricks. In contrast, our work focuses on a diverse collection of real-world indoor RGBD images [6] - with many more objects in the scene and more complex spatial relationship between them. Moreover, our paper considers complex questions - beyond the scope of [4] and [5] - and reasoning across different images using only textual question-answer pairs for training. This imposes additional challenges for the question-answering engines such as scalability of the semantic parser, good scene representation, dealing with uncertainty in the language and perception, efficient inference and spatial reasoning. Although others [7, 8] propose interesting alternatives for learning the language binding, it is unclear if such approaches can be used to provide answers on questions. Integrated systems that execute commands: Others [9, 10, 11, 12, 13] focus on the task of learning the representation of natural language in the restricted setting of executing commands. In such scenario, the integrated systems execute commands given natural language input with the goal of using them in navigation. In our work, we aim for less restrictive scenario with the question-answering system in the mind. For instance, the user may ask our architecture about counting and colors (’How many green tables are in the image?’), negations (’Which images do not have tables?’) and superlatives (’What is the largest object in the image?’). Probabilistic databases: Similarly to [14] that reduces Named Entity Recognition problem into the inference problem from probabilistic database, we sample multiple-worlds based on the uncertainty introduced by the semantic segmentation algorithm that we apply to the visual input. 3 Method Our method answers on questions based on images by combining natural language input with output from visual scene analysis in a probabilistic framework as illustrated in Figure 1. In the single world approach, we generate a single perceived world W based on segmentations - a unique interpretation of a visual scene. In contrast, our multi-world approach integrates over many latent worlds W, and hence taking different interpretations of the scene and question into account. Single-world approach for question answering problem We build on recent progress on end-toend question answering systems that are solely trained on question-answer pairs (Q, A) [1]. Top part of Figure 1 outlines how we build on [1] by modeling the logical forms associated with a question as latent variable T given a single world W. More formally the task of predicting an answer A given a question Q and a world W is performed by computing the following posterior which marginalizes over the latent logical forms (semantic trees in [1]) T : P(A|Q, W) := X T P(A|T , W)P(T |Q). (1) P(A|T , W) corresponds to denotation of a logical form T on the world W. In this setting, the answer is unique given the logical form and the world: P(A|T , W) = 1[A ∈σW(T )] with the evaluation function σW, which evaluates a logical form on the world W. Following [1] we use DCS Trees that yield the following recursive evaluation function σW: σW(T ) := 2 Scene analysis sofa (1,brown, image 1, X,Y,Z) chair (1,brown, image 4, X,Y,Z) chair (2,brown, image 4, X,Y,Z) table (1,brown, image 1,X,Y,Z) wall (1,white, image 1, X,Y,Z) bed (1, white, image 2 X,Y,Z) chair (1,brown, image 5, X,Y,Z) … W world Q question A answer Semantic parsing T logical form Semantic evaluation W latent worlds Q question A answer Semantic parsing T logical form S S segmentation single
 world approach multi-world approach Semantic evaluation Figure 1: Overview of our approach to question answering with multiple latent worlds in contrast to single world approach. Td j {v : v ∈σW(p), t ∈σW(Tj), Rj(v, t)} where T := ⟨p, (T1, R1), (T2, R2), ..., (Td, Rd)⟩is the semantic tree with a predicate p associated with the current node, its subtrees T1, T2, ..., Td, and relations Rj that define the relationship between the current node and a subtree Tj. In the predictions, we use a log-linear distribution P(T |Q) ∝exp(θT φ(Q, T )) over the logical forms with a feature vector φ measuring compatibility between Q and T and parameters θ learnt from training data. Every component φj is the number of times that a specific feature template occurs in (Q, T ). We use the same templates as [1]: string triggers a predicate, string is under a relation, string is under a trace predicate, two predicates are linked via relation and a predicate has a child. The model learns by alternating between searching over a restricted space of valid trees and gradient descent updates of the model parameters θ. We use the Datalog inference engine to produce the answers from the latent logical forms. The linguistic phenomena such as superlatives and negations are handled by the logical forms and the inference engine. For a detailed exposition, we refer the reader to [1]. Question answering on real-world images based on a perceived world Similar to [5], we extend the work of [1] to operate now on what we call perceived world W. This still corresponds to the single world approach in our overview Figure 1. However our world is now populated with “facts” derived from automatic, semantic image segmentations S. For this purpose, we build the world by running a state-of-the-art semantic segmentation algorithm [15] over the images and collect the recognized information about objects such as object class, 3D position, and 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 (a) Sampled worlds. 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 (b) Object’s coordinates. Figure 2: Fig. 2a shows a few sampled worlds where only segments of the class ’person’ are shown. In the clock-wise order: original picture, most confident world, and three possible worlds (gray-scale values denote the class confidence). Although, at first glance the most confident world seems to be a reasonable approach, our experiments show opposite - we can benefit from imperfect but multiple worlds. Fig. 2b shows object’s coordinates (original and Z, Y , X images in the clock-wise order), which better represent the spatial location of the objects than the image coordinates. 3 Predicate Definition closeAbove(A, B) above(A, B) and (Ymin(B) < Ymax(A) + ϵ) closeLeftOf(A, B) leftOf(A, B) and (Xmin(B) < Xmax(A) + ϵ) closeInFrontOf(A, B) inFrontOf(A, B) and (Zmin(B) < Zmax(A) + ϵ) Xaux(A, B) Xmean(A) < Xmax(B) and Xmin(B) < Xmean(A) Zaux(A, B) Zmean(A) < Zmax(B) and Zmin(B) < Zmean(A) haux(A, B) closeAbove(A, B) or closeBelow(A, B) vaux(A, B) closeLeftOf(A, B) or closeRightOf(A, B) auxiliary relations daux(A, B) closeInFrontOf(A, B) or closeBehind(A, B) leftOf(A, B) Xmean(A) < Xmean(B)) above(A, B) Ymean(A) < Ymean(B) inFrontOf(A, B) Zmean(A) < Zmean(B)) spatial on(A, B) closeAbove(A, B) and Zaux(A, B) and Xaux(A, B) close(A, B) haux(A, B) or vaux(A, B) or daux(A, B) Table 1: Predicates defining spatial relations between A and B. Auxiliary relations define actual spatial relations. The Y axis points downwards, functions Xmax, Xmin, ... take appropriate values from the tuple predicate, and ϵ is a ’small’ amount. Symmetrical relations such as rightOf, below, behind, etc. can readily be defined in terms of other relations (i.e. below(A, B) = above(B, A)). color [16] (Figure 1 - middle part). Every object hypothesis is therefore represented as an n-tuple: predicate(instance id, image id, color, spatial loc) where predicate ∈{bag, bed, books, ...}, instance id is the object’s id, image id is id of the image containing the object, color is estimated color of the object [16], and spatial loc is the object’s position in the image. Latter is represented as (Xmin, Xmax, Xmean, Ymin, Ymax, Ymean, Zmin, Zmax, Zmean) and defines minimal, maximal, and mean location of the object along X, Y, Z axes. To obtain the coordinates we fit axis parallel cuboids to the cropped 3d objects based on the semantic segmentation. Note that the X, Y, Z coordinate system is aligned with direction of gravity [15]. As shown in Figure 2b, this is a more meaningful representation of the object’s coordinates over simple image coordinates. The complete schema will be documented together with the code release. We realize that the skilled use of spatial relations is a complex task and grounding spatial relations is a research thread on its own (e.g. [17], [18] and [19]). For our purposes, we focus on predefined relations shown in Table 1, while the association of them as well as the object classes are still dealt within the question answering architecture. Multi-worlds approach for combining uncertain visual perception and symbolic reasoning Up to now we have considered the output of the semantic segmentation as “hard facts”, and hence ignored uncertainty in the class labeling. Every such labeling of the segments corresponds to different interpretation of the scene - different perceived world. Drawing on ideas from probabilistic databases [14], we propose a multi-world approach (Figure 1 - lower part) that marginalizes over multiple possible worlds W - multiple interpretations of a visual scene - derived from the segmentation S. Therefore the posterior over the answer A given question Q and semantic segmentation S of the image marginalizes over the latent worlds W and logical forms T : P(A | Q, S) = X W X T P(A | W, T )P(W | S) P(T | Q) (2) The semantic segmentation of the image is a set of segments si with the associated probabilities pij over the C object categories cj. More precisely S = {(s1, L1), (s2, L2), ..., (sk, Lk)} where Li = {(cj, pij)}C j=1, P(si = cj) = pij, and k is the number of segments of given image. Let ˆSf =  (s1, cf(1)), (s2, cf(2)), ..., (sk, cf(k))) be an assignment of the categories into segments of the image according to the binding function f ∈F = {1, ..., C}{1,...,k}. With such notation, for a fixed binding function f, a world W is a set of tuples consistent with ˆSf, and define P(W|S) = Q i p(i,f(i)). Hence we have as many possible worlds as binding functions, that is Ck. Eq. 2 becomes quickly intractable for k and C seen in practice, wherefore we use a sampling strategy that draws a finite sample ⃗W = (W1, W2, ..., WN) from P(·|S) under an assumption that for each segment si every object’s category cj is drawn independently according to pij. A few sampled perceived worlds are shown in Figure 2a. Regarding the computational efficiency, computing P T P(A | Wi, T )P(T | Q) can be done independently for every Wi, and therefore in parallel without any need for synchronization. Since for small N the computational costs of summing up computed probabilities is marginal, the overall cost is about the same as single inference modulo parallelism. The presented multi-world approach to question answering on real-world scenes is still an end-to-end architecture that is trained solely on the question-answer pairs. 4 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 50 100 150 200 250 300 350 400 450 500 550 50 100 150 200 250 300 350 400 Figure 3: NYU-Depth V2 dataset: image, Z axis, ground truth and predicted semantic segmentations. Description Template Example counting How many {object} are in {image id}? How many cabinets are in image1? counting and colors How many {color} {object} are in {image id}? How many gray cabinets are in image1? room type Which type of the room is depicted in {image id}? Which type of the room is depicted in image1? Individual superlatives What is the largest {object} in {image id}? What is the largest object in image1? counting and colors How many {color} {object}? How many black bags? negations type 1 Which images do not have {object}? Which images do not have sofa? set negations type 2 Which images are not {room type}? Which images are not bedroom? negations type 3 Which images have {object} but do not have a {object}? Which images have desk but do not have a lamp? Table 2: Synthetic question-answer pairs. The questions can be about individual images or the sets of images. Implementation and Scalability For worlds containing many facts and spatial relations the induction step becomes computationally demanding as it considers all pairs of the facts (we have about 4 million predicates in the worst case). Therefore we use a batch-based approximation in such situations. Every image induces a set of facts that we call a batch of facts. For every test image, we find k nearest neighbors in the space of training batches with a boolean variant of TF.IDF to measure similarity [20]. This is equivalent to building a training world from k images with most similar content to the perceived world of the test image. We use k = 3 and 25 worlds in our experiments. Dataset and the source code can be found in our website 1. 4 Experiments 4.1 DAtaset for QUestion Answering on Real-world images (DAQUAR) Images and Semantic Segmentation Our new dataset for question answering is built on top of the NYU-Depth V2 dataset [6]. NYU-Depth V2 contains 1449 RGBD images together with annotated semantic segmentations (Figure 3) where every pixel is labeled into some object class with a confidence score. Originally 894 classes are considered. According to [15], we preprocess the data to obtain canonical views of the scenes and use X, Y , Z coordinates from the depth sensor to define spatial placement of the objects in 3D. To investigate the impact of uncertainty in the visual analysis of the scenes, we also employ computer vision techniques for automatic semantic segmentation. We use a state-of-the-art scene analysis method [15] which maps every pixel into 40 classes: 37 informative object classes as well as ’other structure’, ’other furniture’ and ’other prop’. We ignore the latter three. We use the same data split as [15]: 795 training and 654 test images. To use our spatial representation on the image content, we fit 3d cuboids to the segmentations. New dataset of questions and answers In the spirit of a visual turing test, we collect question answer pairs from human annotators for the NYU dataset. In our work, we consider two types of the annotations: synthetic and human. The synthetic question-answer pairs are automatically generated question-answer pairs, which are based on the templates shown in Table 2. These templates are then instantiated with facts from the database. To collect 12468 human question-answer pairs we ask 5 in-house participants to provide questions and answers. They were instructed to give valid answers that are either basic colors [16], numbers or objects (894 categories) or sets of those. Besides the answers, we don’t impose any constraints on the questions. We also don’t correct the questions as we believe that the semantic parsers should be robust under the human errors. Finally, we use 6794 training and 5674 test question-answer pairs – about 9 pairs per image on average (8.63, 8.75)2. 1https://www.d2.mpi-inf.mpg.de/visual-turing-challenge 2Our notation (x, y) denotes mean x and trimean y. We use Tukey’s trimean 1 4(Q1 +2Q2 +Q3), where Qj denotes the j-th quartile [21]. This measure combines the benefits of both median (robustness to the extremes) and empirical mean (attention to the hinge values). 5 The database exhibit some biases showing humans tend to focus on a few prominent objects. For instance we have more than 400 occurrences of table and chair in the answers. In average the object’s category occurs (14.25, 4) times in training set and (22.48, 5.75) times in total. Figure 4 shows example question-answer pairs together with the corresponding image that illustrate some of the challenges captured in this dataset. Performance Measure While the quality of an answer that the system produces can be measured in terms of accuracy w.r.t. the ground truth (correct/wrong), we propose, inspired from the work on Fuzzy Sets [22], a soft measure based on the WUP score [23], which we call WUPS (WUP Set) score. As the number of classes grows, the semantic boundaries between them are becoming more fuzzy. For example, both concepts ’carton’ and ’box’ have similar meaning, or ’cup’ and ’cup of coffee’ are almost indifferent. Therefore we seek a metric that measures the quality of an answer and penalizes naive solutions where the architecture outputs too many or too few answers. Standard Accuracy is defined as: 1 N PN i=1 1{Ai = T i} · 100 where Ai, T i are i-th answer and ground-truth respectively. Since both the answers may include more than one object, it is beneficial to represent them as sets of the objects T = {t1, t2, ...}. From this point of view we have for every i ∈{1, 2, ..., N}: 1{Ai = T i} = 1{Ai ⊆T i ∩T i ⊆Ai} = min{1{Ai ⊆T i}, 1{T i ⊆Ai}} (3) = min{ Y a∈Ai 1{a ∈T i}, Y t∈T i 1{t ∈Ai}} ≈min{ Y a∈Ai µ(a ∈T i), Y t∈T i µ(t ∈Ai)} (4) We use a soft equivalent of the intersection operator in Eq. 3, and a set membership measure µ, with properties µ(x ∈X) = 1 if x ∈X, µ(x ∈X) = maxy∈X µ(x = y) and µ(x = y) ∈[0, 1], in Eq. 4 with equality whenever µ = 1. For µ we use a variant of Wu-Palmer similarity [23, 24]. WUP(a, b) calculates similarity based on the depth of two words a and b in the taxonomy[25, 26], and define the WUPS score: WUPS(A, T) = 1 N N X i=1 min{ Y a∈Ai max t∈T i WUP(a, t), Y t∈T i max a∈Ai WUP(a, t)} · 100 (5) Empirically, we have found that in our task a WUP score of around 0.9 is required for precise answers. Therefore we have implemented down-weighting WUP(a, b) by one order of magnitude (0.1 · WUP) whenever WUP(a, b) < t for a threshold t. We plot a curve over thresholds t ranging from 0 to 1 (Figure 5). Since ”WUPS at 0” refers to the most ’forgivable’ measure without any downweighting and ”WUPS at 1.0” corresponds to plain accuracy. Figure 5 benchmarks architectures by requiring answers with precision ranging from low to high. Here we show some examples of the pure WUP score to give intuitions about the range: WUP(curtain, blinds) = 0.94, WUP(carton, box) = 0.94, WUP(stove, fire extinguisher) = 0.82. 4.2 Quantitative results We perform a series of experiments to highlight particular challenges like uncertain segmentations, unknown true logical forms, some linguistic phenomena as well as show the advantages of our proposed multi-world approach. In particular, we distinguish between experiments on synthetic question-answer pairs (SynthQA) based on templates and those collected by annotators (HumanQA), automatic scene segmentation (AutoSeg) with a computer vision algorithm [15] and human segmentations (HumanSeg) based on the ground-truth annotations in the NYU dataset as well as single world (single) and multi-world (multi) approaches. 4.2.1 Synthetic question-answer pairs (SynthQA) Based on human segmentations (HumanSeg, 37 classes) (1st and 2nd rows in Table 3) uses automatically generated questions (we use templates shown in Table 2) and human segmentations. We have generated 20 training and 40 test question-answer pairs per template category, in total 140 training and 280 test pairs (as an exception negations type 1 and 2 have 10 training and 20 test examples each). This experiment shows how the architecture generalizes across similar type of questions provided that we have human annotation of the image segments. We have further removed negations of type 3 in the experiments as they have turned out to be particularly computationally demanding. Performance increases hereby from 56% to 59.9% with about 80% training Accuracy. Since some incorrect derivations give correct answers, the semantic parser learns wrong associations. Other difficulties stem from the limited training data and unseen object categories during training. Based on automatic segmentations (AutoSeg, 37 classes, single) (3rd row in Table 3) tests the architecture based on uncertain facts obtained from automatic semantic segmentation [15] where the 6 most likely object labels are used to create a single world. Here, we are experiencing a severe drop in performance from 59.9% to 11.25% by switching from human to automatic segmentation. Note that there are only 37 classes available to us. This result suggests that the vision part is a serious bottleneck of the whole architecture. Based on automatic segmentations using multi-world approach (AutoSeg, 37 classes, multi) (4th row in Table 3) shows the benefits of using our multiple worlds approach to predict the answer. Here we recover part of the lost performance by an explicit treatment of the uncertainty in the segmentations. Performance increases from 11.25% to 13.75%. 4.3 Human question-answer pairs (HumanQA) Based on human segmentations 894 classes (HumanSeg, 894 classes) (1st row in Table 4) switching to human generated question-answer pairs. The increase in complexity is twofold. First, the human annotations exhibit more variations than the synthetic approach based on templates. Second, the questions are typically longer and include more spatially related objects. Figure 4 shows a few samples from our dataset that highlights challenges including complex and nested spatial reference and use of reference frames. We yield an accuracy of 7.86% in this scenario. As argued above, we also evaluate the experiments on the human data under the softer WUPS scores given different thresholds (Table 4 and Figure 5). In order to put these numbers in perspective, we also show performance numbers for two simple methods: predicting the most popular answer yields 4.4% Accuracy, and our untrained architecture gives 0.18% and 1.3% Accuracy and WUPS (at 0.9). Based on human segmentations 37 classes (HumanSeg, 37 classes) (2nd row in Table 4) uses human segmentation and question-answer pairs. Since only 37 classes are supported by our automatic segmentation algorithm, we run on a subset of the whole dataset. We choose the 25 test images yielding a total of 286 question answer pairs for the following experiments. This yields 12.47% and 15.89% Accuracy and WUPS at 0.9 respectively. Based on automatic segmentations (AutoSeg, 37 classes) (3rd row in Table 4) Switching from the human segmentations to the automatic yields again a drop from 12.47% to 9.69% in Accuracy and we observe a similar trend for the whole spectrum of the WUPS scores. Based on automatic segmentations using multi-world approach (AutoSeg, 37 classes, multi) (4th row in Table 4) Similar to the synthetic experiments our proposed multi-world approach yields an improvement across all the measure that we investigate. Human baseline (5th and 6th rows in Table 4 for 894 and 37 classes) shows human predictions on our dataset. We ask independent annotators to provide answers on the questions we have collected. They are instructed to answer with a number, basic colors [16], or objects (from 37 or 894 categories) or set of those. This performance gives a practical upper bound for the question-answering algorithms with an accuracy of 60.27% for the 37 class case and 50.20% for the 894 class case. We also ask to compare the answers of the AutoSeg single world approach with HumanSeg single world and AutoSeg multi-worlds methods. We use a two-sided binomial test to check if difference in preferences is statistically significant. As a result AutoSeg single world is the least preferred method with the p-value below 0.01 in both cases. Hence the human preferences are aligned with our accuracy measures in Table 4. 4.4 Qualitative results We choose examples in Fig. 6 to illustrate different failure cases - including last example where all methods fail. Since our multi-world approach generates different sets of facts about the perceived worlds, we observe a trend towards a better representation of high level concepts like ’counting’ (leftmost the figure) as well as language associations. A substantial part of incorrect answers is attributed to missing segments, e.g. no pillow detection in third example in Fig. 6. 5 Summary We propose a system and a dataset for question answering about real-world scenes that is reminiscent of a visual turing test. Despite the complexity in uncertain visual perception, language understanding and program induction, our results indicate promising progress in this direction. We bring ideas together from automatic scene analysis, semantic parsing with symbolic reasoning, and combine them under a multi-world approach. As we have mature techniques in machine learning, computer vision, natural language processing and deduction at our disposal, it seems timely to bring these disciplines together on this open challenge. 7 QA: (what is beneath the candle holder, decorative plate)! Some annotators use variations on spatial relations that are similar, e.g. ‘beneath’ is closely related to ‘below’.! ! QA: (what is in front of the wall divider?, cabinet)
 Annotators use additional properties to clarify object references (i.e. wall divider). Moreover, the perspective plays an important role in these spatial relations interpretations. QA1:(How many doors are in the image?, 1)! QA2:(How many doors are in the image?, 5)! Different interpretation of ‘door’ results in different counts: 1 door at the end of the hall 
 vs. 5 doors including lockers ! QA: (what is behind the table?, sofa)! Spatial relations exhibit different reference frames. Some annotations use observercentric, others object-centric view! QA: (how many lights are on?, 6)! Moreover, some questions require detection of states ‘light on or off’
 Q: what is at the back side of the sofas?! Annotators use wide range spatial relations, such as ‘backside’ which is object-centric. QA1: (what is in front of the curtain behind the armchair?, guitar)! ! QA2: (what is in front of the curtain?, guitar)! ! Spatial relations matter more in complex environments where reference resolution becomes more relevant. In cluttered scenes, pragmatism starts playing a more important role The annotators are using different names to call the same things. The names of the brown object near the bed include ‘night stand’, ‘stool’, and ‘cabinet’. Some objects, like the table on the left of image, are severely occluded or truncated. Yet, the annotators refer to them in the questions. QA: (What is behind the table?, window)! Spatial relation like ‘behind’ are dependent on the reference frame. Here the annotator uses observer-centric view.! QA: (How many drawers are there?, 8)! The annotators use their common-sense knowledge for amodal completion. Here the annotator infers the 8th drawer from the context QA: (What is the object on the counter in the corner?, microwave)! References like ‘corner’ are difficult to resolve given current computer vision models. Yet such scene features are frequently used by humans.! QA: (How many doors are open?, 1)! Notion of states of object (like open) is not well captured by current vision techniques. Annotators use such attributes frequently for disambiguation.! QA: (What is the shape of the green chair?, horse shaped)! In this example, an annotator refers to a “horse shaped chair” which requires a quite abstract reasoning about the shapes.! QA: (Where is oven?, on the right side of refrigerator)! On some occasions, the annotators prefer to use more complex responses. With spatial relations, we can increase the answer’s precision.! QA: (What is in front of toilet?, door)! Here the ‘open door’ to the restroom is not clearly visible, yet captured by the annotator.! Figure 4: Examples of human generated question-answer pairs illustrating the associated challenges. In the descriptions we use following notation: ’A’ - answer, ’Q’ - question, ’QA’ - question-answer pair. Last two examples (bottom-right column) are from the extended dataset not used in our experiments. ● ● ● ● ● ● ● ● ● ● ● 0.0 0.2 0.4 0.6 0.8 Threshold WUPS ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● HumanQA 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 HumanSeg, Single, 894 HumanSeg, Single, 37 AutoSeg, Single, 37 AutoSeg, Multi, 37 Human Baseline, 894 Human Baseline, 37 Figure 5: WUPS scores for different thresholds. synthetic question-answer pairs (SynthQA) Segmentation World(s) # classes Accuracy HumanSeg Single with Neg. 3 37 56.0% HumanSeg Single 37 59.5% AutoSeg Single 37 11.25% AutoSeg Multi 37 13.75% Table 3: Accuracy results for the experiments with synthetic question-answer pairs. Human question-answer pairs (HumanQA) Segmentation World(s) #classes Accuracy WUPS at 0.9 WUPS at 0 HumanSeg Single 894 7.86% 11.86% 38.79% HumanSeg Single 37 12.47% 16.49% 50.28% AutoSeg Single 37 9.69% 14.73% 48.57% AutoSeg Multi 37 12.73% 18.10% 51.47% Human Baseline 894 50.20% 50.82% 67.27% Human Baseline 37 60.27% 61.04% 78.96% Table 4: Accuracy and WUPS scores for the experiments with human question-answer pairs. We show WUPS scores at two opposite sides of the WUPS spectrum. Q: What is on the right side of the table?! H: chair
 M: window, floor, wall! C: floor Q: How many red chairs are there?! H: ()! M: 6! C: blinds! ! Q: How many chairs are at the table?! H: wall
 M: 4! C: chair Q: What is the object on the chair?! H: pillow! M: floor, wall! C: wall Q: What is on the right side of cabinet?! H: picture
 M: bed! C: bed Q: What is on the wall?! H: mirror! M: bed! C: picture Q: What is behind the television?! H: lamp
 M: brown, pink, purple! C: picture Q: What is in front of television?! H: pillow! M: chair! C: picture Figure 6: Questions and predicted answers. Notation: ’Q’ - question, ’H’ - architecture based on human segmentation, ’M’ - architecture with multiple worlds, ’C’ - most confident architecture, ’()’ - no answer. Red color denotes correct answer. 8 References [1] Liang, P., Jordan, M.I., Klein, D.: Learning dependency-based compositional semantics. Computational Linguistics (2013) [2] Kwiatkowski, T., Zettlemoyer, L., Goldwater, S., Steedman, M.: Inducing probabilistic ccg grammars from logical form with higher-order unification. In: EMNLP. (2010) [3] Zettlemoyer, L.S., Collins, M.: Online learning of relaxed ccg grammars for parsing to logical form. In: EMNLP-CoNLL-2007. (2007) [4] Matuszek, C., Fitzgerald, N., Zettlemoyer, L., Bo, L., Fox, D.: A joint model of language and perception for grounded attribute learning. In: ICML. (2012) [5] Krishnamurthy, J., Kollar, T.: Jointly learning to parse and perceive: Connecting natural language to the physical world. TACL (2013) [6] Silberman, N., Hoiem, D., Kohli, P., Fergus, R.: Indoor segmentation and support inference from rgbd images. In: ECCV. (2012) [7] Kong, C., Lin, D., Bansal, M., Urtasun, R., Fidler, S.: What are you talking about? text-toimage coreference. In: CVPR. (2014) [8] Karpathy, A., Joulin, A., Fei-Fei, L.: Deep fragment embeddings for bidirectional image sentence mapping. In: NIPS. (2014) [9] Matuszek, C., Herbst, E., Zettlemoyer, L., Fox, D.: Learning to parse natural language commands to a robot control system. In: Experimental Robotics. (2013) [10] Levit, M., Roy, D.: Interpretation of spatial language in a map navigation task. Systems, Man, and Cybernetics, Part B: Cybernetics, IEEE Transactions on (2007) [11] Vogel, A., Jurafsky, D.: Learning to follow navigational directions. In: ACL. (2010) [12] Tellex, S., Kollar, T., Dickerson, S., Walter, M.R., Banerjee, A.G., Teller, S.J., Roy, N.: Understanding natural language commands for robotic navigation and mobile manipulation. In: AAAI. (2011) [13] Kruijff, G.J.M., Zender, H., Jensfelt, P., Christensen, H.I.: Situated dialogue and spatial organization: What, where... and why. IJARS (2007) [14] Wick, M., McCallum, A., Miklau, G.: Scalable probabilistic databases with factor graphs and mcmc. In: VLDB. (2010) [15] Gupta, S., Arbelaez, P., Malik, J.: Perceptual organization and recognition of indoor scenes from rgb-d images. In: CVPR. (2013) [16] Van De Weijer, J., Schmid, C., Verbeek, J.: Learning color names from real-world images. In: CVPR. (2007) [17] Regier, T., Carlson, L.A.: Grounding spatial language in perception: an empirical and computational investigation. Journal of Experimental Psychology: General (2001) [18] Lan, T., Yang, W., Wang, Y., Mori, G.: Image retrieval with structured object queries using latent ranking svm. In: ECCV. (2012) [19] Guadarrama, S., Riano, L., Golland, D., Gouhring, D., Jia, Y., Klein, D., Abbeel, P., Darrell, T.: Grounding spatial relations for human-robot interaction. In: IROS. (2013) [20] Manning, C.D., Raghavan, P., Sch¨utze, H.: Introduction to information retrieval. Cambridge university press Cambridge (2008) [21] Tukey, J.W.: Exploratory data analysis. (1977) [22] Zadeh, L.A.: Fuzzy sets. Information and control (1965) [23] Wu, Z., Palmer, M.: Verbs semantics and lexical selection. In: ACL. (1994) [24] Guadarrama, S., Krishnamoorthy, N., Malkarnenkar, G., Mooney, R., Darrell, T., Saenko, K.: Youtube2text: Recognizing and describing arbitrary activities using semantic hierarchies and zero-shot recognition. In: ICCV. (2013) [25] Miller, G.A.: Wordnet: a lexical database for english. CACM (1995) [26] Fellbaum, C.: WordNet. Wiley Online Library (1999) 9
2014
340
5,448
Semi-supervised Learning with Deep Generative Models Diederik P. Kingma∗, Danilo J. Rezende†, Shakir Mohamed†, Max Welling∗ ∗Machine Learning Group, Univ. of Amsterdam, {D.P.Kingma, M.Welling}@uva.nl †Google Deepmind, {danilor, shakir}@google.com Abstract The ever-increasing size of modern data sets combined with the difficulty of obtaining label information has made semi-supervised learning one of the problems of significant practical importance in modern data analysis. We revisit the approach to semi-supervised learning with generative models and develop new models that allow for effective generalisation from small labelled data sets to large unlabelled ones. Generative approaches have thus far been either inflexible, inefficient or non-scalable. We show that deep generative models and approximate Bayesian inference exploiting recent advances in variational methods can be used to provide significant improvements, making generative approaches highly competitive for semi-supervised learning. 1 Introduction Semi-supervised learning considers the problem of classification when only a small subset of the observations have corresponding class labels. Such problems are of immense practical interest in a wide range of applications, including image search (Fergus et al., 2009), genomics (Shi and Zhang, 2011), natural language parsing (Liang, 2005), and speech analysis (Liu and Kirchhoff, 2013), where unlabelled data is abundant, but obtaining class labels is expensive or impossible to obtain for the entire data set. The question that is then asked is: how can properties of the data be used to improve decision boundaries and to allow for classification that is more accurate than that based on classifiers constructed using the labelled data alone. In this paper we answer this question by developing probabilistic models for inductive and transductive semi-supervised learning by utilising an explicit model of the data density, building upon recent advances in deep generative models and scalable variational inference (Kingma and Welling, 2014; Rezende et al., 2014). Amongst existing approaches, the simplest algorithm for semi-supervised learning is based on a self-training scheme (Rosenberg et al., 2005) where the the model is bootstrapped with additional labelled data obtained from its own highly confident predictions; this process being repeated until some termination condition is reached. These methods are heuristic and prone to error since they can reinforce poor predictions. Transductive SVMs (TSVM) (Joachims, 1999) extend SVMs with the aim of max-margin classification while ensuring that there are as few unlabelled observations near the margin as possible. These approaches have difficulty extending to large amounts of unlabelled data, and efficient optimisation in this setting is still an open problem. Graph-based methods are amongst the most popular and aim to construct a graph connecting similar observations; label information propagates through the graph from labelled to unlabelled nodes by finding the minimum energy (MAP) configuration (Blum et al., 2004; Zhu et al., 2003). Graph-based approaches are sensitive to the graph structure and require eigen-analysis of the graph Laplacian, which limits the scale to which these methods can be applied – though efficient spectral methods are now available (Fergus et al., 2009). Neural network-based approaches combine unsupervised and supervised learning For an updated version of this paper, please see http://arxiv.org/abs/1406.5298 1 by training feed-forward classifiers with an additional penalty from an auto-encoder or other unsupervised embedding of the data (Ranzato and Szummer, 2008; Weston et al., 2012). The Manifold Tangent Classifier (MTC) (Rifai et al., 2011) trains contrastive auto-encoders (CAEs) to learn the manifold on which the data lies, followed by an instance of TangentProp to train a classifier that is approximately invariant to local perturbations along the manifold. The idea of manifold learning using graph-based methods has most recently been combined with kernel (SVM) methods in the Atlas RBF model (Pitelis et al., 2014) and provides amongst most competitive performance currently available. In this paper, we instead, choose to exploit the power of generative models, which recognise the semi-supervised learning problem as a specialised missing data imputation task for the classification problem. Existing generative approaches based on models such as Gaussian mixture or hidden Markov models (Zhu, 2006), have not been very successful due to the need for a large number of mixtures components or states to perform well. More recent solutions have used non-parametric density models, either based on trees (Kemp et al., 2003) or Gaussian processes (Adams and Ghahramani, 2009), but scalability and accurate inference for these approaches is still lacking. Variational approximations for semi-supervised clustering have also been explored previously (Li et al., 2009; Wang et al., 2009). Thus, while a small set of generative approaches have been previously explored, a generalised and scalable probabilistic approach for semi-supervised learning is still lacking. It is this gap that we address through the following contributions: • We describe a new framework for semi-supervised learning with generative models, employing rich parametric density estimators formed by the fusion of probabilistic modelling and deep neural networks. • We show for the first time how variational inference can be brought to bear upon the problem of semi-supervised classification. In particular, we develop a stochastic variational inference algorithm that allows for joint optimisation of both model and variational parameters, and that is scalable to large datasets. • We demonstrate the performance of our approach on a number of data sets providing stateof-the-art results on benchmark problems. • We show qualitatively generative semi-supervised models learn to separate the data classes (content types) from the intra-class variabilities (styles), allowing in a very straightforward fashion to simulate analogies of images on a variety of datasets. 2 Deep Generative Models for Semi-supervised Learning We are faced with data that appear as pairs (X, Y) = {(x1, y1), . . . , (xN, yN)}, with the i-th observation xi ∈RD and the corresponding class label yi ∈{1, . . . , L}. Observations will have corresponding latent variables, which we denote by zi. We will omit the index i whenever it is clear that we are referring to terms associated with a single data point. In semi-supervised classification, only a subset of the observations have corresponding class labels; we refer to the empirical distribution over the labelled and unlabelled subsets as epl(x, y) and epu(x), respectively. We now develop models for semi-supervised learning that exploit generative descriptions of the data to improve upon the classification performance that would be obtained using the labelled data alone. Latent-feature discriminative model (M1): A commonly used approach is to construct a model that provides an embedding or feature representation of the data. Using these features, a separate classifier is thereafter trained. The embeddings allow for a clustering of related observations in a latent feature space that allows for accurate classification, even with a limited number of labels. Instead of a linear embedding, or features obtained from a regular auto-encoder, we construct a deep generative model of the data that is able to provide a more robust set of latent features. The generative model we use is: p(z) = N(z|0, I); pθ(x|z) = f(x; z, θ), (1) where f(x; z, θ) is a suitable likelihood function (e.g., a Gaussian or Bernoulli distribution) whose probabilities are formed by a non-linear transformation, with parameters θ, of a set of latent variables z. This non-linear transformation is essential to allow for higher moments of the data to be captured by the density model, and we choose these non-linear functions to be deep neural networks. 2 Approximate samples from the posterior distribution over the latent variables p(z|x) are used as features to train a classifier that predicts class labels y, such as a (transductive) SVM or multinomial regression. Using this approach, we can now perform classification in a lower dimensional space since we typically use latent variables whose dimensionality is much less than that of the observations. These low dimensional embeddings should now also be more easily separable since we make use of independent latent Gaussian posteriors whose parameters are formed by a sequence of non-linear transformations of the data. This simple approach results in improved performance for SVMs, and we demonstrate this in section 4. Generative semi-supervised model (M2): We propose a probabilistic model that describes the data as being generated by a latent class variable y in addition to a continuous latent variable z. The data is explained by the generative process: p(y) = Cat(y|π); p(z) = N(z|0, I); pθ(x|y, z) = f(x; y, z, θ), (2) where Cat(y|π) is the multinomial distribution, the class labels y are treated as latent variables if no class label is available and z are additional latent variables. These latent variables are marginally independent and allow us, in case of digit generation for example, to separate the class specification from the writing style of the digit. As before, f(x; y, z, θ) is a suitable likelihood function, e.g., a Bernoulli or Gaussian distribution, parameterised by a non-linear transformation of the latent variables. In our experiments, we choose deep neural networks as this non-linear function. Since most labels y are unobserved, we integrate over the class of any unlabelled data during the inference process, thus performing classification as inference. Predictions for any missing labels are obtained from the inferred posterior distribution pθ(y|x). This model can also be seen as a hybrid continuous-discrete mixture model where the different mixture components share parameters. Stacked generative semi-supervised model (M1+M2): We can combine these two approaches by first learning a new latent representation z1 using the generative model from M1, and subsequently learning a generative semi-supervised model M2, using embeddings from z1 instead of the raw data x. The result is a deep generative model with two layers of stochastic variables: pθ(x, y, z1, z2) = p(y)p(z2)pθ(z1|y, z2)pθ(x|z1), where the priors p(y) and p(z2) equal those of y and z above, and both pθ(z1|y, z2) and pθ(x|z1) are parameterised as deep neural networks. 3 Scalable Variational Inference 3.1 Lower Bound Objective In all our models, computation of the exact posterior distribution is intractable due to the nonlinear, non-conjugate dependencies between the random variables. To allow for tractable and scalable inference and parameter learning, we exploit recent advances in variational inference (Kingma and Welling, 2014; Rezende et al., 2014). For all the models described, we introduce a fixed-form distribution qφ(z|x) with parameters φ that approximates the true posterior distribution p(z|x). We then follow the variational principle to derive a lower bound on the marginal likelihood of the model – this bound forms our objective function and ensures that our approximate posterior is as close as possible to the true posterior. We construct the approximate posterior distribution qφ(·) as an inference or recognition model, which has become a popular approach for efficient variational inference (Dayan, 2000; Kingma and Welling, 2014; Rezende et al., 2014; Stuhlm¨uller et al., 2013). Using an inference network, we avoid the need to compute per data point variational parameters, but can instead compute a set of global variational parameters φ. This allows us to amortise the cost of inference by generalising between the posterior estimates for all latent variables through the parameters of the inference network, and allows for fast inference at both training and testing time (unlike with VEM, in which we repeat the generalized E-step optimisation for every test data point). An inference network is introduced for all latent variables, and we parameterise them as deep neural networks whose outputs form the parameters of the distribution qφ(·). For the latent-feature discriminative model (M1), we use a Gaussian inference network qφ(z|x) for the latent variable z. For the generative semi-supervised model (M2), we introduce an inference model for each of the latent variables z and y, which we we assume has a factorised form qφ(z, y|x) = qφ(z|x)qφ(y|x), specified as Gaussian and multinomial distributions respectively. M1: qφ(z|x) = N(z|µφ(x), diag(σ2 φ(x))), (3) M2: qφ(z|y, x) = N(z|µφ(y, x), diag(σ2 φ(x))); qφ(y|x) = Cat(y|πφ(x)), (4) 3 where σφ(x) is a vector of standard deviations, πφ(x) is a probability vector, and the functions µφ(x), σφ(x) and πφ(x) are represented as MLPs. 3.1.1 Latent Feature Discriminative Model Objective For this model, the variational bound J (x) on the marginal likelihood for a single data point is: log pθ(x) ≥Eqφ(z|x) [log pθ(x|z)] −KL[qφ(z|x)∥pθ(z)] = −J (x), (5) The inference network qφ(z|x) (3) is used during training of the model using both the labelled and unlabelled data sets. This approximate posterior is then used as a feature extractor for the labelled data set, and the features used for training the classifier. 3.1.2 Generative Semi-supervised Model Objective For this model, we have two cases to consider. In the first case, the label corresponding to a data point is observed and the variational bound is a simple extension of equation (5): log pθ(x, y)≥Eqφ(z|x,y) [log pθ(x|y, z) + log pθ(y) + log p(z) −log qφ(z|x, y)]=−L(x, y), (6) For the case where the label is missing, it is treated as a latent variable over which we perform posterior inference and the resulting bound for handling data points with an unobserved label y is: log pθ(x) ≥Eqφ(y,z|x) [log pθ(x|y, z) + log pθ(y) + log p(z) −log qφ(y, z|x)] = X y qφ(y|x)(−L(x, y)) + H(qφ(y|x)) = −U(x). (7) The bound on the marginal likelihood for the entire dataset is now: J = X (x,y)∼epl L(x, y) + X x∼epu U(x) (8) The distribution qφ(y|x) (4) for the missing labels has the form a discriminative classifier, and we can use this knowledge to construct the best classifier possible as our inference model. This distribution is also used at test time for predictions of any unseen data. In the objective function (8), the label predictive distribution qφ(y|x) contributes only to the second term relating to the unlabelled data, which is an undesirable property if we wish to use this distribution as a classifier. Ideally, all model and variational parameters should learn in all cases. To remedy this, we add a classification loss to (8), such that the distribution qφ(y|x) also learns from labelled data. The extended objective function is: J α = J + α · Eepl(x,y) [−log qφ(y|x)] , (9) where the hyper-parameter α controls the relative weight between generative and purely discriminative learning. We use α = 0.1·N in all experiments. While we have obtained this objective function by motivating the need for all model components to learn at all times, the objective 9 can also be derived directly using the variational principle by instead performing inference over the parameters π of the categorical distribution, using a symmetric Dirichlet prior over these parameterss. 3.2 Optimisation The bounds in equations (5) and (9) provide a unified objective function for optimisation of both the parameters θ and φ of the generative and inference models, respectively. This optimisation can be done jointly, without resort to the variational EM algorithm, by using deterministic reparameterisations of the expectations in the objective function, combined with Monte Carlo approximation – referred to in previous work as stochastic gradient variational Bayes (SGVB) (Kingma and Welling, 2014) or as stochastic backpropagation (Rezende et al., 2014). We describe the core strategy for the latent-feature discriminative model M1, since the same computations are used for the generative semi-supervised model. When the prior p(z) is a spherical Gaussian distribution p(z) = N(z|0, I) and the variational distribution qφ(z|x) is also a Gaussian distribution as in (3), the KL term in equation (5) can be computed 4 Algorithm 1 Learning in model M1 while generativeTraining() do D ←getRandomMiniBatch() zi ∼qφ(zi|xi) ∀xi ∈D J ←P n J (xi) (gθ, gφ) ←( ∂J ∂θ , ∂J ∂φ ) (θ, φ) ←(θ, φ) + Γ(gθ, gφ) end while while discriminativeTraining() do D ←getLabeledRandomMiniBatch() zi ∼qφ(zi|xi) ∀{xi, yi} ∈D trainClassifier({zi, yi} ) end while Algorithm 2 Learning in model M2 while training() do D ←getRandomMiniBatch() yi ∼qφ(yi|xi) ∀{xi, yi} /∈O zi ∼qφ(zi|yi, xi) J α ←eq. (9) (gθ, gφ) ←( ∂Lα ∂θ , ∂Lα ∂φ ) (θ, φ) ←(θ, φ) + Γ(gθ, gφ) end while analytically and the log-likelihood term can be rewritten, using the location-scale transformation for the Gaussian distribution, as: Eqφ(z|x) [log pθ(x|z)] = EN (ϵ|0,I)  log pθ(x|µφ(x) + σφ(x) ⊙ϵ)  , (10) where ⊙indicates the element-wise product. While the expectation (10) still cannot be solved analytically, its gradients with respect to the generative parameters θ and variational parameters φ can be efficiently computed as expectations of simple gradients: ∇{θ,φ}Eqφ(z|x) [log pθ(x|z)] = EN (ϵ|0,I)  ∇{θ,φ} log pθ(x|µφ(x) + σφ(x) ⊙ϵ)  . (11) The gradients of the loss (9) for model M2 can be computed by a direct application of the chain rule and by noting that the conditional bound L(xn, y) contains the same type of terms as the loss (9). The gradients of the latter can then be efficiently estimated using (11) . During optimization we use the estimated gradients in conjunction with standard stochastic gradientbased optimization methods such as SGD, RMSprop or AdaGrad (Duchi et al., 2010). This results in parameter updates of the form: (θt+1, φt+1) ←(θt, φt) + Γt(gt θ, gt φ), where Γ is a diagonal preconditioning matrix that adaptively scales the gradients for faster minimization. The training procedure for models M1 and M2 are summarised in algorithms 1 and 2, respectively. Our experimental results were obtained using AdaGrad. 3.3 Computational Complexity The overall algorithmic complexity of a single joint update of the parameters (θ, φ) for M1 using the estimator (11) is CM1 = MSCMLP where M is the minibatch size used , S is the number of samples of the random variate ϵ, and CMLP is the cost of an evaluation of the MLPs in the conditional distributions pθ(x|z) and qφ(z|x). The cost CMLP is of the form O(KD2) where K is the total number of layers and D is the average dimension of the layers of the MLPs in the model. Training M1 also requires training a supervised classifier, whose algorithmic complexity, if it is a neural net, it will have a complexity of the form CMLP . The algorithmic complexity for M2 is of the form CM2 = LCM1, where L is the number of labels and CM1 is the cost of evaluating the gradients of each conditional bound Jy(x), which is the same as for M1. The stacked generative semi-supervised model has an algorithmic complexity of the form CM1 +CM2. But with the advantage that the cost CM2 is calculated in a low-dimensional space (formed by the latent variables of the model M1 that provides the embeddings). These complexities make this approach extremely appealing, since they are no more expensive than alternative approaches based on auto-encoder or neural models, which have the lowest computational complexity amongst existing competitive approaches. In addition, our models are fully probabilistic, allowing for a wide range of inferential queries, which is not possible with many alternative approaches for semi-supervised learning. 5 Table 1: Benchmark results of semi-supervised classification on MNIST with few labels. N NN CNN TSVM CAE MTC AtlasRBF M1+TSVM M2 M1+M2 100 25.81 22.98 16.81 13.47 12.03 8.10 (± 0.95) 11.82 (± 0.25) 11.97 (± 1.71) 3.33 (± 0.14) 600 11.44 7.68 6.16 6.3 5.13 – 5.72 (± 0.049) 4.94 (± 0.13) 2.59 (± 0.05) 1000 10.7 6.45 5.38 4.77 3.64 3.68 (± 0.12) 4.24 (± 0.07) 3.60 (± 0.56) 2.40 (± 0.02) 3000 6.04 3.35 3.45 3.22 2.57 – 3.49 (± 0.04) 3.92 (± 0.63) 2.18 (± 0.04) 4 Experimental Results Open source code, with which the most important results and figures can be reproduced, is available at http://github.com/dpkingma/nips14-ssl. For the latest experimental results, please see http://arxiv.org/abs/1406.5298. 4.1 Benchmark Classification We test performance on the standard MNIST digit classification benchmark. The data set for semisupervised learning is created by splitting the 50,000 training points between a labelled and unlabelled set, and varying the size of the labelled from 100 to 3000. We ensure that all classes are balanced when doing this, i.e. each class has the same number of labelled points. We create a number of data sets using randomised sampling to confidence bounds for the mean performance under repeated draws of data sets. For model M1 we used a 50-dimensional latent variable z. The MLPs that form part of the generative and inference models were constructed with two hidden layers, each with 600 hidden units, using softplus log(1+ex) activation functions. On top, a transductive SVM (TSVM) was learned on values of z inferred with qφ(z|x). For model M2 we also used 50-dimensional z. In each experiment, the MLPs were constructed with one hidden layer, each with 500 hidden units and softplus activation functions. In case of SVHN and NORB, we found it helpful to pre-process the data with PCA. This makes the model one level deeper, and still optimizes a lower bound on the likelihood of the unprocessed data. Table 1 shows classification results. We compare to a broad range of existing solutions in semisupervised learning, in particular to classification using nearest neighbours (NN), support vector machines on the labelled set (SVM), the transductive SVM (TSVM), and contractive auto-encoders (CAE). Some of the best results currently are obtained by the manifold tangent classifier (MTC) (Rifai et al., 2011) and the AtlasRBF method (Pitelis et al., 2014). Unlike the other models in this comparison, our models are fully probabilistic but have a cost in the same order as these alternatives. Results: The latent-feature discriminative model (M1) performs better than other models based on simple embeddings of the data, demonstrating the effectiveness of the latent space in providing robust features that allow for easier classification. By combining these features with a classification mechanism directly in the same model, as in the conditional generative model (M2), we are able to get similar results without a separate TSVM classifier. However, by far the best results were obtained using the stack of models M1 and M2. This combined model provides accurate test-set predictions across all conditions, and easily outperforms the previously best methods. We also tested this deep generative model for supervised learning with all available labels, and obtain a test-set performance of 0.96%, which is among the best published results for this permutation-invariant MNIST classification task. 4.2 Conditional Generation The conditional generative model can be used to explore the underlying structure of the data, which we demonstrate through two forms of analogical reasoning. Firstly, we demonstrate style and content separation by fixing the class label y, and then varying the latent variables z over a range of values. Figure 1 shows three MNIST classes in which, using a trained model with two latent variables, and the 2D latent variable varied over a range from -5 to 5. In all cases, we see that nearby regions of latent space correspond to similar writing styles, independent of the class; the left region represents upright writing styles, while the right-side represents slanted styles. As a second approach, we use a test image and pass it through the inference network to infer a value of the latent variables corresponding to that image. We then fix the latent variables z to this 6 (a) Handwriting styles for MNIST obtained by fixing the class label and varying the 2D latent variable z (b) MNIST analogies (c) SVHN analogies Figure 1: (a) Visualisation of handwriting styles learned by the model with 2D z-space. (b,c) Analogical reasoning with generative semi-supervised models using a high-dimensional z-space. The leftmost columns show images from the test set. The other columns show analogical fantasies of x by the generative model, where the latent variable z of each row is set to the value inferred from the test-set image on the left by the inference network. Each column corresponds to a class label y. Table 2: Semi-supervised classification on the SVHN dataset with 1000 labels. KNN TSVM M1+KNN M1+TSVM M1+M2 77.93 66.55 65.63 54.33 36.02 (± 0.08) (± 0.10) (± 0.15) (± 0.11) (± 0.10) Table 3: Semi-supervised classification on the NORB dataset with 1000 labels. KNN TSVM M1+KNN M1+TSVM 78.71 26.00 65.39 18.79 (± 0.02) (± 0.06) (± 0.09) (± 0.05) value, vary the class label y, and simulate images from the generative model corresponding to that combination of z and y. This again demonstrate the disentanglement of style from class. Figure 1 shows these analogical fantasies for the MNIST and SVHN datasets (Netzer et al., 2011). The SVHN data set is a far more complex data set than MNIST, but the model is able to fix the style of house number and vary the digit that appears in that style well. These generations represent the best current performance in simulation from generative models on these data sets. The model used in this way also provides an alternative model to the stochastic feed-forward networks (SFNN) described by Tang and Salakhutdinov (2013). The performance of our model significantly improves on SFNN, since instead of an inefficient Monte Carlo EM algorithm relying on importance sampling, we are able to perform efficient joint inference that is easy to scale. 4.3 Image Classification We demonstrate the performance of image classification on the SVHN, and NORB image data sets. Since no comparative results in the semi-supervised setting exists, we perform nearest-neighbour and TSVM classification with RBF kernels and compare performance on features generated by our latent-feature discriminative model to the original features. The results are presented in tables 2 and 3, and we again demonstrate the effectiveness of our approach for semi-supervised classification. 7 4.4 Optimization details The parameters were initialized by sampling randomly from N(0, 0.0012I), except for the bias parameters which were initialized as 0. The objectives were optimized using minibatch gradient ascent until convergence, using a variant of RMSProp with momentum and initialization bias correction, a constant learning rate of 0.0003, first moment decay (momentum) of 0.1, and second moment decay of 0.001. For MNIST experiments, minibatches for training were generated by treating normalised pixel intensities of the images as Bernoulli probabilities and sampling binary images from this distribution. In the M2 model, a weight decay was used corresponding to a prior of (θ, φ) ∼N(0, I). 5 Discussion and Conclusion The approximate inference methods introduced here can be easily extended to the model’s parameters, harnessing the full power of variational learning. Such an extension also provides a principled ground for performing model selection. Efficient model selection is particularly important when the amount of available data is not large, such as in semi-supervised learning. For image classification tasks, one area of interest is to combine such methods with convolutional neural networks that form the gold-standard for current supervised classification methods. Since all the components of our model are parametrised by neural networks we can readily exploit convolutional or more general locally-connected architectures – and forms a promising avenue for future exploration. A limitation of the models we have presented is that they scale linearly in the number of classes in the data sets. Having to re-evaluate the generative likelihood for each class during training is an expensive operation. Potential reduction of the number of evaluations could be achieved by using a truncation of the posterior mass. For instance we could combine our method with the truncation algorithm suggested by Pal et al. (2005), or by using mechanisms such as error-correcting output codes (Dietterich and Bakiri, 1995). The extension of our model to multi-label classification problems that is essential for image-tagging is also possible, but requires similar approximations to reduce the number of likelihood-evaluations per class. We have developed new models for semi-supervised learning that allow us to improve the quality of prediction by exploiting information in the data density using generative models. We have developed an efficient variational optimisation algorithm for approximate Bayesian inference in these models and demonstrated that they are amongst the most competitive models currently available for semisupervised learning. We hope that these results stimulate the development of even more powerful semi-supervised classification methods based on generative models, of which there remains much scope. Acknowledgements. We are grateful for feedback from the reviewers. We would also like to thank the SURFFoundation for the use of the Dutch national e-infrastructure for a significant part of the experiments. 8 References Adams, R. P. and Ghahramani, Z. (2009). Archipelago: nonparametric Bayesian semi-supervised learning. In Proceedings of the International Conference on Machine Learning (ICML). Blum, A., Lafferty, J., Rwebangira, M. R., and Reddy, R. (2004). Semi-supervised learning using randomized mincuts. In Proceedings of the International Conference on Machine Learning (ICML). Dayan, P. (2000). Helmholtz machines and wake-sleep learning. Handbook of Brain Theory and Neural Network. MIT Press, Cambridge, MA, 44(0). Dietterich, T. G. and Bakiri, G. (1995). Solving multiclass learning problems via error-correcting output codes. arXiv preprint cs/9501101. Duchi, J., Hazan, E., and Singer, Y. (2010). Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12:2121–2159. Fergus, R., Weiss, Y., and Torralba, A. (2009). Semi-supervised learning in gigantic image collections. In Advances in Neural Information Processing Systems (NIPS). Joachims, T. (1999). Transductive inference for text classification using support vector machines. In Proceeding of the International Conference on Machine Learning (ICML), volume 99, pages 200–209. Kemp, C., Griffiths, T. L., Stromsten, S., and Tenenbaum, J. B. (2003). Semi-supervised learning with trees. In Advances in Neural Information Processing Systems (NIPS). Kingma, D. P. and Welling, M. (2014). Auto-encoding variational Bayes. In Proceedings of the International Conference on Learning Representations (ICLR). Li, P., Ying, Y., and Campbell, C. (2009). A variational approach to semi-supervised clustering. In Proceedings of the European Symposium on Artificial Neural Networks (ESANN), pages 11 – 16. Liang, P. (2005). Semi-supervised learning for natural language. PhD thesis, Massachusetts Institute of Technology. Liu, Y. and Kirchhoff, K. (2013). Graph-based semi-supervised learning for phone and segment classification. In Proceedings of Interspeech. Netzer, Y., Wang, T., Coates, A., Bissacco, A., Wu, B., and Ng, A. Y. (2011). Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning. Pal, C., Sutton, C., and McCallum, A. (2005). Fast inference and learning with sparse belief propagation. In Advances in Neural Information Processing Systems (NIPS). Pitelis, N., Russell, C., and Agapito, L. (2014). Semi-supervised learning using an unsupervised atlas. In Proceddings of the European Conference on Machine Learning (ECML), volume LNCS 8725, pages 565 – 580. Ranzato, M. and Szummer, M. (2008). Semi-supervised learning of compact document representations with deep networks. In Proceedings of the 25th International Conference on Machine Learning (ICML), pages 792–799. Rezende, D. J., Mohamed, S., and Wierstra, D. (2014). Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the International Conference on Machine Learning (ICML), volume 32 of JMLR W&CP. Rifai, S., Dauphin, Y., Vincent, P., Bengio, Y., and Muller, X. (2011). The manifold tangent classifier. In Advances in Neural Information Processing Systems (NIPS), pages 2294–2302. Rosenberg, C., Hebert, M., and Schneiderman, H. (2005). Semi-supervised self-training of object detection models. In Proceedings of the Seventh IEEE Workshops on Application of Computer Vision (WACV/MOTION’05). Shi, M. and Zhang, B. (2011). Semi-supervised learning improves gene expression-based prediction of cancer recurrence. Bioinformatics, 27(21):3017–3023. Stuhlm¨uller, A., Taylor, J., and Goodman, N. (2013). Learning stochastic inverses. In Advances in neural information processing systems, pages 3048–3056. Tang, Y. and Salakhutdinov, R. (2013). Learning stochastic feedforward neural networks. In Advances in Neural Information Processing Systems (NIPS), pages 530–538. Wang, Y., Haffari, G., Wang, S., and Mori, G. (2009). A rate distortion approach for semi-supervised conditional random fields. In Advances in Neural Information Processing Systems (NIPS), pages 2008–2016. Weston, J., Ratle, F., Mobahi, H., and Collobert, R. (2012). Deep learning via semi-supervised embedding. In Neural Networks: Tricks of the Trade, pages 639–655. Springer. Zhu, X. (2006). Semi-supervised learning literature survey. Technical report, Computer Science, University of Wisconsin-Madison. Zhu, X., Ghahramani, Z., Lafferty, J., et al. (2003). Semi-supervised learning using Gaussian fields and harmonic functions. In Proceddings of the International Conference on Machine Learning (ICML), volume 3, pages 912–919. 9
2014
341
5,449
Biclustering Using Message Passing Luke O’Connor Bioinformatics and Integrative Genomics Harvard University Cambridge, MA 02138 loconnor@g.harvard.edu Soheil Feizi Electrical Engineering and Computer Science Massachusetts Institute of Technology Cambridge, MA 02139 sfeizi@mit.edu Abstract Biclustering is the analog of clustering on a bipartite graph. Existent methods infer biclusters through local search strategies that find one cluster at a time; a common technique is to update the row memberships based on the current column memberships, and vice versa. We propose a biclustering algorithm that maximizes a global objective function using message passing. Our objective function closely approximates a general likelihood function, separating a cluster size penalty term into row- and column-count penalties. Because we use a global optimization framework, our approach excels at resolving the overlaps between biclusters, which are important features of biclusters in practice. Moreover, Expectation-Maximization can be used to learn the model parameters if they are unknown. In simulations, we find that our method outperforms two of the best existing biclustering algorithms, ISA and LAS, when the planted clusters overlap. Applied to three gene expression datasets, our method finds coregulated gene clusters that have high quality in terms of cluster size and density. 1 Introduction The term biclustering has been used to describe several distinct problems variants. In this paper, In this paper, we consider the problem of biclustering as a bipartite analogue of clustering: Given an N × M matrix, a bicluster is a subset of rows that are heavily connected to a subset of columns. In this framework, biclustering methods are data mining techniques allowing simultaneous clustering of the rows and columns of a matrix. We suppose there are two possible distributions for edge weights in the bipartite graph: a within-cluster distribution and a background distribution. Unlike in the traditional clustering problem, in our setup, biclusters may overlap, and a node may not belong to any cluster. We emphasize the distinction between biclustering and the bipartite analog of graph partitioning, which might be called bipartitioning. Biclustering has several noteworthy applications. It has been used to find modules of coregulated genes using microarray gene expression data [1] and to predict tumor phenotypes from their genotypes [2]. It has been used for document classification, clustering both documents and related words simultaneously [3]. In all of these applications, biclusters are expected to overlap with each other, and these overlaps themselves are often of interest (e.g., if one wishes to explore the relationships between document topics). The biclustering problem is NP-hard (see Proposition 1). However, owing to its practical importance, several heuristic methods using local search strategies have been developed. A popular approach is to search for one bicluster at a time by iteratively assigning rows to a bicluster based on the columns, and vice versa. Two algorithms based on this approach are ISA [4] and LAS [5]. Another approach is an exhaustive search for complete bicliques used by Bimax [6]. This approach fragments large noisy clusters into small complete ones. SAMBA [7] uses a heuristic combinatorial search for locally optimal biclusters, motivated by an exhaustive search algorithm that is exponential 1 in the maximum degree of the nodes. For more details about existent biclustering algorithms, and performance comparisons, see references [6] and [8]. Existent biclustering methods have two major shortcomings: first, they apply a local optimality criterion to each bicluster individually. Because a collection of locally optimal biclusters might not be globally optimal, these local methods struggle to resolve overlapping clusters, which arise frequently in many applications. Second, the lack of a well-defined global objective function precludes an analytical characterization of their expected results. Global optimization methods have been developed for problems closely related to biclustering, including clustering. Unlike most biclustering problem formulations, these are mostly partitioning problems: each node is assigned to one cluster or category. Major recent progress has been made in the development of spectral clustering methods (see references [9] and [10]) and message-passing algorithms (see [11], [12] and [13]). In particular, Affinity Propagation [12] maximizes the sum of similarities to one central exemplar instead of overall cluster density. Reference [14] uses variational expectation-maximization to fit the latent block model, which is a binary model in which each row or column is assigned to a row or column cluster, and the probability of an edge is dictated by the respective cluster memberships. Row and column clusters that are not paired to form biclusters. In this paper, we propose a message-passing algorithm that searches for a globally optimal collection of possibly overlapping biclusters. Our method maximizes a likelihood function using an approximation that separates a cluster-size penalty term into a row-count penalty and a columncount penalty. This decoupling enables the messages of the max-sum algorithm to be computed efficiently, effectively breaking an intractable optimization into a pair of tractable ones that can be solved in nearly linear time. When the underlying model parameters are unknown, they can be learned using an expectation-maximization approach. Our approach has several advantages over existing biclustering algorithms: the objective function of our biclustering method has the flexibility to handle diverse statistical models; the max-sum algorithm is a more robust optimization strategy than commonly used iterative approaches; and in particular, our global optimization technique excels at resolving overlapping biclusters. In simulations, our method outperforms two of the best existing biclustering algorithms, ISA and LAS, when the planted clusters overlap. Applied to three gene expression datasets, our method found biclusters of high quality in terms of cluster size and density. 2 Methods 2.1 Problem statement Let G = (V, W, E) be a weighted bipartite graph, with vertices V = (1, ..., N) and W = (1, ..., M), connected by edges with non-negative weights: E : V × W →[0, ∞). Let V1, ..., VK ⊂V and W1, ..., WK ⊂W. Let (Vk, Wk) = {(i, j) : i ∈Vk, j ∈Wk} be a bicluster: Graph edge weights eij are drawn independently from either a within-cluster distribution or a background distribution depending on whether, for some k, i ∈Vk and j ∈Wk. In this paper, we assume that the withincluster and background distributions are homogenous. However, our formulation can be extended to a general case in which the distributions are row- or column-dependent. Let ck ij be the indicator for i ∈Vk and j ∈Wk. Let cij ≜min(1, P k ck ij) and let c ≜(ck ij). Definition 1 (Biclustering Problem). Let G = (V, W, E) be a bipartite graph with biclusters (V1, W1), ..., (VK, WK), within-cluster distribution f1 and background distribution f0. The problem is to find the maximum likelihood cluster assignments (up to reordering): ˆc = arg max c X (i,j) cij log f1(eij) f0(eij), (1) ck ij = ck rs = 1 ⇒ck is = ck rj = 1, ∀i, r ∈V, ∀j, s ∈W. Figure 1 demonstrates the problem qualitatively for an unweighted bipartite graph. In general, the combinatorial nature of a biclustering problem makes it computationally challenging. Proposition 1. The clique problem can be reduced to the maximum likelihood problem of Definition (1). Thus, the biclustering problem is NP-hard. 2 (a) (b) column variables row variables column variables row variables Biclustering Biclustering Figure 1: Biclustering is the analogue of clustering on a bipartite graph. (a) Biclustering allows nodes to be reordered in a manner that reveals modular structures in the bipartite graph. (b) The rows and columns of an adjacency matrix are similarly biclustered and reordered. Proof. Proof is provided in Supplementary Note 1. 2.2 BCMP objective function In this section, we introduce the global objective function considered in the proposed biclustering algorithm called Biclustering using Message Passing (BCMP). This objective function approximates the likelihood function of Definition 1. Let lij = log f1(eij) f0(eij) be the log-likelihood ratio score of tuple (i, j). Thus, the likelihood function of Definition 1 can be written as P cijlij. If there were no consistency constraints in the Optimization (1), an optimal maximum likelihood biclustering solution would be to set cij = 1 for all tuples with positive lij. Our key idea is to enforce the consistency constraints by introducing a cluster-size penalty function and shifting the log-likelihood ratios lij to recoup this penalty. Let Nk and Mk be the number of rows and columns, respectively, assigned to cluster k. We have, X (i,j) cijlij (a) ≈ X (i,j) cij max(0, lij + δ) −δ X (i,j) cij (b) = X (i,j) cij max(0, lij + δ) + δ X (i,j) max(0, −1 + X k ck ij) −δ X k NkMk (c) ≈ X (i,j) cij max(0, lij + δ) + δ X (i,j) max(0, −1 + X k ck ij) −δ 2 X k rkN 2 k + r−1 k M 2 k. (2) The approximation (a) holds when δ is large enough that thresholding lij at −δ has little effect on the resulting objective function. In equation (b), we have expressed the second term of (a) in terms of a cluster size penalty −δNkMk, and we have added back a term corresponding to the overlap between clusters. Because a cluster-size penalty function of the form NkMk leads to an intractable optimization in the max-sum framework, we approximate it using a decoupling approximation (c) where rk is a cluster shape parameter: 2NkMk ≈rkN 2 k + r−1 k M 2 k, (3) when rk ≈Mk/Nk. The cluster-shape parameter can be iteratively tuned to fit the estimated biclusters. Following equation (2), the BCMP objective function can be separated into three terms as follows: 3 F(c) = X i,j τij + X k ηk + X k µk, (4)    τij = ℓij min(1, P k ck ij) + δ max(0, P k ck ij −1) ∀(i, j) ∈V × W, ηk = −δ 2rkN 2 k ∀1 ≤k ≤K, µk = −δ 2r−1 k M 2 k ∀1 ≤k ≤K (5) Here τij, the tuple function, encourages heavier edges of the bipartite graph to be clustered. Its second term compensates for the fact that when biclusters overlap, the cluster-size penalty functions double-count the overlapping regions. ℓij ≜max(0, lij −δ) is the shifted log-likelihood ratio for observed edge weight eij. ηk and µk penalize the number of rows and columns of cluster k, Nk and Mk, respectively. Note that by introducing a penalty for each nonempty cluster, the number of clusters can be learned, and finding weak, spurious clusters can be avoided (see Supplementary Note 3.3). Now, we analyze BCMP over the following model for a binary or unweighted bipartite graph: Definition 2. The binary biclustering model is a generative model for N × M bipartite graph (V, W, E) with K biclusters distributed by uniform sampling with replacement, allowing for overlapping clusters. Within a bicluster, edges are drawn independently with probability p, and outside of a bicluster, they are drawn independently with probability q < p. In the following, we assume that p, q, and K are given. We discuss the case that the model parameters are unknown in Section 2.4. The following proposition shows that optimizing the BCMP objective function solves the problem of Definition 1 in the case of the binary model: Proposition 2. Let (eij) be a matrix generated by the binary model described in Definition 2. Suppose p, q and K are given. Suppose the maximum likelihood assignment of edges to biclusters, arg max(P(data|c)), is unique up to reordering. Let rk = M ′ k/N ′ k be the cluster shape ratio for the k-th maximum likelihood cluster. Then, by using these values of rk, setting ℓij = eij, for all (i, j), with cluster size penalty δ 2 = − log( 1−p 1−q ) 2 log( p(1−q) q(1−p)) , (6) we have, arg max c (P(data|c)) = arg max c (F(c)). (7) Proof. The proof follows the derivation of equation (2). It is presented in Supplementary Note 2. Remark 1. In the special case when q = 1 −p ∈(0, 1/2), according to equation (6), we have δ 2 = 1/4. This is suggested as a reasonable initial value to choose when the true values of p and q are unknown; see Section 2.4 for a discussion of learning the model parameters. The assumption that rk = N ′ k/M ′ k may seem rather strong. However, it is essential as it justifies the decoupling equation (3) that enables a linear-time algorithm. In practice, if the initial choice of rk is close enough to the actual ratio that a cluster is detected corresponding to the real cluster, rk can be tuned to find the true value by iteratively updating it to fit the estimated bicluster. This iterative strategy works well in our simulations. For more details about automatically tuning the parameter rk, see Supplementary Note 3.1. In a more general statistical setting, log-likelihood ratios lij may be unbounded below, and the first step (a) of derivation (2) is an approximation; setting δ arbitrarily large will eventually lead to instability in the message updates. 4 2.3 Biclustering Using Message Passing In this section, we use the max-sum algorithm to optimize the objective function of equation (4). For a review of the max-sum message update rules, see Supplementary Note 4. There are NM function nodes for the functions τij, K function nodes for the functions ηk, and K function nodes for the functions µk. There are NMK binary variables, each attached to three function nodes: ck ij is attached to τij, ηk, and µk (see Supplementary Figure 1). The incoming messages from these function nodes are named tk ij, nk ij, and mk ij, respectively. In the following, we describe messages for ck ij = c1 12; other messages can be computed similarly. First, we compute t1 12: t1 12(x) (a) = max c2 12,...,cK 12 [τ12(x, c2 12, . . . , cK 12) + X k̸=1 mk 12(ck 12) + nk 12(ck 12)] (8) (b) = max c2 12,...,cK 12 [ℓ12 min(1, X k ck 12) + δ max(0, X k ck 12 −1) + X k̸=1 ck 12(mk 12 + nk 12)] + d1 where d1 = P k̸=1 mk 12(0)+nk 12(0) is a constant. Equality (a) comes from the definition of messages according to equation (6) in the Supplement. Equality (b) uses the definition of τ12 of equation (5) and the definition of the scalar message of equation (8) in the Supplement. We can further simplify t12 as follows:        t1 12(1) −d1 (c) = ℓ12 + P k̸=1 max(0, δ + mk 12 + nk 12), t1 12(0) −d1 (d) = ℓ12 −δ + P k̸=1 max(0, δ + mk 12 + nk 12), if ∃k, nk 12 + mk 12 + δ > 0, t1 12(0) −d1 (e) = max(0, ℓ12 + maxk̸=1(mk 12 + nk 12)), otherwise . (9) If c1 12 = 1, we have min(1, P k ck 12) = 1, and max(0, P k ck 12 −1) = P k̸=1 ck 12. These lead to equality (c). A similar argument can be made if c1 12 = 0 but there exists a k such that nk 12+mk 12+δ > 0. This leads to equality (d). If c1 12 = 0 and there is no k such that nk 12 + mk 12 + δ > 0, we compare the increase obtained by letting ck 12 = 1 (i.e., ℓ12) with the penalty (i.e., mk 12 + nk 12), for the best k. This leads to equality (e). Remark 2. Computation of t1 ij, ..., tk ij using equality (d) costs O(K), and not O(K2), as the summation need only be computed once. Messages m1 12 and n1 12 are computed as follows: ( m1 12(x) = maxc1|c1 12=x [µ1(c1) + P (i,j)̸=(1,2) t1 ij(c1 ij) + n1 ij(c1 ij)], n1 12(x) = maxc1|c1 12=x [η1(c1) + P (i,j)̸=(1,2) t1 ij(c1 ij) + m1 ij(c1 ij)], (10) where c1 = {c1 ij : i ∈V, j ∈W}. To compute n1 12 in constant time, we perform a preliminary optimization, ignoring the effect of edge (1, 2): arg max c1 −δ 2N 2 1 + X (i,j) t1 ij(c1 ij) + m1 ij(c1 ij). (11) Let si = PM j=1 max(0, m1 ij + t1 ij) be the sum of positive incoming messages of row i. The function η1 penalizes the number of rows containing some nonzero c1 ij: if any message along that row is included, there is no additional penalty for including every positive message along that row. Thus, optimization (11) is computed by deciding which rows to include. This can be done efficiently through sorting: we sort row sums s(1), ..., s(N) at a cost of O(N log N). Then we proceed from largest to smallest, including row (N + 1 −i) if the marginal penalty δ 2(i2 −(i −1)2) = δ 2(2i −1) is less than s(N+1−i). After solving optimization (11), the messages n1 12, ..., n1 N2 can be computed in linear time, as we explain in Supplementary Note 5. Remark 3. Computation of nk ij through sorting costs O(N log N). Proposition 3 (Computational Complexity of BCMP). The computational complexity of BCMP over a bipartite graph with N rows, M columns, and K clusters is O(K(N +log M)(M +log N)). 5 Proof. For each iteration, there are NM messages tij to be computed at cost O(K) each. Before computing (nk ij), there are K sorting steps at a cost of O(M log M), after which each message may be computed in constant time. Likewise, there are K sorting steps at a cost of O(N log N) each before computing (mk ij). We provide an empirical runtime example of the algorithm in Supplementary Figure 3. 2.4 Parameter learning using Expectation-Maximization In the BCMP objective function described in Section 2.2, the parameters of the generative model were used to compute the log-likelihood ratios (lij). In practice, however, these parameters may be unknown. Expectation-Maximization (EM) can be used to estimate these parameters. The use of EM in this setting is slightly unorthodox, as we estimate the hidden labels (cluster assignments) in the M step instead of the E step. However, the distinction between parameters and labels is not intrinsic in the definition of EM [15] and the true ML solution is still guaranteed to be a fixed point of the iterative process. Note that it is possible that the EM iterative procedure leads to a locally optimal solution and therefore it is recommended to use several random re-initializations for the method. The EM algorithm has three steps: • Initialization: We choose initial values for the underlying model parameters θ and compute the log-likelihood ratios (lij) based on these values, denoting by F0 the initial objective function. • M step: We run BCMP to maximize the objective Fi(c). We denote the estimated cluster assignments by by ˆci . • E step: We compute the expected-log-likelihood function as follows: Fi+1(c) = Eθ[log P((eij)|θ)|c = ˆci] = X (i,j) Eθ[log P(eij|θ)|c = ˆci]. (12) Conveniently, the expected-likelihood function takes the same form as the original likelihood function, with an input matrix of expected log-likelihood ratios. These can be computed efficiently if conjugate priors are available for the parameters. Therefore, BCMP can be used to maximize Fi+1. The algorithm terminates upon failure to improve the estimated likelihood Fi( ˆci). For a discussion of the application of EM to the binary and Gaussian models, see Supplementary Note 6. In the case of the binary model, we use uniform Beta distributions as conjugate priors for p and q, and in the case of the Gaussian model, we use inverse-gamma-normal distributions as the priors for the variances and means. Even when convenient priors are not available, EM is still tractable as long as one can sample from the posterior distributions. 3 Evaluation results We compared the performance of our biclustering algorithm with two methods, ISA and LAS, in simulations and in real gene expression datasets (Supplementary Note 8). ISA was chosen because it performed well in comparison studies [6] [8], and LAS was chosen because it outperformed ISA in preliminary simulations. Both ISA and LAS search for biclusters using iterative refinement. ISA assigns rows iteratively to clusters fractionally in proportion to the sum of their entries over columns. It repeats the same for column-cluster assignments, and this process is iterated until convergence. LAS uses a similar greedy iterative search without fractional memberships, and it masks alreadydetected clusters by mean subtraction. In our simulations, we generate simulated bipartite graphs of size 100x100. We planted (possibly overlapping) biclusters as full blocks with two noise models: • Bernoulli noise: we drew edges according to the binary model of Definition 2 with varying noise level q = 1 −p. 6 column variables row variables column variables row variables column variables row variables Gaussian noise Bernoulli noise overlapping biclusters (fixed overlap) non-overlapping biclusters overlapping biclusters (variable overlap) (a3) (a2) (b3) (b2) (b1) (a1) 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0 200 400 600 800 1000 1200 1400 %&03í(0 BCMP LAS ISA noise level average number of misclassified tuples total number of clustered tuples is 850 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0 200 400 600 800 1000 1200 1400 1600 1800 average number of misclassified tuples noise level total number of clustered tuples is 900 %&03í(0 BCMP LAS ISA 0 0.1 0.2 0.3 0.4 0.5 0.6 0 100 200 300 400 500 600 average number of misclassified tuples overlap %&03í(0 BCMP LAS 0 0.2 0.4 0.6 0.8 1 0 200 400 600 800 1000 noise level average number of misclassified tuples total number of clustered tuples is 850 %&03í(0 BCMP LAS ISA 0 0.2 0.4 0.6 0.8 1 0 200 400 600 800 1000 noise level average number of misclassified tuples total number of clustered tuples is 900 %&03í(0 BCMP LAS ISA 0 0.1 0.2 0.3 0.4 0.5 0 100 200 300 400 500 600 700 800 overlap average number of misclassified tuples %&03í(0 BCMP LAS Figure 2: Performance comparison of the proposed method (BCMP) with ISA and LAS, for Bernoulli and Gaussian models, and for overlapping and non-overlapping biclusters. On the y axis is the total number of misclassified row-column pairs. Either the noise level or the amount of overlap is on the x axis. • Gaussian noise: we drew edge weights within and outside of biclusters from normal distributions N(1, σ2) and N(0, σ2), respectively, for different values of σ. For each of these cases, we ran simulations on three setups (see Figure 2): • Non-overlapping clusters: three non-overlapping biclusters were planted in a 100 × 100 matrix with sizes 20 × 20, 15 × 20, and 15 × 10. We varied the noise level. • Overlapping clusters with fixed overlap: Three overlapping biclusters with fixed overlaps were planted in a 100 × 100 matrix with sizes 20 × 20, 20 × 10, and 10 × 30. We varied the noise level. • Overlapping clusters with variable overlap: we planted two 30 × 30 biclusters in a 100 × 100 matrix with variable amount of overlap between them, where the amount of overlap is defined as the fraction of rows and columns shared between the two clusters. We used Bernoulli noise level q = 1 −p = 0.15, and Gaussian noise level σ = 0.7. The methods used have some parameters to set. Pseudocode for BCMP is presented in Supplementary Note 10. Here are the parameters that we used to run each method: • BCMP method with underlying parameters given: We computed the input matrix of shifted log-likelihood ratios following the discussion in Section 2.2. The number of biclusters K was given. We initialized the cluster-shape parameters rk at 1 and updated them as discussed in Supplementary Note 3.1. In the case of Bernoulli noise, following Proposition 2 and Remark 1, we set ℓij = eij and δ 2 = 1/4. In the case of Gaussian noise, we chose a threshold δ to maximize the unthresholded likelihood (see Supplementary Note 3.2). • BCMP - EM method: Instead of taking the underlying model parameters as given, we estimated them using the procedure described in Section 2.4 and Supplementary Note 6. 7 We used identical, uninformative priors on the parameters of the within-cluster and null distributions. • ISA method: We used the same threshold ranges for both rows and columns, attempting to find best-performing threshold values for each noise level. These values were mostly around 1.5 for both noise types and for all three dataset types. We found positive biclusters, and used 20 reinitializations. Out of these 20 runs, we selected the best-performing run. • LAS method: There were no parameters to set. Since K was given, we selected the first K biclusters discovered by LAS, which marginally increased its performance. Evaluation results of both noise models and non-overlapping and overlapping biclusters are shown in Figure 2. In the non-overlapping case, BCMP and LAS performed similarly well, better than ISA. Both of these methods made few or no errors up until noise levels q = 0.2 and σ = .6 in Bernoulli and Gaussian cases, respectively. When the parameters had to be estimated using EM, BCMP performed worse for higher levels of Gaussian noise but well otherwise. ISA outperformed BCMP and LAS at very high levels of Bernoulli noise; at such a high noise level, however, the results of all three algorithms are comparable to a random guess. In the presence of overlap between biclusters, BCMP outperformed both ISA and LAS except at very high noise levels. Whereas LAS and ISA struggled to resolve these clusters even in the absence of noise, BCMP made few or no errors up until noise levels q = 0.2 and σ = .6 in Bernoulli and Gaussian cases, respectively. Notably, the overlapping clusters were more asymmetrical, demonstrating the robustness of the strategy of iteratively tuning rk in our method. In simulations with variable overlaps between biclusters, for both noise models, BCMP outperformed LAS significantly, while the results for the ISA method were very poor (data not shown). These results demonstrate that BCMP excels at inferring overlapping biclusters. 4 Discussion and future directions In this paper, we have proposed a new biclustering technique called Biclustering Using Message Passing that, unlike existent methods, infers a globally optimal collection of biclusters rather than a collection of locally optimal ones. This distinction is especially relevant in the presence of overlapping clusters, which are common in most applications. Such overlaps can be of importance if one is interested in the relationships among biclusters. We showed through simulations that our proposed method outperforms two popular existent methods, ISA and LAS, in both Bernoulli and Gaussian noise models, when the planted biclusters were overlapping. We also found that BCMP performed well when applied to gene expression datasets. Biclustering is a problem that arises naturally in many applications. Often, a natural statistical model for the data is available; for example, a Poisson model can be used for document classification (see Supplementary Note 9). Even when no such statistical model will be available, BCMP can be used to maximize a heuristic objective function such as the modularity function [17]. This heuristic is preferable to clustering the original adjacency matrix when the degrees of the nodes vary widely; see Supplementary Note 7. The same optimization strategy used in this paper for biclustering can also be applied to perform clustering, generalizing the graph-partitioning problem by allowing nodes to be in zero or several clusters. We believe that the flexibility of our framework to fit various statistical and heuristic models will allow BCMP to be used in diverse clustering and biclustering applications. Acknowledgments We would like to thank Professor Manolis Kellis and Professor Muriel Médard for their advice and support. We would like to thank the Harvard Division of Medical Sciences for supporting this project. 8 References [1] Cheng, Yizong, and George M. Church. "Biclustering of expression data." Ismb. Vol. 8. 2000. [2] Dao, Phuong, et al. "Inferring cancer subnetwork markers using density-constrained biclustering." Bioinformatics 26.18 (2010): i625-i631. [3] Bisson, Gilles, and Fawad Hussain. "Chi-sim: A new similarity measure for the co-clustering task." Machine Learning and Applications, 2008. ICMLA’08. Seventh International Conference on. IEEE, 2008. [4] Bergmann, Sven, Jan Ihmels, and Naama Barkai. "Iterative signature algorithm for the analysis of large-scale gene expression data." Physical review E 67.3 (2003): 031902. [5] Shabalin, Andrey A., et al. "Finding large average submatrices in high dimensional data." The Annals of Applied Statistics (2009): 985-1012. [6] Prelic, Amela, et al. "A systematic comparison and evaluation of biclustering methods for gene expression data." Bioinformatics 22.9 (2006): 1122-1129. [7] Tanay, Amos, Roded Sharan, and Ron Shamir. "Discovering statistically significant biclusters in gene expression data." Bioinformatics 18.suppl 1 (2002): S136-S144. [8] Li, Li, et al. "A comparison and evaluation of five biclustering algorithms by quantifying goodness of biclusters for gene expression data." BioData mining 5.1 (2012): 1-10. [9] Nadakuditi, Raj Rao, and Mark EJ Newman. "Graph spectra and the detectability of community structure in networks." Physical review letters 108.18 (2012): 188701. [10] Krzakala, Florent, et al. "Spectral redemption in clustering sparse networks." Proceedings of the National Academy of Sciences 110.52 (2013): 20935-20940. [11] Decelle, Aurelien, et al. "Asymptotic analysis of the stochastic block model for modular networks and its algorithmic applications." Physical Review E 84.6 (2011): 066106. [12] Frey, Brendan J., and Delbert Dueck. "Clustering by passing messages between data points." Science 315.5814 (2007): 972-976. [13] Dueck, Delbert, et al. "Constructing treatment portfolios using affinity propagation." Research in Computational Molecular Biology. Springer Berlin Heidelberg, 2008. [14] Govaert, G. and Nadif, M. "Block clustering with bernoulli mixture models: Comparison of different approaches." Computational Statistics and Data Analysis, 52 (2008): 3233-3245. [15] Dempster, Arthur P., Nan M. Laird, and Donald B. Rubin. "Maximum likelihood from incomplete data via the EM algorithm." Journal of the Royal Statistical Society. Series B (Methodological) (1977): 1-38. [16] Marbach, Daniel, et al. "Wisdom of crowds for robust gene network inference." Nature methods 9.8 (2012): 796-804. [17] Newman, Mark EJ. "Modularity and community structure in networks." Proceedings of the National Academy of Sciences 103.23 (2006): 8577-8582. [18] Yedidia, Jonathan S., William T. Freeman, and Yair Weiss. "Constructing free-energy approximations and generalized belief propagation algorithms." Information Theory, IEEE Transactions on 51.7 (2005): 2282-2312. [19] Caldas, José, and Samuel Kaski. "Bayesian biclustering with the plaid model." Machine Learning for Signal Processing, 2008. MLSP 2008. IEEE Workshop on. IEEE, 2008. 9
2014
342
5,450
Stochastic Proximal Gradient Descent with Acceleration Techniques Atsushi Nitanda NTT DATA Mathematical Systems Inc. 1F Shinanomachi Rengakan, 35, Shinanomachi, Shinjuku-ku, Tokyo, 160-0016, Japan nitanda@msi.co.jp Abstract Proximal gradient descent (PGD) and stochastic proximal gradient descent (SPGD) are popular methods for solving regularized risk minimization problems in machine learning and statistics. In this paper, we propose and analyze an accelerated variant of these methods in the mini-batch setting. This method incorporates two acceleration techniques: one is Nesterov’s acceleration method, and the other is a variance reduction for the stochastic gradient. Accelerated proximal gradient descent (APG) and proximal stochastic variance reduction gradient (Prox-SVRG) are in a trade-off relationship. We show that our method, with the appropriate mini-batch size, achieves lower overall complexity than both APG and Prox-SVRG. 1 Introduction This paper consider the following optimization problem: minimize x∈Rd f(x) def = g(x) + h(x), (1) where g is the average of the smooth convex functions g1, . . . , gn from Rd to R, i.e., g(x) = 1 n Pn i=1 gi(x) and h : Rd →R is a relatively simple convex function that can be non-differentiable. In machine learning, we often encounter optimization problems of this form. For example, given a sequence of training examples (a1, b1), . . . , (an, bn), where ai ∈Rd and bi ∈R, if we set gi(x) = 1 2(aT i x −bi)2, then we obtain ridge regression by setting h(x) = λ 2 ∥x∥2 or we obtain Lasso by setting h(x) = λ|x|. If we set gi(x) = log(1 + exp(−bixT ai)), then we obtain regularized logistic regression. To solve the optimization problem (1), one popular method is proximal gradient descent (PGD), which can be described by the following update rule for k = 1, 2, . . .: xk+1 = proxηkh (xk −ηk∇g(xk)) , where prox is the proximity operator, proxηh(y) = arg min x∈Rd 1 2∥x −y∥2 + ηh(x)  . A stochastic variant of PGD is stochastic proximal gradient descent (SPGD), where at each iteration k = 1, 2, . . ., we pick ik randomly from {1, 2, . . . , n}, and take the following update: xk+1 = proxηkh (xk −ηk∇gik(xk)) . 1 The advantage of SPGD over PGD is that at each iteration, SPGD only requires the computation of a single gradient ∇gik(xk). In contrast, each iteration of PGD evaluates the n gradients. Thus the computational cost of SPGD per iteration is 1/n that of the PGD. However, due to the variance introduced by random sampling, SPGD obtains a slower convergence rate than PGD. In this paper we consider problem (1) under the following assumptions. Assumption 1. Each convex function gi(x) is L-Lipschitz smooth, i.e., there exist L > 0 such that for all x, y ∈Rd, ∥∇gi(x) −∇gi(y)∥≤L∥x −y∥. (2) From (2), one can derive the following inequality, gi(x) ≤gi(y) + (∇gi(y), x −y) + L 2 ∥x −y∥2. (3) Assumption 2. g(x) is µ-strongly convex; i.e., there exists µ > 0 such that for all x, y ∈Rd, g(x) ≥g(y) + (∇g(y), x −y) + µ 2 ∥x −y∥2. (4) Note that it is obvious that L ≥µ. Assumption 3. The regularization function h(x) is a lower semi-continuous proper convex function; however, it can be non-differentiable or non-continuous. Under the Assumptions 1, 2, and h(x) ≡0, PGD (which is equivalent to gradient descent in this case) with a constant learning rate ηk = 1 L achieves a linear convergence rate. On the other hand, for stochastic (proximal) gradient descent, because of the variance introduced by random sampling, we need to choose diminishing learning rate ηk = O(1/k), and thus the stochastic (proximal) gradient descent converges at a sub-linear rate. To improve the stochastic (proximal) gradient descent, we need a variance reduction technique, which allows us to take a larger learning rate. Recently, several papers proposed such variance reduction methods for the various special cases of (1). In the case where gi(x) is Lipschitz smooth and h(x) is strongly convex, Shalev-Shwartz and Zhang [1,2] proposed a proximal stochastic dual coordinate ascent (Prox-SDCA); the same authors developed accelerated variants of SDCA [3, 4]. Le Roux et al. [5] proposed a stochastic average gradient (SAG) for the case where gi(x) is Lipschitz smooth, g(x) is strongly convex, and h(x) ≡0. These methods achieve a linear convergence rate. However, SDCA and SAG need to store all gradients (or dual variables), so that O(nd) storage is required in general problems. Although this can be reduced to O(n) for linear prediction problems, these methods may be unsuitable for more complex and large-scale problems. More recently, Johnson and Zhang [6] proposed stochastic variance reduction gradients (SVRG) for the case where gi(x) is L-Lipschitz smooth, g(x) is µ-strongly convex, and h(x) ≡0. SVRG achieves the following overall complexity (total number of component gradient evaluations to find an ǫ-accurate solution), O  (n + κ) log 1 ǫ  , (5) where κ is the condition number L/µ. Furthermore, this method need not store all gradients. Xiao and Zhang [7] proposed a proximal variant of SVRG, called Prox-SVRG which also achieves the same complexity. Another effective method for solving (1) is accelerated proximal gradient descent (APG), proposed by Nesterov [8,9]. APG [8] is an accelerated variant of deterministic gradient descent and achieves the following overall complexity to find an ǫ-accurate solution, O  n√κ log 1 ǫ  . (6) Complexities (5) and (6) are in a trade-off relationship. For example, if κ = n, then the complexity (5) is less than (6). On the other hand, the complexity of APG has a better dependence on the condition number κ. In this paper, we propose and analyze a new method called the Accelerated Mini-Batch Prox-SVRG (Acc-Prox-SVRG) for solving (1). Acc-Prox-SVRG incorporates two acceleration techniques in the mini-batch setting: (1) Nesterov’s acceleration method of APG and (2) an variance reduction technique of SVRG. We show that the overall complexity of this method, with an appropriate minibatch size, is more efficient than both Prox-SVRG and APG; even when mini-batch size is not appropriate, our method is still comparable to APG or Prox-SVRG. 2 2 Accelerated Mini-Batch Prox-SVRG As mentioned above, to ensure convergence of SPGD, the learning rate ηk has to decay to zero for reducing the variance effect of the stochastic gradient. This slows down the convergence. As a remedy to this issue, we use the variance reduction technique of SVRG [6] (see also [7]), which allows us to take a larger learning rate. Acc-Prox-SVRG is a multi-stage scheme. During each stage, this method performs m APG-like iterations and employs the following direction with mini-batch instead of gradient, vk = ∇gIk(yk) −∇gIk(˜x) + ∇g(˜x), (7) where Ik = {i1, . . . , ib} is a randomly chosen size b subset of {1, 2, . . . , n} and gIk = 1 b Pb j=1 gij. At the beginning of each stage, the initial point x1 is set to be ˜x, and at the end of stage, ˜x is updated. Conditioned on yk, we can take expectation with respect to Ik and obtain EIk [vk] = ∇g(yk), so that vk is an unbiased estimator. As described in the next section, the conditional variance EIk∥vk − ∇g(yk)∥2 can be much smaller than Ei∥∇gi(yk)−∇g(yk)∥2 near the optimal solution. The pseudocode of our Acc-Prox-SVRG is given in Figure 1. Parameters update frequency m, learning rate η, mini-batch size b and non-negative sequence β1, . . . , βm Initialize ˜x1 Iterate: for s = 1, 2, . . . ˜x = ˜xs ˜v = 1 n Pn i=1 ∇gi(˜x) x1 = y1 = ˜x Iterate: for k = 1, 2, . . . , m Randomly pick subset Ik ⊂{1, 2, . . . , n} of size b vk = ∇gIk(yk) −∇gIk(˜x) + ˜v xk+1 = proxηh (yk −ηvk) yk+1 = xk+1 + βk(xk+1 −xk) set ˜xs+1 = xm+1 end end Figure 1: Acc-Prox-SVRG In our analysis, we focus on a basic variant of the algorithm (Figure 1) with βk = 1−√µη 1+√µη . 3 Analysis In this section, we present our analysis of the convergence rates of Acc-Prox-SVRG described in Figure 1 under Assumptions 1, 2 and 3, and provide some notations and definitions. Note that we may omit the outer index s for notational simplicity. By the definition of a proximity operator, there exists a subgradient ξk ∈∂h(xk+1) such that xk+1 = yk −η (vk + ξk) . We define the estimate sequence Φk(x) (k = 1, 2, . . . , m + 1) by Φ1(x) = f(x1) + µ 2 ∥x −x1∥2 and Φk+1(x) = (1 −√µη)Φk(x) + √µη(gIk(yk) + (vk, x −yk) + µ 2 ∥x −yk∥2 +h(xk+1) + (ξk, x −xk+1)), for k ≥1. We set Φ∗ k = min x∈Rd Φk(x) and zk = arg min x∈Rd Φk(x). 3 Since ∇2Φk(x) = µIn, it follows that for ∀x ∈Rd, Φk(x) = µ 2 ∥x −zk∥2 + Φ∗ k. (8) The following lemma is the key to the analysis of our method. Lemma 1. Consider Acc-Prox-SVRG in Figure 1 under Assumptions 1, 2, and 3. If η ≤ 1 2L, then for k ≥1 we have E [Φk(x)] ≤f(x) + (1 −√µη)k−1 (Φ1 −f)(x) and (9) E [f(xk)] ≤E " Φ∗ k + k−1 X l=1 (1 −√µη)k−1−l  −µ 2 1 −µη √µη ∥xl −yl∥2 + η∥∇g(yl) −vl∥2 # , (10) where the expectation is taken with respect to the history of random variables I1, . . . , Ik−1. Note that if the conditional variance of vl is equal to zero, we immediately obtain a linear convergence rate from (9) and (10). Before we can prove Lemma 1, additional lemmas are required, whose proofs may be found in the Supplementary Material. Lemma 2. If η < 1 µ, then for k ≥1 we have zk+1 = (1 −√µη)zk + √µηyk − r η µ(vk + ξk) and (11) zk −yk = 1 √µη (yk −xk). (12) Lemma 3. For k ≥1, we have (∇g(yk) + ξk, vk + ξk) = 1 2 ∥∇g(yk) + ξk∥2 + ∥vk + ξk∥2 −∥∇g(yk) −vk∥2 , (13) ∥vk + ξk∥2 ≤2 ∥∇g(yk) + ξk∥2 + ∥∇g(yk) −vk∥2 , and (14) ∥∇g(yk) + ξk∥2 ≤2 ∥vk + ξk∥2 + ∥∇g(yk) −vk∥2 . (15) Proof of Lemma 1. Using induction, it is easy to show (9). The proof is in Supplementary Material. Now we prove (10) by induction. From the definition of Φ1, Φ∗ 1 = f(x1). we assume (10) is true for k. Using Eq. (11), we have ∥yk −zk+1∥2 = (1 −√µη)(yk −zk) + r η µ(vk + ξk) 2 = (1 −√µη)2∥yk −zk∥2 + 2 r η µ(1 −√µη)(yk −zk, vk + ξk) + η µ∥vk + ξk∥2. From above equation and (8) with x = yk, we get Φk+1(yk) = Φ∗ k+1 + µ 2  (1 −√µη)2∥yk −zk∥2 + 2 r η µ(1 −√µη)(yk −zk, vk + ξk) + η µ∥vk + ξk∥2  . On the other hand, from the definition of the estimate sequence and (8), Φk+1(yk) = (1 −√µη)  Φ∗ k + µ 2 ∥yk −zk∥2 + √µη(gIk(yk) + h(xk+1) + (ξk, yk −xk+1)). Therefore, from these two equations, we have Φ∗ k+1 = (1 −√µη)Φ∗ k + µ 2 (1 −√µη)√µη∥yk −zk∥2 + √µη(gIk(yk) + h(xk+1) +(ξk, yk −xk+1)) −(1 −√µη)√µη(yk −zk, vk + ξk) −η 2∥vk + ξk∥2. (16) 4 Since g is Lipschitz smooth, we bound f(xk+1) as follows: f(xk+1) ≤g(yk) + (∇g(yk), xk+1 −yk) + L 2 ∥xk+1 −yk∥2 + h(xk+1). (17) Using (16), (17), (12), and xk+1 −yk = −η(vk + ξk) we have EIk  f(xk+1) −Φ∗ k+1  (18) ≤ (16),(17) EIk h (1 −√µη)(−Φ∗ k + g(yk) + h(xk+1)) + (∇g(yk), xk+1 −yk) +√µη(ξk, xk+1 −yk) + L 2 ∥xk+1 −yk∥2 −µ 2 (1 −√µη)√µη∥yk −zk∥2 +(1 −√µη)√µη(yk −zk, vk + ξk) + η 2∥vk + ξk∥2i = (12) EIk h (1 −√µη)(−Φ∗ k + g(yk) + h(xk+1) + (xk −yk, vk + ξk)) −η(∇g(yk), vk + ξk) −η√µη(ξk, vk + ξk) −µ 2 1 −√µη √µη ∥yk −xk∥2 +η 2(Lη + 1)∥vk + ξk∥2i , (19) where for the first inequality we used EIk[gIk(yk)] = g(yk). Here, we give the following EIk [g(yk) + h(xk+1) + (xk −yk, vk + ξk)] = EIk [g(yk) + (vk, xk −yk) + h(xk+1) + (ξk, xk −xk+1) + (ξk, xk+1 −yk)] ≤EIk h g(xk) −µ 2 ∥xk −yk∥2 + h(xk) −η(ξk, vk + ξk) i , (20) where for the first inequality we used EIk[vk] = ∇g(yk) and convexity of g and h. Thus we have EIk  f(xk+1) −Φ∗ k+1  ≤ (19),(20) EIk h (1 −√µη)(f(xk) −Φ∗ k) −µ 2 1 −µη √µη ∥xk −yk∥2 −η(∇g(yk) + ξk, vk + ξk) + η 2(1 + Lη)∥vk + ξk∥2i ≤ (13) EIk  (1 −√µη)(f(xk) −Φ∗ k) −µ 2 1 −µη √µη ∥xk −yk∥2 −η 2∥∇g(yk) + ξk∥2 + Lη2 2 ∥vk + ξk∥2 + η 2∥vk −∇g(yk)∥2  ≤ (14),η≤1 2L EIk  (1 −√µη)(f(xk) −Φ∗ k) −µ 2 1 −µη √µη ∥xk −yk∥2 + η∥vk −∇g(yk)∥2  . By taking expectation with respect to the history of random variables I1, . . . , Ik−1, the induction hypothesis finishes the proof of (10). Our bound on the variance of vk is given in the following lemma, whose proof is in the Supplementary Material. Lemma 4. Suppose Assumption 1 holds, and let x∗= arg min x∈Rd f(x). Conditioned on yk, we have that EIk∥vk −∇g(yk)∥2 ≤1 b n −b n −1 2L2∥yk −xk∥2 + 8L(f(xk) −f(x∗) + f(˜x) −f(x∗))  . (21) From (10), (21), and (9) with x = x∗, it follows that E [f(xk) −f(x∗)] ≤(1 −√µη)k−1(Φ1 −f)(x∗) + E hPk−1 l=1 (1 −√µη)k−1−l · n −µ 2 1−µη √µη + n−b n−1 2L2η b  ∥xl −yl∥2 + n−b n−1 8Lη b (f(xl) −f(x∗) + f(˜x) −f(x∗)) oi . 5 If η ≤min  (pb)2 64  n−1 n−b 2 µ L2 , 1 2L  , then the coefficients of ∥xl −yl∥2 are non-positive for p ≤2. Indeed, using η ≤(pb)2 64 n −1 n −b 2 µ L2 ⇒n −b n −1 Lη b ≤p 8 √µη, for p > 0, (22) we get −µ 2 1−µη √µη + n−b n−1 2L2η b ≤−µ 2 1−µη √µη + L 2 √µη = 1 2√µη −µ + µ2η + µLη  ≤ µ≤L 1 2√µη (−µ + 2µLη) ≤ η≤1 2L 0. Thus, using (22) again with p ≤1, we have E [f(xk) −f(x∗)] ≤(1 −√µη)k−1(Φ1 −f)(x∗) +E "k−1 X l=1 (1 −√µη)k−1−lp√µη(f(xl) −f(x∗) + f(˜x) −f(x∗)) # ≤(1 −√µη)k−1(Φ1 −f)(x∗) + p(f(˜x) −f(x∗)) +E "k−1 X l=1 (1 −√µη)k−1−lp√µη(f(xl) −f(x∗)) # , (23) where for the last inequality we used Pk−1 l=1 (1 −√µη)k−1−l ≤P∞ t=0(1 −√µη)t = 1 √µη. Theorem 1. Suppose Assumption 1, 2, and 3. Let η ≤min  (pb)2 64  n−1 n−b 2 µ L2 , 1 2L  and 0 < p < 1. Then we have E [f(˜xs+1) −f(x∗)] ≤  (1 −(1 −p)√µη)m + p 1 −p  (2 + p)(f(˜xs) −f(x∗)). (24) Moreover, if m ≥ 1 (1−p)√µη log 1−p p , then it follows that E [f(˜xs+1) −f(x∗)] ≤2p(2 + p) 1 −p (f(˜xs) −f(x∗)). (25) From Theorem 1, we can see that for small 0 < p, the overall complexity of Acc-Prox-SVRG (total number of component gradient evaluations to find an ǫ-accurate solution) is O  n + b √µη  log 1 ǫ  . Thus, we have the following corollary: Corollary 1. Suppose Assumption 1, 2, and 3. Let p be sufficiently small, as stated above, and η = min  (pb)2 64  n−1 n−b 2 µ L2 , 1 2L  . If mini-batch size b is smaller than l 8√κn √ 2p(n−1)+8√κ m , then the learning rate η is equal to (pb)2 64  n−1 n−b 2 µ L2 and the overall complexity is O  n + n −b n −1κ  log 1 ǫ  . (26) Otherwise, η = 1 2L and the complexity becomes O n + b√κ  log 1 ǫ  . (27) 6 Table 1: Comparison of overall complexity. b0 = 8√κn √ 2p(n−1)+8√κ. ProxSVRG AccProxSVRG b < ⌈b0⌉ APG [8] AccProxSVRG b ≥⌈b0⌉ O (n + κ) log 1 ǫ  O  n + n−b n−1κ  log 1 ǫ  O (n√κ) log 1 ǫ  O (n + b√κ) log 1 ǫ  Table 1 lists the overall complexities of the algorithms that achieve linear convergence. As seen from Table 1, the complexity of Acc-Prox-SVRG monotonically decreases with respect to b < ⌈b0⌉, where b0 = 8√κn √ 2p(n−1)+8√κ and monotonically increases when b ≥⌈b0⌉. Moreover, if b = 1, then Acc-Prox-SVRG has the same complexity as that of Prox-SVRG, while if b = n then the complexity of this method is equal to that of APG. Therefore, with an appropriate mini-batch size, Acc-ProxSVRG may outperform both Prox-SVRG and APG; even if the mini-batch is not appropriate, then Acc-Prox-SVRG is still comparable to Prox-SVRG or APG. The following overall complexity is the best possible rate of Acc-Prox-SVRG, O  n + nκ n + √κ  log 1 ǫ  . Now we give the proof of Theorem 1. Proof of Theorem 1. We denote E[f(xk) −f(x∗)] by Vk, and we use Wk to denote the last expression in (23). Thus, for k ≥1, Vk ≤Wk. For k ≥2, we have Wk = (1 −√µη) ( (1 −√µη)k−2(Φ1 −f)(x∗) + pV1 + k−2 X l=1 (1 −√µη)k−2−lp√µη Vl ) +p√µη Vk−1 + p√µη V1 ≤(1 −√µη(1 −p))Wk−1 + p√µη W1. Since 0 < √µη(1 −p) < 1, the above inequality leads to Wk =  (1 −(1 −p)√µη)k−1 + p 1 −p  W1. (28) From the strong convexity of g (and f), we can see W1 = (1 + p)(f(˜x) −f(x∗)) + µ 2 ∥˜x −x∗∥2 ≤(2 + p)(f(˜x) −f(x∗)). Thus, for k ≥2, we have Vk ≤Wk ≤  (1 −(1 −p)√µη)k−1 + p 1 −p  (2 + p)(f(˜x) −f(x∗)), and that is exactly (24). Using log(1 −α) ≤−α and m ≥ 1 (1−p)√µη log 1−p p , we have log(1 −(1 −p)√µη)m ≤−m(1 −p)√µη ≤−log 1 −p p , so that (1 −(1 −p)√µη)m ≤ p 1 −p. This finishes the proof of Theorem 1. 4 Numerical Experiments In this section, we compare Acc-Prox-SVRG with Prox-SVRG and APG on L1-regularized multiclass logistic regression with the regularization parameter λ. Table 2 provides details of the datasets 7 mnist covtype.scale rcv1.binary Figure 2: Comparison of Acc-Prox-SVRG with Prox-SVRG and APG. Top: Objective gap of L1 regularized multi-class logistic regression. Bottom: Test error rates. and regularization parameters utilized in our experiments. These datasets can be found at the LIBSVM website1. The best choice of mini-batch size is b = ⌈b0⌉, which allows us to take a large learning rate, η = 1 2L. Therefore, we have m ≥O(√κ) and βk = √ 2κ−1 √ 2κ+1. When the number of components n is very large compared with √κ, we see that b0 = O(√κ); for this, we set m = δb (δ ∈{0.1, 1.0, 10}) and βk = b−2 b+2 varying b in the set {100, 500, 1000}. We ran AccProx-SVRG using values of η from the range {0.01, 0.05, 0.1, 0.5, 1.0, 5.0, 10.0}, and we chose the best η in each mini-batch setting. Figure 2 compares Acc-Prox-SVRG with Prox-SVRG and APG. The horizontal axis is the number of single-component gradient evaluations. For Acc-Prox-SVRG, each iteration computes the 2b gradients, and at the beginning of each stage, the n component gradients are evaluated. For ProxSVRG, each iteration computes the two gradients, and at the beginning of each stage, the n gradients are evaluated. For APG, each iteration evaluates n gradients. Table 2: Details of data sets and regularization parameters. Dataset classes Training size Testing size Features λ mnist 10 60,000 10,000 780 10−5 covtype.scale 7 522,910 58,102 54 10−6 rcv1.binary 2 20,242 677,399 47,236 10−5 As can be seen from Figure 2, Acc-Prox-SVRG with good values of b performs better than or is comparable to Prox-SVRG and is much better than results for APG. On the other hand, for relatively large b, Acc-Prox-SVRG may perform worse because of an overestimation of b0, and hence the worse estimates of m and βk. 5 Conclusion We have introduced a method incorporating Nesterov’s acceleration method and a variance reduction technique of SVRG in the mini-batch setting. We prove that the overall complexity of our method, with an appropriate mini-batch size, is more efficient than both Prox-SVRG and APG; even when mini-batch size is not appropriate, our method is still comparable to APG or Prox-SVRG. In addition, the gradient evaluations for each mini-batch can be parallelized [3,10,11] when using our method; hence, it performs much faster in a distributed framework. 1http://www.csie.ntu.edu.tw/ cjlin/libsvmtools/datasets/ 8 References [1] S. Shalev-Shwartz and T. Zhang. Proximal stochastic dual coordinate ascent. arXiv:1211.2717, 2012. [2] S. Shalev-Shwartz and T. Zhang. Stochastic dual coordinate ascent methods for regularized loss minimization. Journal of Machine Learning Research 14, pages 567-599, 2013. [3] S. Shalev-Shwartz and T. Zhang. Accelerated mini-batch stochastic dual coordinate ascent. Advances in Neural Information Processing System 26, pages 378-385, 2013. [4] S. Shalev-Shwartz and T. Zhang. Accelerated Proximal Stochastic Dual Coordinate Ascent for Regularized Loss Minimization. Proceedings of the 31th International Conference on Machine Learning, pages 64-72, 2014. [5] N. Le Roux, M. Schmidt, and F. Bach. A Stochastic Gradient Method with an Exponential Convergence Rate for Finite Training Sets. Advances in Neural Information Processing System 25, pages 2672-2680, 2012. [6] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. Advances in Neural Information Processing System 26, pages 315-323, 2013. [7] L. Xiao and T. Zhang. A Proximal Stochastic Gradient Method with Progressive Variance Reduction. arXiv:1403.4699, 2014. [8] Y. Nesterov. Introductory Lectures on Convex Optimization: A Basic Course. Kluwer, Boston, 2004. [9] Y. Nesterov. Gradient methods for minimizing composite objective function. CORE Discussion Papers, 2007. [10] O. Dekel, R. Gilad-Bachrach, O. Shamir, and L. Xiao. Optimal distributed online prediction using mini-batches. Journal of Machine Learning Research 13, pages 165-202, 2012. [11] A. Agarwal and J. Duchi. Distributed delayed stochastic optimization. Advances in Neural Information Processing System 24, pages 873-881, 2011. 9
2014
343
5,451
DFacTo: Distributed Factorization of Tensors Joon Hee Choi Electrical and Computer Engineering Purdue University West Lafayette IN 47907 choi240@purdue.edu S. V. N. Vishwanathan Statistics and Computer Science Purdue University West Lafayette IN 47907 vishy@stat.purdue.edu Abstract We present a technique for significantly speeding up Alternating Least Squares (ALS) and Gradient Descent (GD), two widely used algorithms for tensor factorization. By exploiting properties of the Khatri-Rao product, we show how to efficiently address a computationally challenging sub-step of both algorithms. Our algorithm, DFacTo, only requires two sparse matrix-vector products and is easy to parallelize. DFacTo is not only scalable but also on average 4 to 10 times faster than competing algorithms on a variety of datasets. For instance, DFacTo only takes 480 seconds on 4 machines to perform one iteration of the ALS algorithm and 1,143 seconds to perform one iteration of the GD algorithm on a 6.5 million × 2.5 million × 1.5 million dimensional tensor with 1.2 billion non-zero entries. 1 Introduction Tensor data appears naturally in a number of applications [1, 2]. For instance, consider a social network evolving over time. One can form a users × users × time tensor which contains snapshots of interactions between members of the social network [3]. As another example consider an online store such as Amazon.com where users routinely review various products. One can form a users × items × words tensor from the review text [4]. Similarly a tensor can be formed by considering the various contexts in which a user has interacted with an item [5]. Finally, consider data collected by the Never Ending Language Learner from the Read the Web project which contains triples of noun phrases and the context in which they occur, such as, (“George Harrison”, “plays”, “guitars”) [6]. While matrix factorization and matrix completion have become standard tools that are routinely used by practitioners, unfortunately, the same cannot be said about tensor factorization. The reasons are not very hard to see: There are two popular algorithms for tensor factorization namely Alternating Least Squares (ALS) (Appendix B), and Gradient Descent (GD) (Appendix C). The key step in both algorithms is to multiply a matricized tensor and a Khatri-Rao product of two matrices (line 4 of Algorithm 2 and line 4 of Algorithm 3). However, this process leads to a computationallychallenging, intermediate data explosion problem. This problem is exacerbated when the dimensions of tensor we need to factorize are very large (of the order of hundreds of thousands or millions), or when sparse tensors contain millions to billions of non-zero entries. For instance, a tensor we formed using review text from Amazon.com has dimensions of 6.5 million × 2.5 million × 1.5 million and contains approximately 1.2 billion non-zero entries. Some studies have identified this intermediate data explosion problem and have suggested ways of addressing it. First, the Tensor Toolbox [7] uses the method of reducing indices of the tensor for sparse datasets and entrywise multiplication of vectors and matrices for dense datasets. However, it is not clear how to store data or how to distribute the tensor factorization computation to multiple machines (see Appendix D). That is, there is a lack of distributable algorithms in existing studies. Another possible strategy to solve the data explosion problem is to use GigaTensor [8]. Unfortunately, while GigaTensor does address the problem of parallel computation, it is relatively slow. To 1 summarize, existing algorithms for tensor factorization such as the excellent Tensor Toolbox of [7], or the Map-Reduce based GigaTensor algorithm of [8] often do not scale to large problems. In this paper, we introduce an efficient, scalable and distributed algorithm, DFacTo, that addresses the data explosion problem. Since most large-scale real datasets are sparse, we will focus exclusively on sparse tensors. This is well justified because previous studies have shown that designing specialized algorithms for sparse tensors can yield significant speedups [7]. We show that DFacTo can be applied to both ALS and GD, and naturally lends itself to a distributed implementation. Therefore, it can be applied to massive real datasets which cannot be stored and manipulated on a single machine. For ALS, DFacTo is on average around 5 times faster than GigaTensor and around 10 times faster than the Tensor Toolbox on a variety of datasets. In the case of GD, DFacTo is on average around 4 times faster than CP-OPT [9] from the Tensor Toolbox. On the Amazon.com review dataset, DFacTo only takes 480 seconds on 4 machines to perform one iteration of ALS and 1,143 seconds to perform one iteration of GD. As with any algorithm, there is a trade-off: DFacTo uses 3 times more memory than the Tensor Toolbox, since it needs to store 3 flattened matrices as opposed to a single tensor. However, in return, our algorithm only requires two sparse matrix-vector multiplications, making DFacTo easy to implement using any standard sparse linear algebra library. Therefore, there are two merits of using our algorithm: 1) computations are distributed in a natural way; and 2) only standard operations are required. 2 Notation and Preliminaries Our notation is standard, and closely follows [2]. Also see [1]. Lower case letters such as x denote scalars, bold lower case letters such as x denote vectors, bold upper case letters such as X represent matrices, and calligraphic letters such as X denote three-dimensional tensors. The i-th element of a vector x is written as xi. In a similar vein, the (i, j)-th entry of a matrix X is denoted as xi,j and the (i, j, k)-th entry of a tensor X is written as xi,j,k. Furthermore, xi,: (resp. x:,i) denotes the i-th row (resp. column) of X. We will use XΩ,: (resp. X:,Ω) to denote the sub-matrix of X which contains the rows (resp. columns) indexed by the set Ω. For instance, if Ω= {2, 4}, then XΩ,: is a matrix which contains the second and fourth rows of X. Extending the above notation to tensors, we will write Xi,:,:, X:,j,: and X:,:,k to respectively denote the horizontal, lateral and frontal slices of a third-order tensor X. The column, row, and tube fibers of X are given by x:,j,k, xi,:,k, and xi,j,: respectively. Sometimes a matrix or tensor may not be fully observed. We will use ΩX or ΩX respectively to denote the set of indices corresponding to the observed (or equivalently non-zero) entries in a matrix X or a tensor X. Extending this notation, ΩX i,: (resp. ΩX :,j) denotes the set of column (resp. row) indices corresponding to the observed entries in the i-th row (resp. j-th column) of X. We define ΩX i,:,:, ΩX :,j,:, and ΩX :,:,k analogously as the set of indices corresponding to the observed entries of the i-th horizontal, j-th lateral, or k-th frontal slices of X. Also, nnzr(X) (resp. nnzc(X)) denotes the number of rows (resp. columns) of X which contain at least one non-zero element. X⊤denotes the transpose, X† denotes the Moore-Penrose pseudo-inverse, and ∥X∥(resp. ∥X∥) denotes the Frobenius norm of a matrix X (resp. tensor X) [10]. Given a matrix A ∈Rn×m, the linear operator vec(A) yields a vector x ∈Rnm, which is obtained by stacking the columns of A. On the other hand, given a vector x ∈Rnm, the operator unvec(n,m)(x) yields a matrix A ∈Rn×m. A ⊗B denotes the Kronecker product, A ⊙B the Khatri-Rao product, and A ∗B the Hadamard product of matrices A and B. The outer product of vectors a and b is written as a ◦b (see e.g., [11]). Definitions of these standard matrix products can be found in Appendix A. 2.1 Flattening Tensors Just like the vec(·) operator flattens a matrix, a tensor X may also be unfolded or flattened into a matrix in three ways namely by stacking the horizontal, lateral, and frontal slices. We use Xn to denote the n-mode flattening of a third-order tensor X ∈RI×J×K; X1 is of size I × JK, X2 is of size J × KI, and X3 is of size K × IJ. The following relationships hold between the entries of X 2 and its unfolded versions (see Appendix A.1 for an illustrative example): xi,j,k = x1 i,j+(k−1)J = x2 j,k+(i−1)K = x3 k,i+(j−1)I. (1) We can view X1 as consisting of K stacked frontal slices of X, each of size I × J. Similarly, X2 consists of I slices of size J × K and X3 is made up of J slices of size K × I. If we use Xn,m to denote the m-th slice in the n-mode flattening of X, then observe that the following holds: x1 i,j+(k−1)J = x1,k i,j , x2 j,k+(i−1)K = x2,i j,k, x3 k,i+(j−1)I = x3,j k,i. (2) One can state a relationship between the rows and columns of various flattenings of a tensor, which will be used to derive our distributed tensor factorization algorithm in Section 3. The proof of the below lemma is in Appendix A.2. Lemma 1 Let (n, n′) ∈{(2, 1), (3, 2), (1, 3)}, and let Xn and Xn′ be the n and n′-mode flattening respectively of a tensor X. Moreover, let Xn,m be the m-th slice in Xn, and xn′ m,: be the m-th row of Xn′. Then, vec(Xn,m) = xn′ m,:. 3 DFacTo Recall that the main challenge of implementing ALS or GD for solving tensor factorization lies in multiplying a matricized tensor and a Khatri-Rao product of two matrices: X1 (C ⊙B)1 . If B is of size J × R and C is of size K × R, explicitly forming (C ⊙B) requires O(JKR) memory and is infeasible when J and K are large. This is called the intermediate data explosion problem in the literature [8]. The lemma below will be used to derive our efficient algorithm, which avoids this problem. Although the proof can be inferred using results in [2], we give an elementary proof for completeness. Lemma 2 The r-th column of X1 (C ⊙B) can be computed as  X1 (C ⊙B)  :,r = h unvec(K,I) X2⊤b:,r i⊤ c:,r (3) Proof We need to show that  X1 (C ⊙B)  :,r = h unvec(K,I) X2⊤b:,r i⊤ c:,r =   b⊤ :,r X2,1 c:,r ... b⊤ :,r X2,I c:,r  . Or equivalently it suffices to show that  X1 (C ⊙B)  i,r = b⊤ :,r X2,i c:,r. Using (13) vec b⊤ :,r X2,i c:,r  = c⊤ :,r ⊗b⊤ :,r  vec X2,i . (4) Observe that b⊤ :,r X2,i c:,r is a scalar. Moreover, using Lemma 1 we can write vec X2,i = x1 i,:. This allows us to rewrite the above equation as b⊤ :,r X2,i c:,r = x1 i,: ⊤(c:,r ⊗b:,r) =  X1 (C ⊙B)  i,r , which completes the proof. Unfortunately, a naive computation of  X1 (C ⊙B)  :,r by using (3) does not solve the intermediate data explosion problem. This is because X2⊤b:,r produces a KI dimensional vector, which is then reshaped by the unvec(K,I)(·) operator into a K × I matrix. However, as the next lemma asserts, only a small number of entries of X2⊤b:,r are non-zero. For convenience, let a vector produced by (X2)⊤b:,r be v:,r and a matrix produced by  unvec(K,I)(v:,r) ⊤be Mr. 1We mainly concentrate on the update to A since the updates to B and C are analogous. 3 Lemma 3 The number of non-zeros in v:,r is at most nnzr((X2)⊤) and nnzc(X2). Proof Multiplying an all-zero row in (X2)⊤and b:,r produces zero. Therefore, the number of nonzeros in v:,r is equal to the number of rows in (X2)⊤that contain at least one non-zero element. Also, by definition, nnzr((X2)⊤) is equal to nnzc(X2). As a consequence of the above lemma, we only need to explicitly compute the non-zero entries of v:,r. However, the problem of reshaping v:,r via the  unvec(K,I)(·) ⊤operator still remains. The next lemma shows how to overcome this difficulty. Lemma 4 The location of the non-zero entries of Mr depends on (X2)⊤and is independent of b:,r. Proof The product of the (k+(i−1)K)-th row of (X2)⊤and b:,r is the (k+(i−1)K)-th element of v:,r. And, this element is the (i, k)-th entry of Mr by definition of  unvec(K,I)(·) ⊤. Therefore, if all the entries in the (k + (i −1)K)-th row of (X2)⊤are zero, then the (i, k)-th entry of Mr is zero regardless of b:,r. Consequently, the location of the non-zero entries of Mr is independent of b:,r, and is only determined by (X2)⊤. Given X one can compute (X2)⊤to know the locations of the non-zero entries of Mr. In other words, we can infer the non-zero pattern and therefore preallocate memory for Mr. We will show below how this allows us to perform the  unvec(K,I)(·) ⊤operation for free. Recall the Compressed Sparse Row (CSR) Format, which stores a sparse matrix as three arrays namely values, columns, and rows. Here, values represents the non-zero values of the matrix; while columns stores the column indices of the non-zero values. Also, rows stores the indices of the columns array where each row starts. For example, if a sparse matrix Mr is Mr =  1 0 2 0 3 4  , then the CSR of Mr is value(Mr) = [ 1 2 3 4 ] col(Mr) = [ 0 2 1 2 ] row(Mr) = [ 0 2 4 ] . Different matrices with the same sparsity pattern can be represented by simply changing the entries of the value array. For our particular case, what this means is that we can pre-compute col(Mr) and row(Mr) and pre-allocate value(Mr). By writing the non-zero entries of v:,r into value(Mr) we can “reshape” v:,r into Mr. Let the matrix with all-zero rows in (X2)⊤removed be ( ˆX2)⊤. Then, Algorithm 1 shows the DFacTo algorithm for computing N := X1 (C ⊙B). Here, the input values are ( ˆX2)⊤, B, C, and Mr preallocated in CSR format. By storing the results of the product of ( ˆX2)⊤and b:,r directly into value(Mr), we can obtain Mr because Mr was preallocated in the CSR format. Then, the product of Mr and c:,r yields the r-th column of N. We obtain the output N by repeating these two sparse matrix-vector products R times. Algorithm 1: DFacTo algorithm for Tensor Factorization Input: ( ˆX2)⊤, B, C, value(Mr) col(Mr), row(Mr) 1 Output: N 2 while r=1, 2,..., R do 3 value(Mr) ←( ˆX2)⊤b:,r 4 n:,r ←Mr c:,r 5 end 6 It is immediately obvious that using the above lemmas to compute N requires no extra memory other than storing Mr, which contains at most nnzc(X2) ≤ ΩX non-zero entries. Therefore, we 4 completely avoid the intermediate data explosion problem. Moreover, the same subroutine can be used for both ALS and GD (see Appendix E for detailed pseudo-code). 3.1 Distributed Memory Implementation Our algorithm is easy to parallelize using a master-slave architecture of MPI(Message Passing Interface). At every iteration, the master transmits A, B, and C to the slaves. The slaves hold a fraction of the rows of X2 using which a fraction of the rows of N is computed. By performing a synchronization step, the slaves can exchange rows of N. In ALS, this N is used to compute A which is transmitted back to the master. Then, the master updates A, and the iteration proceeds. In GD, the slaves transmit N back to the master, which computes ∇A. Then, the master computes the step size by a line search algorithm, updates A, and the iteration proceeds. 3.2 Complexity Analysis A naive computation of N requires JK + ΩX  R flops; forming C ⊙B requires JKR flops and performing the matrix-matrix multiplication X1 (C ⊙B) requires ΩX R flops. Our algorithm requires only nnzc(X2) + ΩX  R flops; ΩX R flops for computing v:,r and nnzc(X2)R flops for computing Mrc:,r. Note that, typically, nnzc(X2) ≪both JK and ΩX (see Table 1). In terms of memory, the naive algorithm requires O(JKR) extra memory, while our algorithm only requires nnzc(X2) extra space to store Mr. 4 Related Work Two papers that are most closely related to our work are the GigaTensor algorithm proposed by [8] and the Sparse Tensor Toolbox of [7]. As discussed above, both algorithms attack the problem of computing N efficiently. In order to compute n:,r, GigaTensor computes two intermediate matrices N1 := X1 ∗  1I ⊙(c:,r ⊗1J)⊤ and N2 := bin X1 ∗  1I ⊙(1K ⊗b:,r)⊤ . Next, N3 := N1 ∗N2 is computed, and n:,r is obtained by computing N3 1JK. As reported in [8], GigaTensor uses 2 ΩX extra storage and 5 ΩX flops to compute one column of N. The Sparse Tensor Toolbox stores a tensor as a vector of non-zero values and a matrix of corresponding indices. Entries of B and C are replicated appropriately to create intermediate vectors. A Hadamard product is computed between the non-zero entries of the matrix and intermediate vectors, and a selected set of entries are summed to form columns of N. The algorithm uses 2 ΩX extra storage and 5 ΩX flops to compute one column of N. See Appendix D for a detailed illustrative example which shows all the intermediate calculations performed by our algorithm as well as the algorithm of [8] and [7]. Also, [9] suggests the gradient-based optimization of CANDECOMP/PARAFAC (CP) using the same method as [7] to compute X1 (C ⊙B). [9] refers to this gradient-based optimization algorithm as CPOPT and the ALS algorithm of CP using the method of [7] as CPALS. Following [9], we use these names, CPALS and CPOPT. 5 Experimental Evaluation Our experiments are designed to study the scaling behavior of DFacTo on both publicly available real-world datasets as well as synthetically generated data. We contrast the performance of DFacTo (ALS) with GigaTensor [8] as well as with CPALS [7], while the performance of DFacTo (GD) is compared with CPOPT [9]. We also present results to show the scaling behavior of DFacTo when data is distributed across multiple machines. Datasets See Table 1 for a summary of the real-world datasets we used in our experiments. The NELL-1 and NELL-2 datasets are from [8] and consists of (noun phrase 1, context, noun phrase 2) triples from the “Read the Web” project [6]. NELL-2 is a version of NELL-1, which is obtained by removing entries whose values are below a threshold. 5 The Yelp Phoenix dataset is from the Yelp Data Challenge 2, while Cellartracker, Ratebeer, Beeradvocate and Amazon.com are from the Stanford Network Analysis Project (SNAP) home page. All these datasets consist of product or business reviews. We converted them into a users × items × words tensor by first splitting the text into words, removing stop words, using Porter stemming [12], and then removing user-item pairs which did not have any words associated with them. In addition, for the Amazon.com dataset we filtered words that appeard less than 5 times or in fewer than 5 documents. Note that the number of dimensions as well as the number of non-zero entries reported in Table 1 differ from those reported in [4] because of our pre-processing. Dataset I J K ΩˆX nnzc(X1) nnzc(X2) nnzc(X3) Yelp 45.97K 11.54K 84.52K 9.85M 4.32M 6.11M 229.83K Cellartracker 36.54K 412.36K 163.46K 25.02M 19.23M 5.88M 1.32M NELL-2 12.09K 9.18K 28.82K 76.88M 16.56M 21.48M 337.37K Beeradvocate 33.37K 66.06K 204.08K 78.77M 18.98M 12.05M 1.57M Ratebeer 29.07K 110.30K 294.04K 77.13M 22.40M 7.84M 2.85M NELL-1 2.90M 2.14M 25.50M 143.68M 113.30M 119.13M 17.37M Amazon 6.64M 2.44M 1.68M 1.22B 525.25M 389.64M 29.91M Table 1: Summary statistics of the datasets used in our experiments. We also generated the following two kinds of synthetic data for our experiments: • the number of non-zero entries in the tensor is held fixed but we vary I, J, and K. • the dimensions I, J, and K are held fixed but the number of non-zeros entries varies. To simulate power law behavior, both the above datasets were generated using the following preferential attachment model [13]: the probability that a non-zero entry is added at index (i, j, k) is given by pi ×pj ×pk, where pi (resp. pj and pk) is proportional to the number of non-zero entries at index i (resp. j and k). Implementation and Hardware All experiments were conducted on a computing cluster where each node has two 2.1 GHz 12-core AMD 6172 processors with 48 GB physical memory per node. Our algorithms are implemented in C++ using the Eigen library3 and compiled with the Intel Compiler. We downloaded Version 2.5 of the Tensor Toolbox, which is implemented in MATLAB4. Since open source code for GigaTensor is not freely available, we developed our own version in C++ following the description in [8]. Also, we used MPICH25 in order to distribute the tensor factorization computation to multiple machines. All our codes are available for download under an open source license from http://www.joonheechoi.com/research. Scaling on Real-World Datasets Both CPALS and our implementation of GigaTensor are uniprocessor codes. Therefore, for this experiment we restricted ourselves to datasets which can fit on a single machine. When initialized with the same starting point, DFacTo and its competing algorithms will converge to the same solution. Therefore, we only compare the CPU time per iteration of the different algorithms. The results are summarized in Table 2. On many datasets DFacTo (ALS) is around 5 times faster than GigaTensor and 10 times faster than CPALS; the differences are more pronounced on the larger datasets. Also, DFacTo (GD) is around 4 times faster than CPOPT. The differences in performance between DFacTo (ALS) and CPALS and between DFacTo (GD) and CPOPT can partially be explained by the fact that DFacTo (ALS, GD) is implemented in C++ while CPALS and CPOPT use MATLAB. However, it must be borne in mind that both MATLAB and our implementation use an optimized BLAS library to perform their computationally intensive numerical linear algebra operations. Compared to the Map-Reduce version implemented in Java and used for the experiments reported in [8], our C++ implementation of GigaTensor is significantly faster and more optimized. As per [8], 2https://www.yelp.com/dataset challenge/dataset 3http://eigen.tuxfamily.org 4http://www.sandia.gov/˜tgkolda/TensorToolbox/ 5http://www.mpich.org/static/downloads/ 6 Dataset DFacTo (ALS) GigaTensor CPALS DFacTo (GD) CPOPT Yelp Phoenix 9.52 26.82 46.52 13.57 45.9 Cellartracker 23.89 80.65 118.25 35.82 130.32 NELL-2 32.59 186.30 376.10 80.79 386.25 Beeradvocate 43.84 224.29 364.98 94.85 481.06 Ratebeer 44.20 240.80 396.63 87.36 349.18 NELL-1 322.45 772.24 742.67 Table 2: Times per iteration (in seconds) of DFacTo (ALS), GigaTensor, CPALS, DFacTo (GD), and CPOPT on datasets which can fit in a single machine (R=10). DFacTo (ALS) DFacTo (GD) NELL-1 Amazon NELL-1 Amazon Machines Iter. CPU Iter. CPU Iter. CPU Iter. CPU 1 322.45 322.45 742.67 104.23 2 205.07 167.29 492.38 55.11 4 141.02 101.58 480.21 376.71 322.65 28.55 1143.7 127.57 8 86.09 62.19 292.34 204.41 232.41 16.24 727.79 62.61 16 81.24 46.25 179.23 98.07 178.92 9.70 560.47 28.61 32 90.31 34.54 142.69 54.60 209.39 7.45 471.91 15.78 Table 3: Total Time and CPU time per iteration (in seconds) as a function of number of machines for the NELL-1 and Amazon datasets (R=10). the Java implementation took approximately 10,000 seconds per iteration to handle a tensor with around 109 non-zero entries, when using 35 machines. In contrast, the C++ version was able to handle one iteration of the ALS algorithm on the NELL-1 dataset on a single machine in 772 seconds. However, because DFacto (ALS) uses a better algorithm, it is able to handsomely outperform GigaTensor and only takes 322 seconds per iteration. Also, the execution time of DFacTo (GD) is longer than that of DFacTo (ALS) because DFacTo (GD) spends more time on the line search algorithm to obtain an appropriate step size. Scaling across Machines Our goal is to study scaling behavior of the time per iteration as datasets are distributed across different machines. Towards this end we worked with two datasets. NELL-1 is a moderate-size dataset which our algorithm can handle on a single machine, while Amazon is a large dataset which does not fit on a single machine. Table 3 shows that the iteration time decreases as the number of machines increases on the NELL-1 and Amazon datasets. While the decrease in iteration time is not completely linear, the computation time excluding both synchronization and line search time decreases linearly. The Y-axis in Figure 1 indicates T4/Tn where Tn is the single iteration time with n machines on the Amazon dataset. (a) DFacTo(ALS) (b) DFacTo(GD) Figure 1: The scalability of DFacTo with respect to the number of machines on the Amazon dataset 7 Synthetic Data Experiments We perform two experiments with synthetically generated tensor data. In the first experiment we fix the number of non-zero entries to be 106 and let I = J = K and vary the dimensions of the tensor. For the second experiment we fix the dimensions and let I = J = K and the number of non-zero entries is set to be 2I. The scaling behavior of the three algorithms on these two datasets is summarized in Table 4. Since we used a preferential attachment model to generate the datasets, the non-zero indices exhibit a power law behavior. Consequently, the number of columns with non-zero elements (nnzc(·)) for X1, X2 and X3 is very close to the total number of non-zero entries in the tensor. Therefore, as predicted by theory, DFacTo (ALS, GD) does not enjoy significant speedups when compared to GigaTensor, CPALS and CPOPT. However, it must be noted that DFacto (ALS) is faster than either GigaTensor or CPALS in all but one case and DFacTo (GD) is faster than CPOPT in all cases. We attribute this to better memory locality which arises as a consequence of reusing the memory for N as discussed in Section 3. I = J = K Non-zeros DFacTo (ALS) GigaTensor CPALS DFacTo (GD) CPOPT 104 106 1.14 2.80 5.10 2.32 5.21 105 106 2.72 6.71 6.11 5.87 11.70 106 106 7.26 11.86 16.54 16.51 29.13 107 106 41.64 38.19 175.57 121.30 202.71 104 2 × 104 0.05 0.09 0.52 0.09 0.57 105 2 × 105 0.92 1.61 1.50 1.81 2.98 106 2 × 106 12.06 22.08 15.84 21.74 26.04 107 2 × 107 144.48 251.89 214.37 275.19 324.2 Table 4: Time per iteration (in seconds) on synthetic datasets (non-zeros = 106 or 2I, R=10) Rank Variation Experiments Table 5 shows the time per iteration on various ranks (R) with the NELL-2 dataset. We see that the computation time of our algorithm increases lineraly in R like the time complexity analyzed in Section 3.2. R 5 10 20 50 100 200 500 NELL-2 15.84 31.92 58.71 141.43 298.89 574.63 1498.68 Table 5: Time per iteration (in seconds) on various R 6 Discussion and Conclusion We presented a technique for significantly speeding up the Alternating Least Squares (ALS) and the Gradient Descent (GD) algorithm for tensor factorization by exploiting properties of the Khatri-Rao product. Not only is our algorithm, DFacto, computationally attractive, but it is also more memory efficient compared to existing algorithms. Furthermore, we presented a strategy for distributing the computations across multiple machines. We hope that the availability of a scalable tensor factorization algorithm will enable practitioners to work on more challenging tensor datasets, and therefore lead to advances in the analysis and understanding of tensor data. Towards this end we intend to make our code freely available for download under a permissive open source license. Although we mainly focused on tensor factorization using ALS and GD, it is worth noting that one can extend the basic ideas behind DFacTo to other related problems such as joint matrix completion and tensor factorization. We present such a model in Appendix F. In fact, we believe that this joint matrix completion and tensor factorization model by itself is somewhat new and interesting in its own right, despite its resemblance to other joint models including tensor factorization such as [14]. In our joint model, we are given a user × item ratings matrix Y, and some side information such as a user × item × words tensor X. Preliminary experimental results suggest that jointly factorizing Y and X outperforms vanilla matrix completion. Please see Appendix F for details of the algorithm and some experimental results. 8 References [1] Age Smilde, Rasmus Bro, and Paul Geladi. Multi-way Analysis with Applications in the Chemical Sciences. John Wiley and Sons, Ltd, 2004. [2] Tamara G. Kolda and Brett W. Bader. Tensor decompositions and applications. SIAM Review, 51(3):455–500, 2009. [3] Jure Leskovec, Jon M. Kleinberg, and Christos Faloutsos. Graphs over time: densification laws, shrinking diameters and possible explanations. In KDD, pages 177–187, 2005. [4] J. McAuley and J. Leskovec. Hidden Factors and Hidden Topics: Understanding Rating Dimensions with Review Text. In Proceedings of the 7th ACM Conference on Recommender Systems, pages 165–172, 2013. [5] Alexandros Karatzoglou, Xavier Amatriain, Linas Baltrunas, and Nuria Oliver. Multiverse recommendation: N-dimensional tensor factorization for context-aware collaborative filtering. In Proceeedings of the 4th ACM Conference on Recommender Systems (RecSys), 2010. [6] A. Carlson, J. Betteridge, B. Kisiel, B. Settles, E.R. Hruschka Jr., and T.M. Mitchell. Toward an architecture for never-ending language learning. In In Proceedings of the Conference on Artificial Intelligence (AAAI), 2010. [7] Brett W. Bader and Tamara G. Kolda. Efficient matlab computations with sparse and factored tensors. SIAM Journal on Scientific Computing, 30(1):205–231, 2007. [8] U. Kang, Evangelos E. Papalexakis, Abhay Harpale, and Christos Faloutsos. Gigatensor: scaling tensor analysis up by 100 times - algorithms and discoveries. In Conference on Knowledge Discovery and Data Mining, pages 316–324, 2012. [9] Evrim Acar, Daniel M. Dunlavy, and Tamara G. Kolda. A scalable optimization approach for fitting canonical tensor decompositions. Journal of Chemometrics, 25(2):67–86, February 2011. [10] R. A. Horn and C. R. Johnson. Matrix analysis. Cambridge Univ Press, 1990. [11] Dennis S. Bernstein. Matrix Mathematics. Princeton University Press, 2005. [12] M. Porter. An algorithm for suffix stripping. Program, 14(3):130–137, 1980. [13] A. Barabasi and R. Albert. Emergence of scaling in random networks. Science, 286:509–512, 1999. [14] Evrim Acar, Tamara G. Kolda, and Daniel M. Dunlavy. All-at-once optimization for coupled matrix and tensor factorizations. In MLG’11: Proceedings of Mining and Learning with Graphs, August 2011. 9
2014
344
5,452
Robust Classification Under Sample Selection Bias Anqi Liu Department of Computer Science University of Illinois at Chicago Chicago, IL 60607 aliu33@uic.edu Brian D. Ziebart Department of Computer Science University of Illinois at Chicago Chicago, IL 60607 bziebart@uic.edu Abstract In many important machine learning applications, the source distribution used to estimate a probabilistic classifier differs from the target distribution on which the classifier will be used to make predictions. Due to its asymptotic properties, sample reweighted empirical loss minimization is a commonly employed technique to deal with this difference. However, given finite amounts of labeled source data, this technique suffers from significant estimation errors in settings with large sample selection bias. We develop a framework for learning a robust bias-aware (RBA) probabilistic classifier that adapts to different sample selection biases using a minimax estimation formulation. Our approach requires only accurate estimates of statistics under the source distribution and is otherwise as robust as possible to unknown properties of the conditional label distribution, except when explicit generalization assumptions are incorporated. We demonstrate the behavior and effectiveness of our approach on binary classification tasks. 1 Introduction The goal of supervised machine learning is to use available source data to make predictions with the smallest possible error (loss) on unlabeled target data. The vast majority of supervised learning techniques assume that source (training) data and target (testing) data are drawn from the same distribution over pairs of example inputs and labels, P(x, y), from which the conditional label distribution, P(y|x), is estimated as ˆP(y|x). In other words, data is assumed to be independent and identically distributed (IID). For many machine learning applications, this assumption is not valid; e.g., survey response rates may vary by individuals’ characteristics, medical results may only be available from a non-representative demographic sample, or dataset labels may have been solicited using active learning. These examples correspond to the covariate shift [1] or missing at random [2] setting where the source dataset distribution for training a classifier and the target dataset distribution on which the classifier is to be evaluated depend on the example input values, x, but not the labels, y [1]. Despite the source data distribution, P(y|x)Psrc(x), and the target data distribution, P(y|x)Ptrg(x), sharing a common conditional label probability distribution, P(y|x), all (probabilistic) classifiers, ˆP(y|x), are vulnerable to sample selection bias when the target data and the inductive bias of the classifier trained from source data samples, ˜Psrc(x) ˜P(y|x), do not match [3]. We propose a novel approach to classification that embraces the uncertainty resulting from sample selection bias by producing predictions that are explicitly robust to it. Our approach, based on minimax robust estimation [4, 5], departs from the traditional statistics perspective by prescribing (rather than assuming) a parametric distribution that, apart from matching known distribution statistics, is the worst-case distribution possible for a given loss function. We use this approach to derive the robust bias-aware (RBA) probabilistic classifier. It robustly minimizes the logarithmic loss (logloss) of the target prediction task subject to known properties of data from the source distribution. The parameters of the classifier are optimized via convex optimization to match statistical properties 1 measured from the source distribution. These statistics can be measured without the inaccuracies introduced from estimating their relevance to the target distribution [1]. Our formulation requires any assumptions of statistical properties generalizing beyond the source distribution to be explicitly incorporated into the classifier’s construction. We show that the prevalent importance weighting approach to covariate shift [1], which minimizes a sample reweighted logloss, is a special case of our approach for a particularly strong assumption: that source statistics fully generalize to the target distribution. We apply our robust classification approach on synthetic and UCI binary classification datasets [6] to compare its performance against sample reweighted approaches for learning under sample selection bias. 2 Background and Related Work Under the classical statistics perspective, a parametric model for the conditional label distribution, denoted ˆPθ(y|x), is first chosen (e.g., the logistic regression model), and then model parameters are estimated to minimize prediction loss on target data. When source and target data are drawn from the same distribution, minimizing loss on samples of source data, ˜Psrc(x) ˜P(y|x), argmin θ E ˜ Psrc(x) ˜ P (y|x)[loss( ˆPθ(Y |X), Y )], (1) efficiently converges to the target distribution (Ptrg(x)P(y|x)) loss minimizer. Unfortunately, minimizing the sample loss (1) when source and target distributions differ does not converge to the target loss minimizer. A preferred approach for dealing with this discrepancy is to use importance weighting to estimate the prediction loss under the target distribution by reweighting the source samples according to the target-source density ratio, Ptrg(x)/Psrc(x) [1, 7]. We call this approach sample reweighted loss minimization, or the sample reweighted approach for short in our discussion in this paper. Machine learning research has primarily investigated sample selection bias from this perspective, with various techniques for estimating the density ratio including kernel density estimation [1], discriminative estimation [8], Kullback-Leibler importance estimation [9], kernel mean matching [10, 11], maximum entropy methods [12], and minimax optimization [13]. Despite asymptotic guarantees of minimizing target distribution loss [1] (assuming Ptrg(x) > 0 =⇒Psrc(x) > 0), EPtrg(x)P (y|x)[loss( ˆPθ(Y |X), Y )] = lim n→∞E ˜ P (n) src (x) ˜ P (y|x) Ptrg(X) Psrc(X)loss( ˆPθ(Y |X), Y )     Sample reweighted objective function , (2) Dataset #1 Dataset #2 Figure 1: Datapoints (with ‘+’ and ‘o’ labels) from two source distributions (Gaussians with solid 95% confidence ovals) and the largest data point importance weights, Ptrg(x)/Psrc(x), under the target distributions (Gaussian with dashed 95% confidence ovals). sample reweighting is often extremely inaccurate for finite sample datasets, ˜Psrc(x), when sample selection bias is large [14]. The reweighted loss (2) will often be dominated by a small number of datapoints with large importance weights (Figure 1). Minimizing loss primarily on these datapoints often leads to target predictions with overly optimistic confidence. Additionally, the specific datapoints with large importance weights vary greatly between random source samples, often leading to high variance model estimates. Formal theoretical limitations match these described shortcomings; generalization bounds on learning under sample selection bias using importance weighting have only been established when the first moment of sampled importance weights is bounded, EPtrg(x)[Ptrg(X)/Psrc(X)] < ∞[14], which imposes strong restrictions on the source and target distributions. For example, neither pair of distributions in Figure 1 satisfies this bound because the target distribution has “fatter tails” than the source distribution in some or all directions. Though developed using similar tools, previous minimax formulations of learning under sample selection bias [15, 13] differ substantially from our approach. They consider the target distribution as being unknown and provide robustness to its worst-case assignment. The class of target distributions considered are those obtained by deleting a subset of measured statistics [15] or all possible 2 reweightings of the sample source data [13]. Our approach, in contrast, obtains an estimate for each given target distribution that is robust to all the conditional label distributions matching source statistics. While having an exact or well-estimated target distribution a priori may not be possible for some applications, large amounts of unlabeled data enable this in many batch learning settings. A wide range of approaches for learning under sample selection bias and transfer learning leverage additional assumptions or knowledge to improve predictions [16]. For example, a simple, but effective approach to domain adaptation [17] leverages some labeled target data to learn some relationships that generalize across source and target datasets. Another recent method assumes that source and target data are generated from mixtures of “domains” and uses a learned mixture model to make predictions of target data based on more similar source data [18]. 3 Robust Bias-Aware Approach We propose a novel approach for learning under sample selection bias that embraces the uncertainty inherent from shifted data by making predictions that are explicitly robust to it. This section mathematically formulates this motivating idea. 3.1 Minimax robust estimation formulation Minimax robust estimation [4, 5] advocates for the worst case to be assumed about any unknown characteristics of a probability distribution. This provides a strong rationale for maximum entropy estimation methods [19] from which many familiar exponential family distributions (e.g., Gaussian, exponential, Laplacian, logistic regression, conditional random fields [20]) result by robustly minimizing logloss subject to constraints incorporating various known statistics [21]. Probabilistic classification performance is measured by the conditional logloss (the negative conditional likelihood), loglossPtrg(X)(P(Y |X), ˆP(Y |X))  EPtrg(x)P (y|x)[−log P(Y |X)], of the estimator, ˆP(Y |X), under an evaluation distribution (i.e., the target distribution, Ptrg(X)P(Y |X), for the sample selection bias setting). We assume that a set of statistics, denoted as convex set Ξ, characterize the source distribution, Psrc(x, y). Using this loss function, Definition 1 forms a robust minimax estimate [4, 5] of the conditional label distribution, ˆP(Y |X), using a worst-case conditional label distribution, ˇP(Y |X). Definition 1. The robust bias-aware (RBA) probabilistic classifier is the saddle point solution of: min ˆ P (Y |X)∈Δ max ˇ P (Y |X)∈Δ ∩Ξ loglossPtrg(X)  ˇP(Y |X), ˆP(Y |X)  , (3) where Δ is the conditional probability simplex: ∀x ∈X, y ∈Y : P(y|x) ≥0; y∈Y P(y|x) = 1. This formulation can be interpreted as a two-player game [5] in which the estimator player first chooses ˆP(Y |X) to minimize the conditional logloss and then the evaluation player chooses distribution ˇP(Y |X) from the set of statistic-matching conditional label distributions to maximize conditional logloss. This minimax game reduces to a maximum conditional entropy [19] problem: Theorem 1 ([5]). Assuming Ξ is a set of moment-matching constraints, EPsrc(x) ˆ P (y|x)[f(X, Y )] = c  EPsrc(x)P (y|x)[f(X, Y )], the solution of the minimax logloss game (3) maximizes the target distribution conditional entropy subject to matching statistics on the source distribution: max ˆ P (Y |X)∈Δ HPtrg(x), ˆ P (y|x)(Y |X) such that: EPsrc(x) ˆ P (y|x)[f(X, Y )] = c. (4) Conceptually, the solution to this optimization (4) has low certainty where the target density is high by matching the source distribution statistics primarily where the target density is low. 3.2 Parametric form of the RBA classifier Using tools from convex optimization [22], the solution to the dual of our constrained optimization problem (4) has a parametric form (Theorem 2) with Lagrange multiplier parameters, θ, weighing 3 Logistic regression Reweighted Robust bias-aware Figure 2: Probabilistic predictions from logistic regression, sample reweighted logloss minimization, and robust bias-aware models (§4.1) given labeled data (‘+’ and ‘o’ classes) sampled from the source distribution (solid oval indicating Gaussian covariance) and a target distribution (dashed oval Gaussian covariance) for first-order moment statistics (i.e., f(x, y) = [y yx1 yx2]T ). the feature functions, f(x, y), that constrain the conditional label distribution estimate (4) (derivation in Appendix A). The density ratio, Psrc(x)/Ptrg(x), scales the distribution’s prediction certainty to increase when the ratio is large and decrease when it is small. Theorem 2. The robust bias-aware (RBA) classifier for target distribution Ptrg(x) estimated from statistics of source distribution Psrc(x) has a form: ˆPθ(y|x) = e Psrc(x) Ptrg(x) θ·f(x,y) y∈Y e Psrc(x) Ptrg(x) θ·f(x,y) , (5) which is parameterized by Lagrange multipliers θ. The Lagrangian dual optimization problem selects these parameters to maximize the target distribution log likelihood: maxθ EPtrg(x)P (y|x)[log ˆPθ(Y |X)]. Unlike the sample reweighting approach, our approach does not require that target distribution support implies source distribution support (i.e., Ptrg(x) > 0 =⇒Psrc(x) > 0 is not required). Where target support vanishes (i.e., Ptrg(x) →0), the classifier’s prediction is extremely certain, and where source support vanishes (i.e., Psrc(x) = 0), the classifier’s prediction is a uniform distribution. The critical difference in addressing sample selection bias is illustrated in Figure 2. Logistic regression and sample reweighted loss minimization (2) extrapolate in the face of uncertainty to make strong predictions without sufficient supporting evidence, while the RBA approach is robust to uncertainty that is inherent when learning from finite shifted data samples. In this example, prediction uncertainty is large at all tail fringes of the source distribution for the robust approach. In contrast, there is a high degree of certainty for both the logistic regression and sample reweighted approaches in portions of those regions (e.g., the bottom left and top right). This is due to the strong inductive biases of those approaches being applied to portions of the input space where there is sparse evidence to support them. The conceptual argument against this strong inductive generalization is that the labels of datapoints in these tail fringe regions could take either value and negligibly affect the source distribution statistics. Given this ambiguity, the robust approach suggests much more agnostic predictions. The choice of statistics, f(x, y) (also known as features), employed in the model plays a much different role in the RBA approach than in traditional IID learning methods. Rather than determining the manner in which the model generalizes, as in logistic regression, features should be chosen that prevent the robust model from “pushing” all of its certainty away from the target distribution. This is illustrated in Figure 3. With only first moment constraints, the predictions in the denser portions of the target distribution have fairly high uncertainty under the RBA method. The larger number of constraints enforced by the second-order mixed moment statistics preserve more of the original distribution using the RBA predictions, leading to higher certainty in those target regions. 4 Logistic regression Reweighted Robust bias-aware First moment Second moment Figure 3: The prediction setting of Figure 2 with partially overlapping source and target densities for first-order (top) and second-order (bottom) mixed-moments statistics (i.e., f(x, y) = [y yx1 yx2 yx2 1 yx1x2 yx2 2]T ). Logistic regression and the sample reweighted approach make high-certainty predictions in portions of the input space that have high target density. These predictions are made despite the sparseness of sampled source data in those regions (e.g., the upper-right portion of the target distribution). In contrast, the robust approach “pushes” its more certain predictions to areas where the target density is less. 3.3 Regularization and parameter estimation In practice, the characteristics of the source distribution, Ξ, are not precisely known. Instead, empirical estimates for moment-matching constraints, ˜c  E ˜ Psrc(x) ˜ P (y|x)[f(X, Y )], are available, but are prone to sampling error. When the constraints of (4) are relaxed using various convex norms, ||˜c−E ˜ Psrc(x) ˆ P (y|x)[f(X, Y )]|| ≤, the RBA classifier is obtained by 1- or 2-regularized maximum conditional likelihood estimation (Theorem 2) of the dual optimization problem [23, 24], θ = argmax θ EPtrg(x)P (y|x) log ˆPθ(Y |X) − ||θ|| . (6) The regularization parameters in this approach can be chosen using straight-forward bounds on finite sampling error [24]. In contrast, the sample reweighted approach to learning under sample selection bias [1, 7] also makes use of regularization [9], but appropriate regularization parameters for it must be haphazardly chosen based on how well the source samples represent the target data. Maximizing this regularized target conditional likelihood (6) appears difficult because target data from Ptrg(x)P(y|x) is unavailable. We avoid the sample reweighted approach (2) [1, 7], due to its inaccuracies when facing distributions with large differences in bias given finite samples. Instead, we use the gradient of the regularized target conditional likelihood and only rely on source samples adequately approximating the source distribution statistics (a standard assumption for IID learning): ∇θEPtrg(x)P (y|x)[log ˆPθ(Y |X)] = ˜c −E ˜ Psrc(x) ˆ P (y|x)[f(X, Y )]. (7) Algorithm 1 is a batch gradient algorithm for parameter estimation under our model. It does not require objective function calculations and converges to a global optimum due to convexity [22]. 5 Algorithm 1 Batch gradient for robust bias-aware classifier learning. Input: Dataset {(xi, yi)}, source density Psrc(x), target density Ptrg(x), feature function f(x, y), measured statistics ˜c, (decaying) learning rate {γt}, regularizer , convergence threshold τ Output: Model parameters θ θ ←0 repeat ψ(xi, y) ←Psrc(x) Ptrg(x)θ · f(xi, y) for all: dataset examples i, labels y ˆP(Yi = y|xi) ← eψ(xi,y)  y eψ(xi,y) for all: dataset examples i, labels y ∇L ←˜c −1 N N i=1 y∈Y ˆP(Yi = y|xi) f(xi, y) θ ←θ + γt(∇L + ∇θ||θ||) until ||∇θ||θ|| + ∇L|| ≤τ return θ 3.4 Incorporating expert knowledge and generalizing the reweighted approach In many settings, expert knowledge may be available to construct the constraint set Ξ instead of, or in addition to, statistics ˜c  E ˜ Psrc(x) ˜ P (y|x)[f(X, Y )] estimated from source data. Expert-provided source distributions, feature functions, and constraint statistic values, respectfully denoted P  src(x), f (x, y), and c, can be specified to express a range of assumptions about the conditional label distribution and how it generalizes. Theorem 3 establishes that for empirically-based constraints provided by the expert, EPtrg(x) ˆ P (y|x)[f(X, Y )] = ˜c  E ˜ Psrc(x) ˜ P (y|x)[(Ptrg(X)/Psrc(X))f(X, Y )], corresponding to strong source-to-target feature generalization assumptions, P  src(x)  Ptrg(x), reweighted logloss minimization is a special case of our robust bias-aware approach. Theorem 3. When direct feature generalization of reweighting source samples to the target distribution is assumed, the constraints become EPtrg(x) ˆ P (y|x)[f(X, Y )] = ˜c  E ˜ Psrc(x) ˜ P (y|x) Ptrg(X) Psrc(X)f(X, Y ) and the RBA classifier minimizes sample reweighted logloss (2). This equivalence suggests that if there is expert knowledge that reweighted source statistics are representative of the target distribution, then these strong generalization assumptions should be included as constraints in the RBA predictor and results in the sample reweighted approach1. Figure 4: The robust estimation setting of Figure 3 (bottom, right) with assumed Gaussian feature distribution generalization (dashed-dotted oval) incorporated into the density ratio. Three increasingly broad generalization distributions lead to reduced target prediction uncertainty. Weaker expert knowledge can also be incorporated. Figure 4 shows various assumptions of how widely sample reweighted statistics are representative across the input space. As the generalization assumptions are made to align more closely with the target distribution (Figure 4), the regions of uncertainty shrink substantially. 1Similar to the previous section, relaxed constraints ||˜c −E ˜ Psrc(x) ˆ P (y|x)[f(X, Y )]|| ≤, are employed in practice and parameters are obtained by maximizing the regularized conditional likelihood as in (6). 6 4 Experiments and Comparisons 4.1 Comparative approaches and implementation details We compare three approaches for learning classifiers from biased sample source data: (a) source logistic regression maximizes conditional likelihood on the source data, maxθ E ˜ Psrc(x) ˜ P (y|x)[log Pθ(Y |X) −||θ||]; (b) sample reweighted target logistic regression minimizes the conditional likelihood of source data reweighted to the target distribution (2), maxθ E ˜ Psrc(x) ˜ P (y|x)[(Ptrg(x)/Psrc(x)) log Pθ(Y |X) −||θ||]; and robust bias-aware classification robustly minimizes target distribution logloss (5) trained using direct gradient calculations (7). As statistics/features for these approaches, we consider nth order uni-input moments, e.g., yx1, yx2 2, yxn 3, . . ., and mixed moments, e.g., yx1, yx1x2, yx2 3x5x6, . . .. We employ the CVX package [25] to estimate parameters of the first two approaches and batch gradient ascent (Algorithm 1) for our robust approach. 4.2 Empirical performance evaluations and comparisons We empirically compare the predictive performance of the three approaches. We consider four classification datasets, selected from the UCI repository [6] based on the criteria that each contains roughly 1,000 or more examples, has discretely-valued inputs, and has minimal missing values. We reduce multi-class prediction tasks into binary prediction tasks by combining labels into two groups based on the plurality class, as described in Table 1. Table 1: Datasets for empirical evaluation Dataset Features Examples Negative labels Positive labels Mushroom 22 8,124 Edible Poisonous Car 6 1,728 Not acceptable all others Tic-tac-toe 9 958 ‘X’ does not win ‘X’ wins Nursery 8 12,960 Not recommended all others We generate biased subsets of these classification datasets to use as source samples and unbiased subsets to use as target samples. We create source data bias by sampling a random likelihood function from a Dirichlet distribution and then sample source data without replacement in proportion to each datapoint’s likelihood. We stress the inherent difficulties of the prediction task that results; label imbalance in the source samples is common, despite sampling independently from the example label (given input values) due to source samples being drawn from focused portions of the input space. We combine the likelihood function and statistics from each sample to form na¨ıve source and target distribution estimates. The complete details are described in Appendix C, including bounds imposed on the source-target ratios to limit the effects of inaccuracies from the source and target distribution estimates. We evaluate the source logistic regression model, the reweighted maximum likelihood model, and our bias-adaptive robust approach. For each, we use first-order and second-order non-mixed statistics: x2 1y, x2 2y, . . . , x2 Ky, x1y, x2y, . . . , xKy. For each dataset, we evaluate target distribution logloss, E ˜ Ptrg(x) ˜ P (y|x)[−log ˆP(Y |X)], averaged over 50 random biased source and unbiased target samples. We employ log2 for our loss, which conveniently provides a baseline logloss of 1 for a uniform distribution. We note that with exceedingly large regularization, all parameters will be driven to zero, enabling each approach to achieve this baseline level of logloss. Unfortunately, since target labels are assumed not to be available in this problem, obtaining optimal regularization via crossvalidation is not possible. After trying a range of 2-regularization weights (Appendix C), we find that heavy 2-regularization is needed for the logistic regression model and the reweighted model in our experiments. Without this heavy regularization, the logloss is often extremely high. In contrast, heavy regularization for the robust approach is not necessary; we employ only a mild amount of 2-regularization corresponding to source statistic estimation error. We show a comparison of individual predictions from the reweighted approach and the robust approach for the Car dataset on the left of Figure 5. The pairs of logloss measures for each of the 50 7 Figure 5: Left: Log-loss comparison for 50 source and target distribution samples between the robust and reweighted approaches for the Car classification task. Right: Average logloss with 95% confidence intervals for logistic regression, reweighted logistic regression, and bias-adaptive robust target classifier on four UCI classification tasks. sampled source and target datasets are shown in the scatter plot. For some of the samples, the inductive biases of the reweighted approach provide better predictions (left of the dotted line). However, for many of the samples, the inductive biases do not fit the target distribution well and this leads to much higher logloss. The average logloss for each approach and dataset is shown on the right of Figure 5. The robust approach provides better performance than the baseline uniform distribution (logloss of 1) with statistical significance for all datasets. For the first three datasets, the other two approaches are significantly worse than this baseline. The confidence intervals for logistic regression and the reweighted model tend to be significantly larger than the robust approach because of the variability in how well their inductive biases generalize to the target distribution for each sample. However, the robust approach is not a panacea for all sample selection bias problems; the No Free Lunch theorem [26] still applies. We see this with the Nursery dataset, in which the inductive biases of the logistic regression and reweighted approaches do tend to hold across both distributions, providing better predictions. 5 Discussion and Conclusions In this paper, we have developed a novel minimax approach for probabilistic classification under sample selection bias. Our approach provides the parametric distribution (5) that minimizes worstcase logloss (Def. 1), and that can be estimated as a convex optimization problem (Alg. 1). We showed that sample reweighted logloss minimization [1, 7] is a special case of our approach using very strong assumptions about how statistics generalize to the target distribution (Thm. 3). We illustrated the predictions of our approach in two toy settings and how those predictions compare to the more-certain alternative methods. We also demonstrated consistent “better than uninformed” prediction performance using four UCI classification datasets—three of which prove to be extremely difficult for other sample selection bias approaches. We have treated density estimation of the source and target distributions, or estimating their ratios, as an orthogonal problem in this work. However, we believe many of the density estimation and density ratio estimation methods developed for sample reweighted logloss minimization [1, 8, 9, 10, 11, 12, 13] will prove to be beneficial in our bias-adaptive robust approach as well. We additionally plan to investigate the use of other loss functions and extensions to other prediction problems using our robust approach to sample selection bias. Acknowledgments This material is based upon work supported by the National Science Foundation under Grant No. #1227495, Purposeful Prediction: Co-robot Interaction via Understanding Intent and Goals. 8 References [1] Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the loglikelihood function. Journal of Statistical Planning and Inference, 90(2):227–244, 2000. [2] Roderick J. A. Little and Donald B. Rubin. Statistical Analysis with Missing Data. John Wiley & Sons, Inc., New York, NY, USA, 1986. [3] Wei Fan, Ian Davidson, Bianca Zadrozny, and Philip S. Yu. An improved categorization of classifier’s sensitivity on sample selection bias. In Proc. of the IEEE International Conference on Data Mining, pages 605–608, 2005. [4] Flemming Topsøe. Information theoretical optimization techniques. Kybernetika, 15(1):8–27, 1979. [5] Peter D. Gr¨unwald and A. Phillip Dawid. Game theory, maximum entropy, minimum discrepancy, and robust Bayesian decision theory. Annals of Statistics, 32:1367–1433, 2004. [6] Kevin Bache and Moshe Lichman. UCI machine learning repository, 2013. [7] Bianca Zadrozny. Learning and evaluating classifiers under sample selection bias. In Proceedings of the International Conference on Machine Learning, pages 903–910. ACM, 2004. [8] Steffen Bickel, Michael Br¨uckner, and Tobias Scheffer. Discriminative learning under covariate shift. Journal of Machine Learning Research, 10:2137–2155, 2009. [9] Masashi Sugiyama, Shinichi Nakajima, Hisashi Kashima, Paul V. Buenau, and Motoaki Kawanabe. Direct importance estimation with model selection and its application to covariate shift adaptation. In Advances in Neural Information Processing Systems, pages 1433–1440, 2008. [10] Jiayuan Huang, Alexander J. Smola, Arthur Gretton, Karsten M. Borgwardt, and Bernhard Schlkopf. Correcting sample selection bias by unlabeled data. In Advances in Neural Information Processing Systems, pages 601–608, 2006. [11] Yaoliang Yu and Csaba Szepesv´ari. Analysis of kernel mean matching under covariate shift. In Proc. of the International Conference on Machine Learning, pages 607–614, 2012. [12] Miroslav Dud´ık, Robert E. Schapire, and Steven J. Phillips. Correcting sample selection bias in maximum entropy density estimation. In Advances in Neural Information Processing Systems, pages 323–330, 2005. [13] Junfeng Wen, Chun-Nam Yu, and Russ Greiner. Robust learning under uncertain test distributions: Relating covariate shift to model misspecification. In Proc. of the International Conference on Machine Learning, pages 631–639, 2014. [14] Corinna Cortes, Yishay Mansour, and Mehryar Mohri. Learning bounds for importance weighting. In Advances in Neural Information Processing Systems, pages 442–450, 2010. [15] Amir Globerson, Choon Hui Teo, Alex Smola, and Sam Roweis. An adversarial view of covariate shift and a minimax approach. In Joaquin Qui˜nonero-Candela, Mashashi Sugiyama, Anton Schwaighofer, and Neil D. Lawrence, editors, Dataset Shift in Machine Learning, pages 179–198. MIT Press, Cambridge, MA, USA, 2009. [16] Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering, 22(10):1345–1359, 2010. [17] Hal Daum´e III. Frustratingly easy domain adaptation. In Conference of the Association for Computational Linguistics, pages 256–263, 2007. [18] Boqing Gong, Kristen Grauman, and Fei Sha. Reshaping visual datasets for domain adaptation. In Advances in Neural Information Processing Systems, pages 1286–1294, 2013. [19] Edwin T. Jaynes. Information theory and statistical mechanics. Physical Review, 106:620–630, 1957. [20] John Lafferty, Andrew McCallum, and Fernando Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Proc. of the International Conference on Machine Learning, pages 282–289, 2001. [21] Martin J. Wainwright and Michael I. Jordan. Graphical models, exponential families, and variational inference. Foundations and Trends in Machine Learning, 1(1-2):1–305, 2008. [22] Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, 2004. [23] Miroslav Dud´ık and Robert E. Schapire. Maximum entropy distribution estimation with generalized regularization. In Learning Theory, pages 123–138. Springer Berlin Heidelberg, 2006. [24] Yasemin Altun and Alex Smola. Unifying divergence minimization and statistical inference via convex duality. In Learning Theory, pages 139–153. Springer Berlin Heidelberg, 2006. [25] Michael Grant and Stephen Boyd. CVX: Matlab software for disciplined convex programming, version 2.1. http://cvxr.com/cvx, March 2014. [26] David H. Wolpert. The lack of a priori distinctions between learning algorithms. Neural Comput., 8(7):1341–1390, 1996. 9
2014
345
5,453
Deep Joint Task Learning for Generic Object Extraction Xiaolong Wang1,4, Liliang Zhang1, Liang Lin1,3∗, Zhujin Liang1, Wangmeng Zuo2 1Sun Yat-sen University, Guangzhou 510006, China 2School of Computer Science and Technology, Harbin Institute of Technology, China 3SYSU-CMU Shunde International Joint Research Institute, Shunde, China 4The Robotics Institute, Carnegie Mellon University, Pittsburgh, U.S. xlwang@cmu.edu, linliang@ieee.org Abstract This paper investigates how to extract objects-of-interest without relying on handcraft features and sliding windows approaches, that aims to jointly solve two subtasks: (i) rapidly localizing salient objects from images, and (ii) accurately segmenting the objects based on the localizations. We present a general joint task learning framework, in which each task (either object localization or object segmentation) is tackled via a multi-layer convolutional neural network, and the two networks work collaboratively to boost performance. In particular, we propose to incorporate latent variables bridging the two networks in a joint optimization manner. The first network directly predicts the positions and scales of salient objects from raw images, and the latent variables adjust the object localizations to feed the second network that produces pixelwise object masks. An EM-type method is presented for the optimization, iterating with two steps: (i) by using the two networks, it estimates the latent variables by employing an MCMC-based sampling method; (ii) it optimizes the parameters of the two networks unitedly via back propagation, with the fixed latent variables. Extensive experiments suggest that our framework significantly outperforms other state-of-the-art approaches in both accuracy and efficiency (e.g. 1000 times faster than competing approaches). 1 Introduction One typical vision problem usually comprises several subproblems, which tend to be tackled jointly to achieve superior capability. In this paper, we focus on a general joint task learning framework based on deep neural networks, and demonstrate its effectiveness and efficiency on generic (i.e., category-independent) object extraction. Generally speaking, two sequential subtasks are comprised in object extraction: rapidly localizing the objects-of-interest from images and further generating segmentation masks based on the localizations. Despite acknowledged progresses, previous approaches often tackle these two tasks independently, and most of them applied sliding windows over all image locations and scales [17, 22], which could limit their performances. Recently, several works [33, 18, 5] utilized the interdependencies of object localization and segmentation, and showed promising results. For example, Yang et al. [33] introduced a joint framework for object segmentations, in which the segmentation benefits from the object detectors and the object detections are in consistent with the underlying segmentation of the ∗Corresponding author is Liang Lin. This work was supported by the National Natural Science Foundation of China (no.61173082), the Hi-Tech Research and Development Program of China (no.2012AA011504), Guangdong Science and Technology Program (no. 2012B031500006), Special Project on Integration of Industry, Educationand Research of Guangdong (no.2012B091000101), and Fundamental Research Funds for the Central Universities (no.14lgjc11). 1 image. However, these methods still rely on the exhaustively searching to localize objects. On the other hand, deep learning methods have achieved superior capabilities in classification [21, 19, 23] and representation learning [4], and they also demonstrate good potentials on several complex vision tasks [29, 30, 20, 25]. Motivated by these works, we build a deep learning architecture to jointly solve the two subtasks in object extraction, in which each task (either object localization or object segmentation) is tackled by a multi-layer convolutional neural network. Specifically, the first network (i.e., localization network) directly predicts the positions and scales of salient objects from raw images, upon which the second network (i.e., segmentation network) generates the pixelwise object masks. (a) (b) Groundtruth Mask Segmentation Results Groundtruth Mask Segmentation Results Figure 1: Motivation of introducing latent variables in object extraction. Treating predicted object localizations (the dashed red boxes) as the inputs for segmentation may lead to unsatisfactory segmentation results, and we can make improvements by enlarging or shrinking the localizations (the solid blue boxes) with the latent variables. Two examples are shown in (a) and (b), respectively. Rather than being simply stacked up, the two networks are collaboratively integrated with latent variables to boost performance. In general, the two networks optimized for different tasks might have inconsistent interests. For example, the object localizations predicted by the first network probably indicate incomplete object (foreground) regions or include a lot of backgrounds, which may lead to unsatisfactory pixelwise segmentation. This observation is well illustrated in Fig. 1, where we can obtain better segmentation results through enlarging or shrinking the input object localizations (denoted by the bounding boxes). To overcome this problem, we propose to incorporate the latent variables between the two networks explicitly indicating the adjustments of object localizations, and jointly optimize them with learning the parameters of networks. It is worth mentioning that our framework can be generally extended to other applications of joint tasks in similar ways. For concise description, we use the term “segmentation reference” to represent the predicted object localization plus the adjustment in the following. For the framework training, we present an EM-type algorithm, which alternately estimates the latent variables and learns the network parameters. The latent variables are treated as intermediate auxiliary during training: we search for the optimal segmentation reference, and back tune the two networks accordingly. The latent variable estimation is, however, non-trivial in this work, as it is intractable to analytically model the distribution of segmentation reference. To avoid exhaustively enumeration, we design a data-driven MCMC method to effectively sample the latent variables, inspired by [24, 31]. In sum, we conduct the training algorithm iterating with two steps: (i) Fixing the network parameters, we estimate the latent variables and determine the optimal segmentation reference under the sampling method. (ii) Fixing the segmentation reference, the segmentation network can be tuned according to the pixelwise segmentation errors, while the localization network tuned by taking the adjustment of object localizations into account. 2 Related Works Extracting pixelwise objects-of-interest from an image, our work is related to the salient region/object detections [26, 9, 10, 32]. These methods mainly focused on feature engineering and graph-based segmentation. For example, Cheng et al. [9] proposed a regional contrast based saliency extraction algorithm and further segmented objects by applying an iterative version of GrabCut. Some approaches [22, 27] trained object appearance models and utilized spatial or geometric priors to address this task. Kuettel et al. [22] proposed to transfer segmentation masks from training data 2 into testing images by searching and matching visually similar objects within the sliding windows. Other related approaches [28, 7] simultaneously processed a batch of images for object discovery and co-segmentation, but they often required category information as priors. Recently resurgent deep learning methods have also been applied in object detection and image segmentation [30, 14, 29, 20, 11, 16, 2, 25]. Among these works, Sermanet et al. [29] detected objects by training category-level convolutional neural networks. Ouyang et al. [25] proposed to combine multiple components (e.g., feature extraction, occlusion handling, and classification) within a deep architecture for human detection. Huang et al. [20] presented the multiscale recursive neural networks for robust image segmentation. These mentioned methods generally achieved impressive performances, but they usually rely on sliding detect windows over scales and positions of testing images. Very recently, Erhan et al. [14] adopted neural networks to recognize object categories while predicting potential object localizations without exhaustive enumeration. This work inspired us to design the first network to localize objects. To the best of our knowledge, our framework is original to make the different tasks collaboratively optimized by introducing latent variables together with network parameter learning. 3 Deep Model In this section, we introduce a joint deep model for object extraction(i.e., extracting the segmentation mask for a salient object in the image). Our model is presented as comprising two convolutional neural networks: localization network and segmentation network, as shown in Fig. 2. Given an image as input, our first network can generate a 4-digit output, which specifies the salient object bounding box(i.e. the object localization). With the localization result, our segmentation network can extract a m×m binary mask for segmentation in its last layer. Both of these networks are stacked up by convolutional layers, max-pooling operators and full connection layers. In the following, we introduce the detailed definitions for these two networks. 224x224 x3 Convolution Layers 4096 4 256 50x50 Outputs Image Full Connection Layers Cropped, Resized Image Full Connection Layer 55x55 x3 Convolution Layers Three Layers One Layer Five Layers Four Layers Localization Network Segmentation Network Figure 2: The architecture of our joint deep model. It is stacked up by two convolutional neural networks: localization network and segmentation network. Given an image, we can generate its object bounding box and further extract its segmentation mask accordingly. Localization Network. The architecture of the localization network contains eight layers: five convolutional layers and three full connection layers. For the parameters setting of the first seven layers, we refer to the network used by Krizhevsky et al. [21]. It takes an image with size 224×224× 3 as input, where each dimension represents height, width and channel numbers. The eighth layer of the network contains 4 output neurons, indicating the coordinates (x1, y1, x2, y2) of a salient object bounding box. Note that the coordinates are normalized w.r.t. image dimensions into the range of 0 ∼224. Segmentation Network. Our segmentation network is a five-layer neural network with four convolutional layers and one full connection layer. To simplify the description, we denote C(k, h×w×c) as a convolutional layer, where k represents kernel numbers, and h, w, c represent the height, width and channel numbers for each kernel. We also denote FC as a full connection layer, RN as a response normalization layer, and MP as a max-pooling layer. The size of max-pooling operator is set as 3 × 3 and the stride for pooling is 2. Then the network architecture can be described as: C(256, 5 × 5 × 3) −RN −MP −C(384, 3 × 3 × 256) −C(384, 3 × 3 × 384) −C(256, 3 × 3 × 384) −MP −FC. Taking an image with size 55 × 55 × 3 as input, the segmentation network generates a binary mask with size 50 × 50 as the output from its full connection layer. We then introduce the inference process as object extraction. Formally, we define the parameters of the localization network and segmentation network as ωl and ωs, respectively. Given an input image Ii, we first resize it to 224×224×3 as the input for the localization network. Then the output 3 of this network via forward propagation is represented as Fωl(Ii), which indicates a 4-dimension vector bi for the salient object bounding box. We crop the image data for salient object according to bi, and resize it to 55 × 55 × 3 as the input for the segmentation network. By performing forward propagation, the output for segmentation network is represented as Fωs(Ii, bi), which is a vector with 50 × 50 = 2500 dimensions, indicating the binary segmentation result for object extraction. 4 Learning Algorithm We propose a joint deep learning approach to estimate the parameters of two networks. As the object bounding boxes indicated by groundtruth object mask might not provide the best references for segmentation, we embed this domain-specific prior as latent variables in learning. We adjust the object bounding boxes via the latent variables to mine optimal segmentation references for training. For optimization, an EM-type algorithm is proposed to iteratively estimate the latent variables and the model parameters. 4.1 Optimization Formulation Suppose a set of N training images are I = {I1, ..., IN}, the segmentation masks for the salient objects in them are Y = {Y1, ..., YN}. For each Yi, we use Y j i to represent its jth pixel, and Y j i = 1 indicates the foreground, while Y j i = 0 the background. According to the given object masks Y , we can obtain the object bounding boxes around them tightly as L = {L1, ..., LN}, where Li is a 4-dimensional vector representing the coordinates (x1, y1, x2, y2). For each sample, we introduce a latent variable ∆Li as the adjustment for Li. We name the adjusted bounding box as segmentation reference, which is represented as eLi = Li + ∆Li. The learning objective is defined as maximizing the probability: P(ωl, ωs, eL|Y, I) = P(ωl, eL|Y, I)P(ωs, eL|Y, I), (1) where we need to jointly optimize the model parameters ωl,ωs, and the segmentation references eL = {eL1, ..., eLN} indicated by the latent variables. The probability P(ωl, ωs, eL|Y, I) can be decomposed into the probability for localization network P(ωl, eL|Y, I) and the one for segmentation network P(ωs, eL|Y, I). For the localization network, we optimize the model parameters by minimizing the Euclidean distance between the output Fωl(Ii) and the segmentation reference eLi = Li + ∆Li. Thus the probability for ωl and eL can be represented as, P(ωl, eL|Y, I) = 1 Z exp(− N ∑ i=1 ||Fωl(Ii) −Li −∆Li||2 2), (2) where Z is a normalization term. For the segmentation network, we specify each neuron of the last layer as a binary classification output. Then the parameters ωs are estimated via logistic regression, P(ωs, eL|Y, I) = N ∏ i=1 ( ∏ {j|Y j i =1} F j ωs(Ii, Li + ∆Li) · ∏ {j|Y j i =0} (1 −F j ωs(Ii, Li + ∆Li))) (3) where F j ωs(Ii, Li +∆Li) is the jth element of the network output, given image Ii and segmentation reference Li + ∆Li as input. To optimize the model parameters and latent variables, the maximization of probability P(ωl, ωs, eL|Y, I) equals to minimizing the cost as, J(ωl, ωs, eL) = −1 N log P(ωl, ωs, eL|Y, I) (4) ∝ 1 N N ∑ i=1 [ ||Fωl(Ii) −Li −∆Li||2 2 (5) − ∑ j (Y j i log F j ωs(Ii, Li + ∆Li) + (1 −Y j i ) log(1 −F j ωs(Ii, Li + ∆Li))) ], (6) 4 where the first term (5) represents the cost for localization network training and the second term (6) is the cost for segmentation network training. 4.2 Iterative Joint Optimization We propose an EM-type algorithm to optimize the learning cost J(ωl, ωs, eL) . As Fig. 3 illustrates, it includes two iterative steps: (i) fixing the model parameters, apply MCMC based sampling to estimate the latent variables which indicate the segmentation references eL; (ii) given the segmentation references, compute the model parameters of two networks jointly via back propagation. We explain these two steps as following. … … Localizaon Network Segmentaon Network k = 1 k = 2 k = K k = 1 k = 2 k = K Logistic Regression Square Error Minimization Selected Target for Localization Selected Segmentation Result Figure 3: The Em-type learning algorithm with two steps:(i) K moves of MCMC sampling (gray arrows), the latent variables ∆Li is sampled with considering both the localization costs (indicated by the dashed gray arrow) and segmentation costs. (ii) Given the segmentation reference and result after K moves of sampling, we apply back propagation (blue arrows) to estimate parameters of both networks. (i) Latent variables estimation. Given a training image Ii and current model parameters, we estimate the latent variables ∆Li. As there is no groundtruth labels for latent variables, it is intractable to estimate the distribution of them. It is also time-consuming by enumerating ∆Li for evaluation given the large searching space. Thus we propose a MCMC Metropolis-Hastings method [24] for latent variables sampling, which is processed in K moves. In each step, a new latent variable is sampled from the proposal distribution and it is accepted with an acceptance rate. For fast and effective searching, we design the proposal distribution with a data driven term based on the fact that the segmentation boundaries are often aligned with the boundaries of superpixels [1] generated from over-segmentation. We first initialize the latent variable as ∆Li = 0. To find a better latent variable ∆L′ i and achieve a reversible transition, we define the acceptance rate of the transition from ∆Li to ∆L′ i as, α(∆Li →∆L′ i) = min(1, π(∆L′ i) · q(∆L′ i →∆Li) π(∆Li) · q(∆Li →∆L′ i)), (7) where π(∆Li) is the invariant distribution and q(∆Li →∆L′ i) is the proposal distribution. By replacing the dataset with a single sample in Eq. (1), we define the invariant distribution as π(∆Li) = P(ωl, ωs, eLi|Yi, Ii), which can be decomposed into two probabilities: P(ωl, eLi|Yi, Ii) constrains the segmentation reference to be close to the output of the localization network; P(ωs, eLi|Yi, Ii) encourages a segmentation reference contributing to a better segmentation mask. To calculate these probabilities, we need to perform forward propagations in both networks. The proposal distribution is defined as a combination of a gaussian distribution and a data-driven term as, q(∆Li →∆L′ i) = N(∆L′ i|µi, Σi) · Pc(∆L′ i|Yi, Ii), (8) where µi and Σi is the mean vector and covariance matrix for the optimal ∆L′ i in the previous iterations. It is based on the observation that the current optimal ∆L′ i has high possibility for being selected before. For the data driven term Pc(∆L′ i|Yi, Ii), it is computed depending on the given 5 image Ii. After over-segmenting Ii into superpixels, we define vj = 1 if the jth image pixel is on the boundary of a superpixel and vj = 0 if it is inside a superpixel. We then sample c pixels along the segmentation reference eL′ i = Li +∆L′ i in equal distance, then the data driven term is represented as Pc(∆L′|Y, I) = 1 c ∑c j=1 vj. Thus we encourage to avoid cutting through the possible foreground superpixels with the bounding box edges, which leads to more plausible proposals. We set c = 200 in our experiment, and we only need to perform over-segmentation for superpixels once as preprocessing for training. (ii) Model parameters estimation. As it is shown in Fig. 3, given the optimal latent variable ∆L after K moves of sampling, we can obtain the corresponding segmentation references eL and the segmentation results. Then the parameters for segmentation network ωs is optimized via back propagation with logistic regression(as the second term (6) for Eq. (4)), and the parameters for localization network ωl is tuned by minimizing the square error between the segmentation references and the localization output(as the first term (5) for Eq. (4)). During back propagation, we apply the stochastic gradient descent to update the model parameters. For the segmentation network, we use an equal learning rate for all layers as ϵ1. For localization, we first pre-train the network discriminatively for classifying 1000 object categories in the Imagenet dataset [12]. With the pre-training, we can borrow the information learned from a large dataset to improve our performance. We maintain the parameters of the convolutional layers and reset the parameters of full connection layer randomly as initialization. The learning rate is set as ϵ2 for the full connection layers and ϵ2/100 for the convolutional layers. 5 Experiment We validate our approach on the Saliency dataset [9, 8] and a more challenging dataset newly collected by us, namely Object Extraction(OE) dataset1. We compare our approach with state-of-the-art methods and empirical analyses are also presented in the experiment. The Saliency dataset is a combination of THUR15000 [8] and THUS10000 [9] datasets, which includes 16233 images with pixelwise groundtruth masks. Most of the images contain one salient object, and we do not utilize the category information in training and testing. We randomly split the dataset into 14233 images for training and 2000 images for testing. The OE dataset collected by us is more comprehensive, including 10183 images with groundtruth masks. We select the images from the PASCAL [15], iCoseg [3], Internet [28] datasets as well as other data (most of them are about people and clothes) from the web. Compared to the traditional segmentation dataset, the salient objects in the OE dataset are more variant in appearance and shape(or pose) and they often appear in complicated scene with background clutters. For the evaluation in the OE dataset, 8230 samples are randomly selected for training and the remaining 1953 ones are applied in testing. Experiment Settings. During training, the domain of each element in the 4-dimension latent variable vector ∆Li is set to [−10, −5, 0, 5, 10], thus there are 54 = 625 possible proposals for each ∆Li. We set the number of MCMC sampling moves as K = 20 during searching. The learning rate is ϵ1 = 1.0 × 10−6 for the segmentation network and ϵ2 = 1.0 × 10−8 for the localization network. For testing, as each pixelwise output of our method is well discriminated to the number around 1 or 0, we simply classify it as foreground or background by setting a threshold 0.5. The experiments are performed on a desktop with an Intel I7 3.7GHz CPU, 16GB RAM and GTX TITAN GPU. 5.1 Results and Comparisons We now quantitatively evaluate the performance of our method. For evaluation metric, we adopt the Precision, P(the average number of pixels which are correctly labeled in both foreground and background) and Jaccard similarity, J(the average intersection-over-union score: S∩G S∪G, where S is the foreground pixels obtained via our algorithm and G is the groundtruth foreground pixels). We then compare the results of our approach with machine learning based methods such as figureground segmentation [22], CPMC [6] and Object Proposals [13]. As CPMC and Object Proposals generates multiple ranked segments intended to cover objects, we follow the process applied in [22] to evaluate its result. We use the union of the top K ranked segments as salient object prediction. 1http://vision.sysu.edu.cn/projects/deep-joint-task-learning/ 6 Ours(full) Ours(sim) FgSeg [22] CPMC [6] ObjProp [13] HS [32] GC [10] RC [9] HC [9] P 97.81 96.62 91.92 83.64 72.60 89.99 89.23 90.16 89.24 J 87.02 81.10 70.85 56.14 54.12 64.72 58.30 63.69 58.42 Table 1: The evaluation in Saliency dataset with Precision(P) and Jaccard similarity(J). Ours(full) indicates our joint learning method and Ours(sim) means learning two networks separately. Ours(full) Ours(sim) FgSeg [22] CPMC [6] ObjProp [13] HS [32] GC [10] RC [9] HC [9] P 93.12 91.25 90.42 76.33 72.14 87.42 85.53 86.25 83.37 J 77.69 71.50 70.93 53.76 54.70 62.83 54.83 59.34 50.61 Table 2: The evaluation in OE dataset with Precision(P) and Jaccard similarity(J). Ours(full) indicates our joint learning method and Ours(sim) means learning two networks separately. We evaluate the performance of all K ∈{1, ..., 100} and report the best result for each sample in our experiment. Besides machine learning based methods, we also report the results of salient region detection methods [10, 32, 9]. Note that there are two approaches mentioned in [9] utilizing histogram based contrast(HC) and region based contrast(RC). Given the salient maps from these methods, an iterative GrabCut proposed in [9] is utilized to generate binary segmentation results. Saliency dataset. We report the experiment result in this dataset as Table. 1. Our result with joint task learning (namely as Ours(full)) reaches 97.81% in Precision(P) and 87.02% in Jaccard similarity(J). Compared to the figure-ground segmentation method [22], we have 5.89% improvements in P and 16.17% in J. For the saliency region detection methods, the best results are P:89.99% and J:64.72% in [32]. Our method demonstrates superior performances compared to these approaches. OE dataset. The evaluation of our method in OE dataset is shown in Table. 2. By jointly learning localization and segmentation networks, our approach with 93.12% in P and 77.69% in J achieves the highest performances compared to the state-of-the-art methods. One spotlight of our work is its high efficiency in testing. As Table. 3 illustrates, the average time for object extraction from an image with our method is 0.014 seconds, while figure-ground segmentation [22] requires 94.3 seconds, CPMC [6] requires 59.6 seconds and Object Proposal [13] requires 37.4 seconds. For most of the saliency region detection methods, the runtime are dominated by the iterative GrabCut process, thus we apply its time as the average testing time for the saliency region detection methods, which is 0.711 seconds. As a result, our approach is 50 ∼6000 times faster than the state-of-the-art methods. During training, it requires around 20 hours for convergence in the Saliency dataset and 13 hours for the OE dataset. For latent variable sampling, we also try to enumerate the 625 possible proposals exhaustively for each image. It achieves similar accuracy as our approach while costs about 30 times of runtime in each iteration of training. 5.2 Empirical Analysis For further evaluation, we conduct two following empirical analyses to illustrate the effectiveness of our method. (I) To clarify the significance of joint learning instead of learning two networks separately, we discard the latent variables sampling and set all ∆Li = 0 during training, namely as Ours(sim). We illustrate the training cost J(ωl, ωs, eL) (Eq. (4)) for these two methods as Fig. 4. We plot the average loss over all training samples though the training iterations, and it is shown that our joint learning Ours(full) FgSeg [22] CPMC [6] ObjProp [13] Saliency methods Time 0.014s 94.3s 59.6s 37.4s 0.711s Table 3: Testing time for each image. The Saliency methods indicates the saliency region detection methods [32, 10, 9]. 7 Car Horse Airplane P J P J P J Ours(full) 87.95 68.86 88.11 53.80 92.12 60.10 Chen et al. [7] 87.09 64.67 89.00 57.58 90.24 59.97 Rubinstein et al. [28] 83.38 63.36 83.69 53.89 86.14 55.62 Table 4: We compare our method with two object discovery and segmentation methods in the Internet dataset. We train our model with other data besides the ones in the Internet dataset. method can achieve lower costs than the one without latent variable adjustment. We also compare these two methods with Precision and Jaccard similarity in both datasets. As Table. 1 illustrates, there are 1.19% and 5.92% improvements in P and J when we learn two networks jointly in the Saliency dataset. For the OE dataset, the joint learning performs 1.87% higher in P and 6.19% higher in J than learning two networks separately, as shown in Table. 2. (II) We demonstrate that our method can be well generalized across different datasets. Given the OE dataset, we train our model with all the data except for the ones collected from Internet dataset [28]. Then the newly trained model is applied for testing on the Internet dataset. We compare the performance of this deep model with two object discovery and co-segmentation methods [28, 7] in the Internet dataset. As Table. 4 illustrates, our method achieves higher performance in the class of Car and Airplane, and a comparable result in the class of Horse. Thus our model can be well generalized to handle other datasets which are not applied in training and achieve state-of-the-art performances. It is also worth to mention that it requires a few seconds for testing via the co-segmentation methods [28, 7], which is much slower than our approach with 0.014 seconds per image. 0 20000 40000 60000 80000 100000 120000 400 600 800 1000 1200 1400 1600 Training Iterations Training Loss Joint Task Learning Separating Task Learning 0 10000 20000 30000 40000 50000 60000 1000 1100 1200 1300 1400 1500 1600 Training Iterations Training Loss Joint Task Learning Separating Task Learning (a) (b) Figure 4: The training cost across iterations. The cost is evaluated over all the training samples in each dataset:(a) Saliency dataset;(b) OE dataset. 6 Conclusion This paper studies joint task learning via deep neural networks for generic object extraction, in which two networks work collaboratively to boost performance. Our joint deep model has been shown to handle well realistic data from the internet. More importantly, the approach for extracting object segmentation mask in the image is very efficient and the speed is 1000 times faster than competing state-of-the-art methods. The proposed framework can be extended to handle other joint tasks in similar ways. References [1] R. Achanta, A. Shaji, K. Smith, A. Lucchi, P. Fua, and S. Susstrunk, SLIC Superpixels Compared to State-of-the-art Superpixel Methods, In IEEE Trans. Pattern Anal. Mach. Intell., 34(11):2274-2282, 2012. [2] J. M. Alvarez, T. Gevers, Y. LeCun, and A. M. Lopez, Road Scene Segmentation from a Single Image, In ECCV, 2012. [3] D. Batra, A. Kowdle, D. Parikh, J. Luo, and T. Chen, iCoseg: Interactive Co-segmentation with Intelligent Scribble Guidance, In CVPR, 2010. 8 [4] Y. Bengio, A. Courville, and P. Vincent, Representation Learning: A Review and New Perspectives, In IEEE Trans. Pattern Anal. Mach. Intell., 35(8): 1798-1828, 2013. [5] T. Brox, L. Bourdev, S. Maji, and J. Malik, Object Segmentation by Alignment of Poselet Activations to Image Contours, In CVPR, 2011. [6] J. Carreira and C. Sminchisescu, Constrained Parametric Min-Cuts for Automatic Object Segmentation, In CVPR, 2010. [7] X. Chen, A. Shrivastava, and A. Gupta, Enriching Visual Knowledge Bases via Object Discovery and Segmentation, In CVPR, 2014. [8] M. Cheng, N. Mitra, X. Huang, and S. Hu, SalientShape: Group Saliency in Image Collections, In The Visual Computer 34(4):443-453, 2014. [9] M. Cheng, G. Zhang, N. Mitra, X. Huang, and Shi. Hu, Global Contrast based Salient Region Detection, In CVPR, 2011. [10] M. Cheng, J. Warrell, W. Lin, S. Zheng, V. Vineet, and N. Crook, Efficient Salient Region Detection with Soft Image Abstraction, In ICCV, 2013. [11] D. C. Ciresan, A. Giusti, L. M. Gambardella, and J. Schmidhuber, Deep Neural Networks Segment Neuronal Membranes in Electron Microscopy Images, In NIPS, 2012. [12] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li and L. Fei-Fei, ImageNet: A Large-Scale Hierarchical Image Database, In CVPR, 2009. [13] I. Endres and D. Hoiem, Category-Independent Object Proposals with Diverse Ranking, In IEEE Trans. Pattern Anal. Mach. Intell., 2014. [14] D. Erhan, C. Szegedy, A. Toshev, and D. Anguelov, Scalable Object Detection using Deep Neural Networks, In CVPR, 2014. [15] M. Everingham, L. Van Gool, C. Williams, J. Winn, and A. Zisserman, The Pascal Visual Object Classes (VOC) Challenge, In Intl J. of Computer Vision, 88:303-338,2010. [16] C. Farabet, C. Couprie, L. Najman and Y. LeCun, Scene Parsing with Multiscale Feature Learning, Purity Trees, and Optimal Covers, In ICML, 2012. [17] P. F. Felzenszwalb, R. B. Girshick, D. McAllester, and D. Ramanan, Object detection with discriminatively trained part based models, In IEEE Trans. Pattern Anal. Mach. Intell., 2010. [18] S. Fidler, R. Mottaghi, A.L. Yuille, and R. Urtasun, Bottom-Up Segmentation for Top-Down Detection, In CVPR, 2013. [19] G. E. Hinton, and R. R. Salakhutdinov, Reducing the Dimensionality of Data with Neural Networks, In Science,313(5786):504-507, 2006. [20] G. B. Huang and V. Jain, Deep and Wide Multiscale Recursive Networks for Robust Image Labeling, In NIPS, 2013. [21] A. Krizhevsky, I. Sutskever, and G. E. Hinton, ImageNet Classification with Deep Convolutional Neural Networks, In NIPS, 2012. [22] D. Kuettel and V. Ferrari, Figure-ground segmentation by transferring window masks, In CVPR, 2012. [23] Y. LeCun, B. Boser, J.S. Denker, D. Henderson, R. E. Howard, W. Hubbard, L. D. Jackel, et al, Handwritten Digit Recognition with A Back-propagation Network, In NIPS, 1990. [24] N. Metropolis, A. Rosenbluth, M. Rosenbluth, A. Teller, and E. Teller, Equation of state calculations by fast computing machines, In J. Chemical Physics, 21(6):1087-1092, 1953. [25] W. Ouyang and X. Wang, Joint Deep Learning for Pedestrian Detection, In ICCV, 2013. [26] F. Perazzi, P. Krahenbuhl, Y. Pritch, and A. Hornung, Saliency Filters: Contrast Based Filtering for Salient Region Detection, In CVPR, 2012. [27] A. Rosenfeld and D. Weinshall, Extracting Foreground Masks towards Object Recognition, In ICCV, 2011. [28] M. Rubinstein, A. Joulin, J. Kopf, and C. Liu, Unsupervised Joint Object Discovery and Segmentation in Internet Images, In CVPR, 2013. [29] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus and Y. LeCun, OverFeat: Integrated Recognition, Localization and Detection using Convolutional Networks, In ICLR, 2014. [30] C. Szegedy, A. Toshev, and D. Erhan, Deep Neural Networks for Object Detection, In NIPS, 2013. [31] Z. Tu and S.C. Zhu, Image Segmentation by Data-Driven Markov Chain Monte Carlo, In IEEE Trans. Pattern Anal. Mach. Intell., 24(5):657-673, 2002. [32] Q. Yan, L. Xu, J. Shi, and J. Jia, Hierarchical Saliency Detection, In CVPR, 2013. [33] Y. Yang, S. Hallman, D. Ramanan, and C. Fowlkes, Layered Object Detection for Multi-Class Segmentation, In CVPR, 2010. 9
2014
346
5,454
Automatic Discovery of Cognitive Skills to Improve the Prediction of Student Learning Robert V. Lindsey, Mohammad Khajah, Michael C. Mozer Department of Computer Science and Institute of Cognitive Science University of Colorado, Boulder Abstract To master a discipline such as algebra or physics, students must acquire a set of cognitive skills. Traditionally, educators and domain experts use intuition to determine what these skills are and then select practice exercises to hone a particular skill. We propose a technique that uses student performance data to automatically discover the skills needed in a discipline. The technique assigns a latent skill to each exercise such that a student’s expected accuracy on a sequence of same-skill exercises improves monotonically with practice. Rather than discarding the skills identified by experts, our technique incorporates a nonparametric prior over the exerciseskill assignments that is based on the expert-provided skills and a weighted Chinese restaurant process. We test our technique on datasets from five different intelligent tutoring systems designed for students ranging in age from middle school through college. We obtain two surprising results. First, in three of the five datasets, the skills inferred by our technique support significantly improved predictions of student performance over the expertprovided skills. Second, the expert-provided skills have little value: our technique predicts student performance nearly as well when it ignores the domain expertise as when it attempts to leverage it. We discuss explanations for these surprising results and also the relationship of our skilldiscovery technique to alternative approaches. 1 Introduction With the advent of massively open online courses (MOOCs) and online learning platforms such as Khan Academy and Reasoning Mind, large volumes of data are collected from students as they solve exercises, acquire cognitive skills, and achieve a conceptual understanding. A student’s data provides clues as to his or her knowledge state—the specific facts, concepts, and operations that the student has mastered, as well as the depth and robustness of the mastery. Knowledge state is dynamic and evolves as the student learns and forgets. Tracking a student’s time-varying knowledge state is essential to an intelligent tutoring system. Knowledge state pinpoints the student’s strengths and deficiencies and helps determine what material the student would most benefit from studying or practicing. In short, efficient and effective personalized instruction requires inference of knowledge state [20, 25]. Knowledge state can be decomposed into atomic elements, often referred to as knowledge components [7, 13], though we prefer the term skills. Skills include retrieval of specific facts, e.g., the translation of ‘dog’ into Spanish is perro, as well as operators and rules in a domain, e.g., dividing each side of an algebraic equation by a constant to transform 3(x + 2) = 15 into x + 2 = 5, or calculating the area of a circle with radius r by applying the formula 1 πr2. When an exercise or question is posed, students must apply one or more skills, and the probability of correctly applying a skill is dependent on their knowledge state. To predict a student’s performance on an exercise, we thus must: (1) determine which skill or skills are required to solve the exercise, and (2) infer the student’s knowledge state for those skills. With regard to (1), the correspondence between exercises and skills, which we will refer to as an expert labeling, has historically been provided by human experts. Automated techniques have been proposed, although they either rely on an expert labeling which they then refine [5] or treat the student knowledge state as static [3]. With regard to (2), various dynamical latent state models have been suggested to infer time-varying knowledge state given an expert labeling. A popular model, Bayesian knowledge tracing assumes that knowledge state is binary—the skill is either known or not known [6]. Other models posit that knowledge state is continuous and evolves according to a linear dynamical system [21]. Only recently have methods been suggested that simultaneously address (1) and (2), and which therefore perform skill discovery. Nearly all of this work has involved matrix factorization [24, 22, 14]. Consider a student × exercise matrix whose cells indicate whether a student has answered an exercise correctly. Factorization leads to a vector for each student characterizing the degree to which the student has learned each of Nskill skills, and a vector for each exercise characterizing the degree to which that exercise requires each of Nskill skills. Modeling student learning presents a particular challenge because of the temporal dimension: students’ skills improve as they practice. Time has been addressed either via dynamical models of knowledge state or by extending the matrix into a tensor whose third dimension represents time. We present an approach to skill discovery that differs from matrix factorization approaches in three respects. First, rather than ignoring expert labeling, we adopt a Bayesian formulation in which the expert labels are incorporated into the prior. Second, we explore a nonparametric approach in which the number of skills is determined from the data. Third, rather than allowing an exercise to depend on multiple skills and to varying degrees, we make a stronger assumption that each exercise depends on exactly one skill in an all-or-none fashion. With this assumption, skill discovery is equivalent to the partitioning of exercises into disjoint sets. Although this strong assumption is likely to be a simplification of reality, it serves to restrict the model’s degrees of freedom compared to factorization approaches in which each student and exercise is assigned an Nskill-dimensional vector. Despite the application of sparsity and nonnegativity constraints, the best models produced by matrix factorization have had low-dimensional skill spaces, specifically, Nskill ≤5 [22, 14]. We conjecture that the low dimensionality is not due to the domains being modeled requiring at most 5 skills, but rather to overfitting for Nskill > 5. With our approach of partitioning exercises into disjoint skill sets, we can afford Nskill ≫5 without giving the model undue flexibility. We are aware of one recent approach to skill discovery [8, 9] which shares our assumption that each exercise depends on a single skill. However, it differs from our approach in that it does not try to exploit expert labels and presumes a fixed number of skills. We contrast our work to various alternative approaches toward the end of this paper. 2 A nonparametric model for automatic skill discovery We now introduce a generative probabilistic model of student problem-solving in terms of two components: (1) a prior over the assignment of exercises to skills, and (2) the likelihood of a sequence of responses produced by a student on exercises requiring a common skill. 2.1 Weighted CRP: A prior on skill assignments Any instructional domain (e.g., algebra, geometry, physics) has an associated set of exercises which students must practice to attain domain proficiency. We are interested in the common situation where an expert has identified, for each exercise, a specific skill which is required for its solution (the expert labeling). It may seem unrealistic to suppose that each exercise requires no more than one skill, but in intelligent tutoring systems [7, 13], complex exercises (e.g., algebra word problems) are often broken down into a series of steps which are small 2 enough that they could plausibly require only one skill (e.g., adding a constant to both sides of an algebraic equation). Thus, when we use the term ‘exercise’, in some domains we are actually referring to a step of a compound exercise. In other domains (e.g., elementary mathematics instruction), the exercises are designed specifically to tap what is being taught in a lesson and are thus narrowly focused. We wish to exploit the expert labeling to design a nonparametric prior over assignments of exercises to skills—hereafter, skill assignments—and we wish to vary the strength of the bias imposed by the expert labeling. With a strong bias, the prior would assign nonzero probability to only the expert labeling. With no bias, the expert labeling would be no more likely than any other. With an intermediate bias, which provides soft constraints on the skill assignment, a suitable model might improve on the expert labeling. We considered various methods, including fragmentation-coagulation processes [23] and the distance-dependent Chinese restaurant process [4]. In this article, we describe a straightforward approach based on the Chinese restaurant process (CRP) [1], which induces a distribution over partitions. The CRP is cast metaphorically in terms of a Chinese restaurant in which each entering customer chooses a table at which to sit. Denoting the table at which customer i sits as Yi, customer i can take a seat at an occupied table y with P(Yi = y) ∝ny or at an empty table with P(Yi = Ntable + 1) ∝α, where Ntable is the number of occupied tables and ny is the number of customers currently seated at table y. The weighted Chinese restaurant process (WCRP) [10] extends this metaphor by supposing that customers each have a fixed affiliation and are biased to sit at tables with other customers having similar affiliations. The WCRP is nothing more than the posterior over table assignments given a CRP prior and a likelihood function based on affiliations. In the mapping of the WCRP to our domain, customers correspond to exercises, tables to distinct skills, and affiliations to expert labels. The WCRP thus partitions the exercises into groups sharing a common skill, with a bias to assign the same skill to exercises having the same expert label. The WCRP is specified in terms of a set of parameters θ ≡{θ1, . . . , θNtable}, where θy represents the affiliation associated with table y. In our domain, the affiliation corresponds to one of the expert labels: θy ∈{1, . . . , Nskill}. From a generative modeling perspective, the affiliation of a table influences the affiliations of each customer seated at the table. Using Xi to denote the affiliation of customer i—or equivalently, the expert label associated with exercise i—we make the generative assumption: P(Xi = x|Yi = y, θ) ∝βδx,θy + 1 −β , where δ is the Kronecker delta and β is the previously mentioned bias. With β = 0, a customer is equally likely to have any affiliation; with β = 1, all customers at a table will have the table’s affiliation. With uniform priors on θy, the conditional distribution on θy is: P(θy|X(y)) ∝(1 −β)−n θy y where X(y) is the set of affiliations of customers seated at table y and na y ≡P Xi∈X(y) δxi,a is the number of customers at table y with affiliation a. Marginalizing over θ, the WCRP specifies a distribution over table assignments for a new customer: an occupied table y ∈{1, . . . , Ntable} is chosen with probability P(Yi = y|Xi, X(y)) ∝ny 1 + β(κxi y −1) 1 + β(Nskill −1 −1), with κa y ≡ (1 −β)−na y PNskill ˜a=1 (1 −β)−n˜a y . (1) κa y is a softmax function that tends toward 1 if a is the most common affiliation among customers at table y, and tends toward 0 otherwise. In the WCRP, an empty table Ntable+1 is selected with probability P(Yi = Ntable + 1) ∝α. (2) We choose to treat α not as a constant but rather define α ≡α′(1 −β) where α′ becomes the free parameter of the model that modulates the expected number of occupied tables, and the term 1 −β serves to give the model less freedom to assign new tables when the 3 affiliation bias is high. (We leave the constant in the denominator of Equation 1 so that α has the same interpretation regardless of β.) For β = 0, the WCRP reduces to the CRP and expert labels are ignored. Although the WCRP is undefined for β = 1, it is defined in the limit β →1, and it produces a seating arrangement equivalent to the expert labels with probability 1. For intermediate β, the expert labels serve as an intermediate constraint. For any β, the WCRP seating arrangement specifies a skill assignment over exercises. 2.2 BKT: A theory of human skill acquisition In the previous section, we described a prior over skill assignments. Given an assignment, we turn to a theory of the temporal dynamics of human skill acquisition. Suppose that a particular student practices a series of exercises, {e1, e2, . . . , et, . . . , eT }, where the subscript indicates order and each exercise et depends on a corresponding skill, st.1 We assume that whether or not a student responds correctly to exercise et depends solely on the student’s mastery of st. We further assume that when a student works on et, it has no effect on the student’s mastery of other skills ˜s, ˜s ̸= st. These assumptions—adopted by nearly all past models of student learning—allow us to consider each skill independently of the others. Thus, for skill ˜s, we can select its subset of exercises from the sequence, e˜s = {et | st = ˜s}, preserving order in the sequence, and predict whether the student will answer each exercise correctly or incorrectly. Given the uncertainty in such predictions, models typically predict the joint likelihood over the sequence of responses, P(R1, . . . , R|e˜s|), where the binary random variable Rt indicates the correctness of the response to et. The focus of our research is not on developing novel models of skill acquisition. Instead, we incorporate a simple model that is a mainstay of the field, Bayesian knowledge tracing (BKT) [6]. BKT is based on a theory of all-or-none human learning [2] which postulates that a student’s knowledge state following trial t, Kt, is binary: 1 if the skill has been mastered, 0 otherwise. BKT is a hidden Markov model (HMM) with internal state Kt and emissions Rt. Because BKT is typically used to model practice over brief intervals, the model assumes no forgetting, i.e., K cannot transition from 1 to 0. This assumption constrains the timevarying knowledge state: it can make at most one transition from 0 to 1 over the sequence of trials. Consequently, the {Kt} can be replaced by a single latent variable, T, that denotes the trial following which a transition is made, leading to the BKT generative model: P(T = t|λL, λM) = λL if t = 0 (1 −λL)λM(1 −λM)t−1 if t > 0 (3) P(Rt = 1|λG, λS, T) = λG if i ≤T 1 −λS otherwise, (4) where λL is the probability that a student has mastered the skill prior to performing the first exercise, λM is the transition probability from the not-mastered to mastered state, λG is the probability of correctly guessing the answer prior to skill mastery, and λS is the probability of answering incorrectly due to a slip following skill mastery. Although we have chosen to model student learning with BKT, any other probabilistic model of student learning could be used in conjunction with our approach to skill discovery, including more sophisticated variants of BKT [11] or models of knowledge state with continuous dynamics [21]. Further, our approach does not require BKT’s assumption that learning a skill is conditionally independent of the practice history of other skills. However, the simplicity of BKT allows one to conduct modeling on a relatively large scale. 1To tie this notation to the notation of the previous section, st ≡yet, i.e., the table assignments of the WCRP correspond to skills, and exercise et is seated at table yet. Note that i in the previous section was used as an index over distinct exercises, whereas t in this section is used as an index over trials. The same exercise may be presented multiple times. 4 3 Implementation We perform posterior inference through Markov chain Monte Carlo (MCMC) sampling. The conditional probability for Yi given the other variables is proportional to the product of the WCRP prior term and the likelihood of each student’s response sequence. The prior term is given by Equations 1 and 2, where by exchangeability we can take Yi to be the last customer to enter the restaurant and where we analytically marginalize θ. For an existing table, the likelihood is given by the BKT HMM emission sequence probability. For a new table, we must add an extra step to calculating the emission sequence probability because the BKT parameters do not have conjugate priors. We used Algorithm 8 from [16], which effectively produces a Monte Carlo approximation to the intractable marginal data likelihood, integrating out over the BKT parameters that could be drawn for the new table. For lack of conjugacy and any strong prior knowledge, we give each table’s λL, λM, and λS independent uniform priors on [0, 1]. Because we wish to interpret BKT’s K = 1 state as a “learned” state, we parameterize λG as being a fraction of 1 −λS, where the fraction has a uniform prior on [0, 1]. We give log(1−β) a uniform prior on [−5, 0] based on the simulations described in Section 4.1, and α′ is given an improper uniform prior with support on α′ > 0. Because of the lack of conjugacy, we explicitly represent each table’s BKT parameters during sampling. In each iteration of the sampler, we update the table assignments of each exercise and then apply five axis-aligned slice sampling updates to each table’s BKT parameters and to the hyperparameters β and α′ [17]. For all simulations, we run the sampler for 200 iterations and discard the first 100 as the burn-in period. The seating arrangement is initialized to the expert-provided skills; all other parameters are initialized by sampling from the generative model. We use the post burn-in samples to estimate the expected posterior probability of a student correctly responding in a trial, integrating out over uncertainty in all skill assignments, BKT parameterizations, and hyperparameters. We explored using more iterations and a longer burn-in period but found that doing so did not yield appreciable increases in training or test data likelihoods. 4 Simulations 4.1 Sampling from the WCRP We generated synthetic exercise-skill assignments via a draw from a CRP prior with α = 3 and Nexercise = 100. Using these assignments as both the ground-truth and expert labels, we then simulated draws from the WCRP to determine the effect of β (the expert labeling bias) and α′ (concentration scaling parameter; see Equation 2) on the model’s behavior. Figure 1a shows the reconstruction score, a measure of similarity between the induced assignment and the true labels. This score is the difference between (1) the proportion of pairs of exercises that belong to the same true skill that are assigned to the same recovered skill, and (2) the proportion of pairs of exercises that belong to different true skills that are assigned to different recovered skills. The score is in [0, 1], with 0 indicating no better than a chance relationship to the true labels, and 1 indicating the true labels are recovered exactly. The reported score is the mean over replications of the simulation and MCMC samples. As β increases, the recovered skills better approximate the expert (true) skills, independent of α′. Figure 1b shows the expected interaction between α′ and β on the number of occupied tables (induced skills): only when the bias is weak does α′ have an effect. 4.2 Skill recovery from synthetic student data We generated data for Nstudent synthetic students responding to Nexercise exercises presented in a random order for each student. Using a draw from the CRP prior with α = 3, we generated exercise-skill assignments. For each skill, we generated sequences of student correct/incorrect responses via BKT, with parameters sampled from plausible distributions: λL ∼Uniform(0, 1), λM ∼Beta(10, 30), λG ∼Beta(1, 9), and λS ∼Beta(1, 9). Figure 1c shows the model’s reconstruction of true skills for 24 replications of the simulation with Nstudent = 100 and Nexercise = 200, varying β, providing a set of expert skill labels that were either the true labels or a permutation of the true labels. The latter conveys no information about the true labels. The most striking feature of the result is that the model 5 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 expert labeling bias (β) reconstruction score (a) 0 0.2 0.4 0.6 0.8 1 5 10 15 20 25 expert labeling bias (β) # occupied tables (b) 0 0.2 0.4 0.6 0.8 1 0.75 0.8 0.85 0.9 0.95 1 expert labeling bias (β) reconstruction score permuted labels true labels (c) α’ = 2.0 α’ = 5.0 α’ = 10.0 α’ = 2.0 α’ = 5.0 α’ = 10.0 Figure 1: (a,b) Effect of varying expert labeling bias (β) and α′ on sampled skill assignments from a WCRP; (c) Effect of expert labels and β on the full model’s reconstruction of the true skills from synthetic data reconstruction score 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 50 100 150 200 100 50 100 150 200 200 50 100 150 200 300 # students # exercises true labels 10 skills 20 skills 30 skills reconstruction score 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 50 100 150 200 100 50 100 150 200 200 50 100 150 200 300 # students # exercises permuted labels 10 skills 20 skills 30 skills Figure 2: Effect of expert labels, Nstudent, Nexercise, and Nskill on the model’s reconstruction of the true skills from synthetic data does an outstanding job of reconstructing the true labeling whether the expert labels are correct or not. Only when the bias β is strong and the expert labels are erroneous does the model’s reconstruction performance falter. The bottom line is that a good expert labeling can help, whereas a bad expert labeling should be no worse than no expert-provided labels. In a larger simulation, we systematically varied Nstudent ∈{50, 100, 150, 200}, Nexercise ∈ {100, 200, 300}, and assigned the exercises to one of Nskill ∈{10, 20, 30} skills via uniform multinomial sampling. Figure 2 shows the result from 30 replications of the simulation using expert labels that were either true or permuted (left and right panels, respectively). With a good expert labeling, skill reconstruction is near perfect with Nstudent ≥100 and an Nexercise : Nskill ratio of at least 10. With a bad expert labeling, more data is required to obtain accurate reconstructions, say, Nstudent ≥200. As one would expect, a helpful expert labeling can overcome noisy or inadequate data. 4.3 Evaluation of student performance data We ran simulations on five student performance datasets (Table 1). The datasets varied in the number of students, exercises, and expert skill labels; the students in the datasets ranged in age from middle school to college. Each dataset consists of student identifiers, exercise identifiers, trial numbers, and binary indicators of response correctness from students undergoing variable-length sequences of exercises over time.2 Exercises may appear in different orders for each student and may occur multiple times for a given student. 2For the DataShop datasets, exercises were identified by concatenating what they call the problem hierarchy, problem name, and the step name columns. Expert-provided skill labels were identified by concatenating the problem hierarchy column with the skill column following the same practice as in [19, 18]. The expert skill labels infrequently associate an exercise with multiple skills. For such exercises, we treat the combination of skills as one unique skill. 6 # # # # skills # skills β source dataset students exercises trials (expert) (WCRP) (WCRP) PSLC DataShop [12] fractions game 51 179 4,349 45 7.9 0.886 PSLC DataShop [12] physics tutor 66 4,816 110,041 652 49.4 0.947 PSLC DataShop [12] engineering statics 333 1,223 189,297 156 99.2 0.981 [15] Spanish vocabulary 182 409 578,726 221 183 0.996 PSLC DataShop [12] geometry tutor 59 139 5,104 18 19.7 0.997 Table 1: Five student performance datasets used in simulations We compared a set of models which we will describe shortly. For each model, we ran ten replications of five-fold cross validation on each dataset. In each replication, we randomly partitioned the set of all students into five equally sized disjoint subsets. In each replicationfold, we collected posterior samples using our MCMC algorithm given the data recorded for students in four of the five subsets. We then used the samples to predict the response sequences (correct vs. incorrect) of the remaining students. On occasion, students in the test set were given exercises that had not appeared in the training set. In those cases, the model used samples from Equations 1-2 to predict the new exercises’ skill assignments. The models we compare differ in how skills are assigned to exercises. However, every model uses BKT to predict student performance given the skill assignments. Before presenting results from the models, we first need to verify the BKT assumption that students improve on a skill over time. We compared BKT to a baseline model which assumes a stationary probability of a correct response for each skill. Using the expert-provided skills, BKT achieves a mean 11% relative improvement over the baseline model across the five datasets. Thus, BKT with expert-provided skills is sensitive to the temporal dynamics of learning. To evaluate models, we use BKT to predict the test students’ data given the model-specified skill assignment. We calculated several prediction-accuracy metrics, including RMSE and mean log loss. We report area under the ROC curve (AUC), though all metrics yield the same pattern of results. Figure 3 shows the mean AUC, where larger AUC values indicate better performance. Each graph is a different dataset. The five colored bars represent alternative approaches to determining the exercise-skill assignments. LFA uses skills from Learning Factors Analysis, a semi-automated technique that refines expert-provided skills [5]; LFA skills are available for only the Fractions and Geometry datasets. Single assigns the same skill to all exercises. Exercise specific assigns a different skill to each exercise. Expert uses the expert-provided skills. WCRP(0) uses the WCRP with no bias toward the expert-provided skills, i.e., β = 0, which is equivalent to a CRP. WCRP(β) is our technique with the level of bias inferred from the data. The performance of expert is unimpressive. On Fractions, expert is worse than the single baseline. On Physics and Statics, expert is worse than the exercise-specific baseline. WCRP(β) is consistently better than both the single and exercise-specific baselines across all five datasets. WCRP(β) also outperforms expert by doing significantly better on three datasets and equivalently on two. Finally, WCRP(β) is about the same as LFA on Geometry, but substantially better on Fractions. (A comparison between these models is somewhat inappropriate. LFA has an advantage because it was developed on Geometry and is provided entire data sets for training, but it has a disadvantage because it was not designed to improve the performance of BKT.) Surprisingly, WCRP(0), which ignores the expert-provided skills, performs nearly as well as WCRP(β). Only for Geometry was WCRP(β) reliably better (two-tailed t-test with t(49) = 5.32, p < .00001). The last column of Table 1, which shows the mean inferred β value for WCRP(β), helps explain the pattern of results. The datasets are arranged in order of smallest to largest inferred β, both in Table 1 and Figure 3. The inferred β values do a good job of indicating where WCRP(β) outperforms expert: the model infers that the expert skill assignments are useful for Geometry and Spanish, but less so for the other datasets. Where the expert skill assignments are most useful, WCRP(0) suffers. On the datasets where WCRP(β) is highly biased, the mean number of inferred skills (Table 1, column 7) closely corresponds to the number of expert-provided skills. 7 .60 .65 .70 .75 LFA Single Exercise Specific Expert WCRP(0) WCRP(β) AUC Fractions .55 .60 .65 .70 Single Exercise Specific Expert WCRP(0) WCRP(β) Physics .60 .65 .70 .75 .80 Single Exercise Specific Expert WCRP(0) WCRP(β) Statics .70 .75 .80 .85 Single Exercise Specific Expert WCRP(0) WCRP(β) Spanish .55 .60 .65 .70 .75 LFA Single Exercise Specific Expert WCRP(0) WCRP(β) Geometry Figure 3: Mean AUC on test students’ data for six different methods of determining skill assignments in BKT. Error bars show ±1 standard error of the mean. 5 Discussion We presented a technique that discovers a set of cognitive skills which students use for problem solving in an instructional domain. The technique assumes that when a student works on a sequence of exercises requiring the same skill, the student’s expected performance should monotonically improve. Our technique addresses two challenges simultaneously: (1) determining which skill is required to correctly answer each exercise, and (2) modeling a student’s dynamical knowledge state for each skill. We conjectured that a technique which jointly addresses these two challenges might lead to more accurate predictions of student performance than a technique which was based on expert skill labels. We found strong evidence for this conjecture: On 3 of 5 datasets, skill discovery yields significantly improved predictions over fixed expert-labeled skills; on the other two datasets, the two approaches obtain comparable results. Counterintuitively, incorporating expert labels into the prior provided little or no benefit. Although one expects prior knowledge to play a smaller role as datasets become larger, we observed that even medium-sized datasets (relative to the scale of today’s big data) are sufficient to support a pure data-driven approach. In simulation studies with both synthetic data and actual student datasets, 50-100 students and roughly 10 exercises/skill provides strong enough constraints on inference that expert labels are not essential. Why should the expert skill labeling ever be worse than an inferred labeling? After all, educators design exercises to help students develop particular cognitive skills. One explanation is that educators understand the knowledge structure of a domain, but have not parsed the domain at the right level of granularity needed to predict student performance. For example, a set of exercises may all tap the same skill, but some require a deep understanding of the skill whereas others require only a superficial or partial understanding. In such a case, splitting the skill into two subskills may be beneficial. In other cases, combining two skills which are learned jointly may subserve prediction, because the combination results in longer exercise histories which provide more context for prediction. These arguments suggest that fragmentation-coagulation processes [23] may be an interesting approach to leveraging expert labelings as a prior. One limitation of the results we report is that we have yet to perform extensive comparisons of our technique to others that jointly model the mapping of exercises to skills and the prediction of student knowledge state. Three matrix factorization approaches have been proposed, two of which are as yet unpublished [24, 22, 14]. The most similar work to ours, which also assumes each exercise is mapped to a single skill, is the topical HMM [8, 9]. The topical HMM differs from our technique in that the underlying generative model supposes that the exercise-skill mapping is inherently stochastic and thus can change from trial to trial and student to student. (Also, it does not attempt to infer the number of skills or to leverage expert-provided skills.) We have initated collaborations with several authors of these alternative approaches, with the goal of testing the various approaches on exactly the same datasets with the same evaluation metrics. Acknowledgments This research was supported by NSF grants BCS-0339103 and BCS720375 and by an NSF Graduate Research Fellowship to R. L. 8 References [1] D. Aldous. Exchangeability and related topics. In ´Ecole d’´et´e de probabilit´es de Saint-Flour, pages 1–198. Springer, Berlin, 1985. [2] R. Atkinson. Optimizing the learning of a second-language vocabulary. Journal of Experimental Psychology, 96:124–129, 1972. [3] T. Barnes. The Q-matrix method: Mining student response data for knowledge. In J. Beck, editor, Proceedings of the 2005 AAAI Educational Data Mining Workshop, 2005. [4] D. Blei and P. Frazier. Distance dependent Chinese restaurant processes. Journal of Machine Learning Research, 12:2383–2410, 2011. [5] H. Cen, K. Koedinger, and B. Junker. Learning factors analysis—A general method for cognitive model evaluation and improvement. In M. Ikeda, K. Ashley, and T. Chan, editors, Intell. Tutoring Systems, volume 4053 of Lec. Notes in Comp. Sci., pages 164–175. Springer, 2006. [6] A. Corbett and J. Anderson. Knowledge tracing: Modeling the acquisition of procedural knowledge. User Modeling & User-Adapted Interaction, 4:253–278, 1995. [7] A. Corbett, K. Koedinger, and J. Anderson. Intelligent tutoring systems. In M. Helander, T. Landauer, and P. Prabhu, editors, Handbook of Human Computer Interaction, pages 849– 874. Elsevier Science, Amsterdam, 1997. [8] J. Gonz´alez-Brenes and J. Mostow. Dynamic cognitive tracing: Towards unified discovery of student and cognitive models. In Proc. of the 5th Intl. Conf. on Educ. Data Mining, 2012. [9] J. Gonz´alez-Brenes and J. Mostow. What and when do students learn? Fully data-driven joint estimation of cognitive and student models. In Proc. 6th Intl. Conf. Educ. Data Mining, 2013. [10] H. Ishwaran and L. James. Generalized weighted Chinese restaurant processes for species sampling mixture models. Statistica Sinica, 13:1211–1235, 2003. [11] M. Khajah, R. Wing, R. Lindsey, and M. Mozer. Integrating latent-factor and knowledgetracing models to predict individual differences in learning. EDM 2014, 2014. [12] K. Koedinger, R. Baker, K. Cunningham, A. Skogsholm, B. Leber, and J. Stamper. A data repository for the EDM community: The PSLC DataShop. In C. Romero, S. Ventura, M. Pechenizkiy, and R. Baker, editors, Handbook of Educ. Data Mining, http://pslcdatashop.org, 2010. [13] K. Koedinger, A. Corbett, and C. Perfetti. The knowledge-learning-instruction framework: Bridging the science-practice chasm to enhance robust student learning. Cognitive Science, 36(5):757–798, 2012. [14] A. S. Lan, C. Studer, and R. G. Baraniuk. Time-varying learning and content analytics via sparse factor analysis. In ACM SIGKDD Conf. on Knowledge Disc. and Data Mining, 2014. [15] R. Lindsey, J. Shroyer, H. Pashler, and M. Mozer. Improving student’s long-term knowledge retention with personalized review. Psychological Science, 25:639–647, 2014. [16] R. Neal. Markov chain sampling methods for dirichlet process mixture models. Journal of Computational and Graphical Statistics, 9(2):249–265, 2000. [17] R. Neal. Slice sampling. The Annals of Statistics, 31(3):705–767, 2003. [18] Z. A. Pardos and N. T. Heffernan. KT-IDEM: Introducing item difficulty to the knowledge tracing model. In User Modeling, Adaption and Pers., pages 243–254. Springer, 2011. [19] Z. A. Pardos, S. Trivedi, N. T. Heffernan, and G. N. S´ark¨ozy. Clustered knowledge tracing. In S. A. Cerri, W. J. Clancey, G. Papadourakis, and K. Panourgia, editors, ITS, volume 7315 of Lecture Notes in Computer Science, pages 405–410. Springer, 2012. [20] A. Rafferty, E. Brunskill, T. Griffiths, and P. Shafto. Faster teaching by POMDP planning. In Proc. of the 15th Intl. Conf. on AI in Education, 2011. [21] A. Smith, L. Frank, S. Wirth, M. Yanike, D. Hu, Y. Kubota, A. Graybiel, W. Suzuki, and E. Brown. Dynamic analysis of learning in behav. experiments. J. Neuro., 24:447–461, 2004. [22] J. Sohl-Dickstein. Personalized learning and temporal modeling at Khan Academy. Invited Talk at NIPS Workshop on Data Driven Education, 2013. [23] Y. Teh, C. Blundell, and L. Elliott. Modelling genetic variations with fragmentationcoagulation processes. In Advances In Neural Information Processing Systems, 2011. [24] N. Thai-Nghe, L. Drumond, T. Horv´ath, A. Krohn-Grimberghe, A. Nanopoulos, and L. Schmidt-Thieme. Factorization techniques for predicting student performance. In O. Santos and J. Botcario, editors, Educ. Rec. Systems and Technologies, pages 129–153. 2011. [25] J. Whitehill. A stochastic optimal control perspective on affect-sensitive teaching. PhD thesis, Department of Computer Science, UCSD, 2012. 9
2014
347
5,455
General Table Completion using a Bayesian Nonparametric Model Isabel Valera Department of Signal Processing and Communications University Carlos III in Madrid ivalera@tsc.uc3m.es Zoubin Ghahramani Department of Engineering University of Cambridge zoubin@eng.cam.ac.uk Abstract Even though heterogeneous databases can be found in a broad variety of applications, there exists a lack of tools for estimating missing data in such databases. In this paper, we provide an efficient and robust table completion tool, based on a Bayesian nonparametric latent feature model. In particular, we propose a general observation model for the Indian buffet process (IBP) adapted to mixed continuous (real-valued and positive real-valued) and discrete (categorical, ordinal and count) observations. Then, we propose an inference algorithm that scales linearly with the number of observations. Finally, our experiments over five real databases show that the proposed approach provides more robust and accurate estimates than the standard IBP and the Bayesian probabilistic matrix factorization with Gaussian observations. 1 Introduction A full 90% of all the data in the world has been generated over the last two years and this expansion rate will not diminish in the years to come [17]. This extreme availability of data explains the great investment that both the industry and the research community are expending in data science. Data is usually organized and stored in databases, which are often large, noisy, and contain missing values. Missing data may occur in diverse applications due to different reasons. For example, a sensor in a remote sensor network may be damaged and transmit corrupted data or even cease to transmit; participants in a clinical study may drop out during the course of the study; or users of a recommendation system rate only a small fraction of the available books, movies, or songs. The presence of missing values can be challenging when the data is used for reporting, information sharing and decision support, and as a consequence, missing data treatment has captured the attention in diverse areas of data science such as machine learning, data mining, and data warehousing and management. Several studies have shown that probabilistic modeling can help to estimate missing values, detect errors in databases, or provide probabilistic responses to queries [19]. In this paper, we exclusively focus on the use of probabilistic modeling for missing data estimation, and assume that the data are missing completely at random (MCAR). There is extensive literature in probabilistic missing data estimation and imputation in homogeneous databases, where all the attributes that describe each object in the database present the same (continuous or discrete) nature. Most of the work assumes that databases contain only either continuous data, usually modeled as Gaussian variables [21], or discrete, that can be either modeled by discrete likelihoods [9] or simply treated as Gaussian variables [15, 21]. However, there still exists a lack of work dealing with heterogeneous databases, which in fact are common in real applications and where the standard approach is to treat all the attributes, either continuous or discrete, as Gaussian variables. As a motivating example, consider a database that contains the answers to a survey, including diverse information about the participants such as age (count data), gender (categorical data), salary (continuous non negative data), etc. 1 In this paper, we provide a general Bayesian approach for estimating and replacing the missing data in heterogeneous databases (being the data MCAR), where the attributes describing each object can be either discrete, continuous or mixed variables. Specifically, we account for real-valued, positive real-valued, categorical, ordinal and count data. To this end, we assume that the information in the database can be stored in a matrix (or table), where each row corresponds to an object and the columns are the attributes that describe the different objects. We propose a novel Bayesian nonparametric approach for general table completion based on feature modeling, in which each object is represented by a set of latent variables and the observations are generated from a distribution determined by those latent features. Since the number of latent variables needed to explain the data depends on the specific database, we use the Indian buffet process (IBP) [8], which places a prior distribution over binary matrices where the number of columns (latent variables) is unbounded. The standard IBP assumes real-valued observations combined with conjugate likelihood models that allow for fast inference algorithms [4]. Here, we aim at dealing with heterogeneous databases, which may contain mixed continuous and discrete observations. We propose a general observation model for the IBP that accounts for mixed continuous and discrete data, while keeping the properties of conjugate models. This allows us to propose an inference algorithm that scales linearly with the number of observations. The proposed algorithm does not only infer the latent variables for each object in the table, but it also provides accurate estimates for its missing values. Our experiments over five real databases show that our approach for table completion outperforms, in terms of accuracy, the Bayesian probabilistic matrix factorization (BPMF) [15] and the standard IBP which assume Gaussian observations. We also observe that the approach based on treating mixed continuous and discrete data as Gaussian fails in estimating some attributes, while the proposed approach provides robust estimates for all the missing values regardless of their discrete or continuous nature. The main contributions in this paper are: i) A general observation model (for mixed continuous and discrete data) for the IBP that allows us to derive an inference algorithm that scales linearly with the number of objects, and its application to build ii) a general and scalable tool to estimate missing values in heterogeneous databases. An efficient C-code implementation for Matlab of the proposed table completion tool is also released on the authors website. 2 Related Work In recent years, probabilistic modeling has become an attractive option for building database management systems since it allows estimating missing values, detecting errors, visualizing the data, and providing probabilistic answers to queries [19]. BayesDB,1 for instance, is a database management system that resorts to Crosscat [18], which originally appeared as a Bayesian approach to model human categorization of objects. BayesDB provides missing data estimates and probabilistic answer to queries, but it only considers Gaussian and multinomial likelihood functions. In the literature, probabilistic low-rank matrix factorization approaches have been broadly applied to table completion (see, e.g., [14, 15, 21]). In these approaches, the table database X is approximated by a low-rank matrix representation X ≈ZB, where Z and B are usually assumed to be Gaussian distributed. Most of the works in this area have focused on building automatic recommendation systems, which appears as the most popular application of missing data estimation [14, 15, 21]. More specific models to build recommendation systems can be found in [7, 22], where the authors assume that the rates each user assign to items are generated by a probabilistic generative model which, based on the available data, accounts for similarities among users and among items to provide good estimates of the missing rates. Probabilistic matrix factorization can also be viewed as latent feature modeling, where each object is represented by a vector of continuous latent variables. In contrast, the IBP and other latent feature models (see, e.g., [16]) assume binary latent features to represent each object. Latent feature models usually assume homogeneous databases with either real [14, 15, 21] or categorical data [9, 12, 13], and only a few works consider heterogeneous data, such as mixed real and categorical data [16]. However, up to our knowledge, there are no general latent feature models (nor table completion tools) to directly deal with heterogeneous databases. To fill this gap, in this paper we provide a general table completion approach for heterogeneous databases, based on a generalized IBP, that allows for efficient inference. 1http://probcomp.csail.mit.edu/bayesdb/ 2 3 Model Description Let us assume a table with N objects, where each object is defined by D attributes. We can store the data in an N × D observation matrix X, in which each D-dimensional row vector is denoted by xn = [x1 n, . . . , xD n ] and each entry is denoted by xd n. We consider that column vectors xd (i.e., each dimension in the observation matrix X) may contain the following types of data: • Continuous variables: 1. Real-valued, i.e., xd n ∈ℜ 2. Positive real-valued, i.e., xd n ∈ℜ+. • Discrete variables: 1. Categorical data, i.e., xd n takes values in a finite unordered set, e.g., xd n ∈{‘blue’, ‘red’, ‘black’}. 2. Ordinal data, i.e., xd n takes values in a finite ordered set, e.g., xd n ∈{‘never’, ‘sometimes’, ‘often’, ‘usually’, ‘always’}. 3. Count data, i.e., xd n ∈{0, . . . , ∞}, We assume that each observation xd n can be explained by a K-length vector of latent variables associated to the n-th data point zn = [zn1, . . . , znK] and a weighting vector2 Bd = [bd 1, . . . , bd K] (being K the number of latent variables), whose elements bd k weight the contribution of k-th the latent feature to the d-th dimension of X. We gather the latent binary feature vectors zn in a N × K matrix Z, which follows an IBP with concentration parameter α, i.e., Z ∼IBP(α) [8]. We place a Gaussian distribution with zero mean and covariance matrix σ2 BIK over the weighting vectors Bd. For convenience, zn is a K-length row vector, while Bd is a K-length column vector. To accommodate for all kinds of observed random variables described above, we introduce an auxiliary Gaussian variable yd n, such that when conditioned on the auxiliary variables, the latent variable model behaves as a standard IBP with Gaussian observations. In particular, we assume yd n is Gaussian distributed with mean znBd and variance σ2 y, i.e., p(yd n|zn, Bd) = N(yd n|znBd, σ2 y), and assume that there exists a transformation function over the variables yd n to obtain the observations xd n, mapping the real line ℜinto the observation space. The resulting generative model is shown in Figure 1, where Z is the IBP latent matrix, and Yd and Bd contain, respectively, the auxiliary Gaussian variables yd n and the weighting factors bd k for the d-dimension of the data. Additionally, Ψd denotes the set of auxiliary random variables needed to obtain the observation vector xd given Yd, and Hd contains the hyper-parameters associated to the random variables in Ψd. This model assumes that the observations xd n are independent given the latent matrix Z, the weighting matrices Bd and the auxiliary variables Ψd. Therefore, the likelihood can be factorized as p(X|Z, {Bd, Ψd}D d=1) = D Y d=1 p(xd|Z, Bd, Ψd) = D Y d=1 N Y n=1 p(xd n|zn, Bd, Ψd). Note that, if we assume Gaussian observations and set Yd = xd, this model resembles the standard IBP with Gaussian observations [8]. In addition, conditioned on the variables Yd, we can infer the latent matrix Z as in the standard IBP. We also remark that auxiliary Gaussian variables to link a latent model with the observations have been previously used in Gaussian processes for multi-class classification [6] and for ordinal regression [2]. However, up to our knowledge, this simple approach has not been used to account for mixed continuous and discrete data, and the existent approaches for the IBP with discrete observations propose non-conjugate likelihood models and approximate inference algorithms [12, 13]. 3.1 Likelihood Functions Now, we define the set of transformations that map from the Gaussian variables yd n to the corresponding observations xd n. We consider that each dimension in the table X may contain any of the discrete or continuous variables detailed above, provide a likelihood function for each kind of data and, in turn, also a likelihood function for mixed data. 2For convenience, we capitalized here the notation for the weighting vectors Bd. 3 Real-valued Data. In this case, we assume that xd = Yd in the model in Figure 1 and consider the standard approach when dealing with real-valued observations, which consist of assuming a Gaussian likelihood function. In particular, as in the standard linear-Gaussian IBP [8], we assume that each observation xd n is distributed as p(xd n|zn, Bd) = N(xd n|znBd, σ2 y). Positive Real-valued Data. In order to obtain positive real-valued observations, i.e., xd n ∈ℜ+, we apply a transformation over yd n that maps from the real numbers to the positive real numbers, i.e., xd n = f(yd n + ud n), where ud n is a Gaussian noise variable with variance σ2 u, and f : ℜ→ℜ+ is a monotonic differentiable function. By change of variables, we obtain the likelihood function for positive real-valued observations as p(xd n|zn, Bd) = 1 q 2π(σ2y + σ2u) exp  − 1 2(σ2y + σ2u)(f −1(xd n) −znBd)2  d dxdn f −1(xd n) , (1) where f −1 : ℜ+ →ℜis the inverse function of the transformation f(·), i.e, f −1(f(v)) = v. Note that in this case we resort to the Gaussian variable ud n in order to obtain xd n from yd n, and therefore, Ψd = ud d and Hd = σ2 u. Categorical Data. Now we account for categorical observations, i.e., each observation xd n can take values in the unordered index set {1, . . . , Rd}. Hence, assuming a multinomial probit model, we can write xd n = arg max r∈{1,...,Rd} yd nr, (2) being yd nr ∼N(yd nr|znbd r, σ2 y) where bd r denotes the K-length weighting vector, in which each bd kr weights the influence of the k-th feature for the observation xd n taking value r. Note that, under this likelihood model, since we have a Gaussian auxiliary variable yd nr and a weighting factor bd kr for each possible value of the observation r ∈{1, . . . , Rd}, we need to gather all the weighting factors bd kr in a K × Rd matrix Bd, and all the Gaussian auxiliary variables yd nr in the N × Rd matrix Yd. Under this observation model, we can write yd nr = znbd r + ud nr, where ud nr is a Gaussian noise variable with variance σ2 y, and therefore, we can obtain the probability of each element xd n taking value r ∈{1, . . . , Rd} as [6] p(xd n = r|zn, Bd) = Ep(u) " Rd Y j=1 j̸=r Φ  u + zn(bd r −bd j) # , (3) where subscript r in bd r states for the column in Bd (r ∈{1, . . . , Rd}), Φ(·) denotes the cumulative density function of the standard normal distribution and Ep(u)[·] denotes expectation with respect to the distribution p(u) = N(0, σ2 y). Ordinal Data. Consider ordinal data, in which each element xd n takes values in the ordered index set {1, . . . , Rd}. Then, assuming an ordered probit model, we can write xd n =          1 if yd n ≤θd 1 2 if θd 1 < yd n ≤θd 2 ... Rd if θd Rd−1 < yd n (4) where again yd n is Gaussian distributed with mean znBd and variance σ2 y, and θd r for r ∈ {1, . . . , Rd −1} are the thresholds that divide the real line into Rd regions. We assume the thresholds θd r are sequentially generated from the truncated Gaussian distribution θd r ∝N(θd r|0, σ2 θ)I(θd r > θd r−1), where θd 0 = −∞and θd Rd = +∞. As opposed to the categorical case, now we have a unique 4 weighting vector Bd and a unique Gaussian variable yd n for each observation xd n. Hence, the value of xd n is determined by the region in which yd n falls. Under the ordered probit model [2], the probability of each element xd n taking value r ∈{1, . . . , Rd} can be written as p(xd n = r|zn, Bd) = Φ θd r −znBd σy ! −Φ θd r−1 −znBd σy ! . (5) Let us remark that, if the d-dimension of the observation matrix contains ordinal data, the set of auxiliary variables reduces to the Gaussian thresholds Ψd = {θd 1, . . . , θd Rd−1} and Hd = σ2 θ. Count Data. In count data each observation xd n takes non-negative integer values, i.e., xd n ∈ {0, . . . , ∞}. Then, we assume xd n = ⌊f(yd n)⌋, (6) where ⌊v⌋returns the floor of v, that is the largest integer that does not exceed v, and f : ℜ→ℜ+ is a monotonic differentiable function that maps from the real numbers to the positive real numbers. We can therefore write the likelihood function as p(xd n|zn, Bd) = Φ f −1(xd n + 1) −znBd σy ! −Φ f −1(xd n) −znBd σy ! (7) where f −1 : ℜ+ →ℜis the inverse function of the transformation f(·). Z σ2 B ↵ Yd Bd d = 1, . . . , D σ2 y X d Hd Figure 1: Generalized IBP for mixed continuous and discrete observations. 4 Inference Algorithm In this section we describe our algorithm for inferring the latent variables given the observation matrix. Under our model, detailed in Section 3, the probability distribution over the observation matrix is fully characterized by the latent matrices Z and {Bd}D d=1 (as well as the auxiliary variables Ψd). Hence, if we assume the latent vector zn for the n-th datapoint and the weighting factors Bd (and the auxiliary variables Ψd) to be known, we have a probability distribution over missing observations xd n from which we can obtain estimates for xd n by sampling from this distribution,3 or by simply taking either its mean, mode or median value. However, this procedure requires the latent matrix Z and the latent weighting factors Bd (and Ψd) to be known. We use Markov Chain Monte Carlo (MCMC) methods, which have been broadly applied to infer the IBP matrix (see, e.g., in [8, 23, 20]). The proposed inference algorithm is summarized in Algorithm 1. This algorithm exploits the information in the available data to learn the similarities among the objects (captured in our model by the latent feature matrix Z), and how these latent features show up in the attributes that describe the objects (captured in our model by Bd). In Algorithm 1, we first need to update the latent matrix Z. Note that conditioned on {Yd}D d=1, both the latent matrix Z and the weighting matrices {Bd}D d=1 are independent of the observation matrix X. Additionally, since {Bd}D d=1 and {Yd}D d=1 are Gaussian distributed, we can analytically marginalize out the weighting matrices {Bd}D d=1 to obtain p({Yd}D d=1|Z). Therefore, to infer the matrix Z, we can apply the collapsed Gibbs sampler which presents better mixing properties than the uncollapsed 3Note that sampling from this distribution might be computationally expensive. In this case, we can easily obtain samples of xd n by exploiting the structure of our model. In particular, we can simply sample the auxiliary Gaussian variables yd n given zn and Bd, and then obtain an estimate for xd n by applying the corresponding transformation, detailed in Section 3.1. 5 Algorithm 1 Inference Algorithm. Input: X Initialize: initialize Z and {Yd}D d=1 1: for each iteration do 2: Update Z given {Yd}D d=1. 3: for d = 1, . . . , D do 4: Sample Bd given Z and Yd according to (8). 5: Sample Yd given X, Z and Bd (as shown in the Supplementary Material). 6: Sample Ψd if needed (as shown in the Supplementary Material). 7: end for 8: end for Output: Z, {Bd}D d=1 and {Ψd}D d=1 Gibbs sampler and, in consequence, is the standard method of choice in the context of the standard linear-Gaussian IBP [8]. However, this algorithm suffers from a high computational cost (being complexity per iteration cubic with the number of data points N), which is prohibitive when dealing with large databases. In order to solve this limitation, we resort to the accelerated Gibbs sampler [4] instead. This algorithm presents linear complexity with the number of datapoints and is detailed in the Supplementary Material. Second, we need to sample the weighting factors in Bd, which is a K × Rd matrix in the case of categorical attributes, and a K-length column vector otherwise. We denote each column vector in Bd by bd r. The posterior over the weighting vectors are given by p(bd r|yd r, Z) = N(bd r|P−1λd r, P−1), (8) where P = Z⊤Z + 1/σ2 BIk and λd r = Z⊤yd r. Note that the covariance matrix P−1 depend neither on the dimension d nor on r, so we only need to invert the K × K matrix P once at each iteration. We describe in the Supplementary Material how to efficiently compute P after changes in the Z matrix by rank one updates, without the need of computing the matrix product Z⊤Z. Once we have updated Z and Bd, we sample each element in Yd from the distribution N(yd nr|znbd, σ2 y) if the observation xd n is missing, and from the posterior p(yd nr|xd n, zn, bd) specified in the Supplementary Material, otherwise. Finally, we sample the auxiliary variables in Ψd from their posterior distribution (detailed in the Supplementary Material) if necessary. This two latter steps involve, in the worst case, sampling from a doubly truncated univariate normal distribution (see the Supplementary Material for further details), for which we make use of the algorithm in [11]. 5 Experimental evaluation We now validate the proposed algorithm for table completion on five real databases, which are summarized in Table 1. The datasets contain different numbers of instances and attributes, which cover all the discrete and continuous variables described in Section 3. We compare, in terms of predictive log-likelihood, the following methods for table completion: • The proposed general table completion approach denoted by GIBP (detailed in Section 3). • The standard linear-Gaussian IBP [8] denoted by SIBP, treating all the attributes as Gaussian. • The Bayesian probabilistic matrix factorization approach [15] denoted by BPMF, that also treats all the attributes in X as Gaussian distributed. For the GIBP, we consider for the real positive and the count data the following transformation, that maps from the real numbers to the real positive numbers, f(x) = log(exp(wx) + 1), where w is a user hyper-parameter. Before running the SIBP and the BPMF methods we normalize each column in matrix X to have zero-mean and unit-variance. Then, in order to provide estimates for the missing data, we denormalize the inferred Gaussian variable. Additionally, since both the SIBP and the BPMF assume continuous observations, when dealing with discrete data, we estimate each missing value as the closest integer value to the (denormalized) Gaussian variable. 6 Dataset N D Description Statlog German credit dataset [5] 1,000 20 (10 C + 4 O + 6 N) Collects information about the credit risks of the applicants. QSAR biodegradation dataset [10] 1,055 41 (2 R + 17 P + 4 C + 18 N) Contains molecular descriptors of biodegradable and non-biodegradable chemicals. Internet usage survey dataset [1] 1,006 32 (23 C + 8 O + 1 N) Contains the responses of the participants to a survey related to the usage of internet. Wine quality Dataset [3] 6,497 12 (11 P + 1 N) Contains the results of physicochemical tests realized to different wines. NESARC dataset [13] 43,000 55 C Contains the responses of the participants to a survey related to personality disorders. Table 1: Description of datasets. ‘R’ states for real-valued variables, ‘P’ for positive real-valued variables, ‘C’ for categorical variables, ‘O’ for ordinal variables and ‘N’ for count variables 10 20 30 40 50 −6 −5 −4 −3 −2 −1 % of missing data Log−likelihood GIBP SIBP BPMF (a) Statlog. 10 20 30 40 50 −10 −8 −6 −4 −2 0 % of missing data Log−likelihood GIBP SIBP BPMF (b) QSAR biodegradation. 10 20 30 40 50 60 70 80 90 −2.5 −2 −1.5 −1 % of missing data Log−likelihood GIBP SIBP BPMF (c) Internet usage survey. 10 20 30 40 50 60 70 80 90 −10 −5 0 % of missing data Log−likelihood GIBP SIBP BPMF (d) Wine quality. 10 20 30 40 50 60 70 80 90 −0.8 −0.7 −0.6 −0.5 % of missing data Log−likelihood GIBP SIBP (e) Nesarc database Figure 2: Average test log-likelihood per missing datum. The ‘whiskers’ show a standard deviations from the average test log-likelihood. In Figure 2, we plot the average predictive log-likelihood per missing value as a function of the percentage of missing data. Each value in Figure 2 has been obtained by averaging the results in 20 independent sets where the missing values have been randomly chosen. In Figures 2a and 2b, we cut the plot in 50% because, in these two databases, the discrete attributes present a mode value that is present for more than 80% of the instances. As a consequence, the SIBP and the BPMF algorithms assign probability close to one to the mode, which results in an artificial increase in the average test log-likelihood for larger percentages of missing data. For the BPMF model, we have used different numbers of latent features (in particular, 10, 20 and 50), although we only show the best results for each database, specifically, K = 10 for the NESARC and the wine databases, and K = 50 for the remainder. Both the GIBP and the SIBP have not inferred a number of (binary) latent features above 25 in any case. Note that in Figure 2e, we only plot the test log-likelihood for the GIBP and the SIBP because the BPMF provides much lower values. As expected, we observe in Figure 2 that the average test log-likelihood decreases for the three models when the number of missing values increases (flat shape of the curves are due to the y-axis scale). In this figure, we also observe that the proposed general IBP model outperforms the SIBP and the BPMF for four of the the databases, being the SIBP slightly better for the Internet database. The BPMF model presents the lowest test-log-likelihood in all the databases. Now, we analyze the performance of the three models for each kind of discrete and continuous variables. Figure 3 shows average predictive likelihood per missing value for each attribute in the table, i.e., for each dimension in X. In this figure we have grouped the dimensions according to the kind of data that they contain, showing in the x-axis the number of considered categories for the case of categorical and ordinal data. In this figure, we observe that the GIBP presents similar performance 7 for all the attributes in the five databases, while for the SIBP and the BPMF models, the test-loglikelihood falls drastically for some of the attributes, being this effect worse in the case of the BPMF (it explains the low log-likelihood in Figure 2). This effect is even more evident in Figures 2b and 2d. We also observe, in Figures 2 and 3, that both IBP based approaches (the GIBP and the SIBP) outperform the BPMF, with the proposed GIBP being the one that best performs across all the databases. We can conclude that, unlike to the BPMF and the GIBP, the GIBP provides accurate estimates for the missing data regardless of their discrete or continuous nature. 6 Conclusions In this paper, we have proposed a table completion approach for heterogeneous databases, based on an IBP with a generalized likelihood that allows for mixed discrete and continuous data. We have then derived an inference algorithm that scales linearly with the number of observations. Finally, our experimental results over five real databases have shown than the proposed approach outperforms, in terms of robustness and accuracy, approaches that treat all the attributes as Gaussian variables. C5 C10 C5 C3 C4 C3 C3 C4 C2 C2 O4 O5 O5 O2 N N N N N N −30 −20 −10 0 Attribute Log−likelihood GIBP SIBP BPMF (a) Statlog. R R P P P P P P P P P P P P P P P P P C2C2C4C2 N N N N N N N N N N N N N N N N N N −30 −20 −10 0 10 Attribute Log−likelihood GIBP SIBP BPMF (b) QSAR biodegradation. C3 C3 C3 C3 C3 C3 C4 C4 C4 C5 C5 C6 C6 C6 C6 C6 C5 C5 C3 C2 C2 C2 C9 O6 O7 O7 O7 O7 O7 O8 O6 N −8 −6 −4 −2 0 Attribute Log−likelihood GIBP SIBP BPMF (c) Internet usage survey. P P P P P P P P P P P N −30 −20 −10 0 10 Attribute Log−likelihood GIBP SIBP BPMF (d) Wine quality. C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C −30 −20 −10 0 Attribute Log−likelihood GIBP SIBP BPMF (e) Nesarc database Figure 3: Average test log-likelihood per missing datum in each dimension of the data with 50% of missing data. In the x-axis ‘R’ states for real-valued variables, ‘P’ for positive real-valued variables, ‘C’ for categorical variables, ‘O’ for ordinal variables and ‘N’ for count variables. The number that accompanies the ‘C’ or ‘O’ corresponds to the number of categories. Acknowledgments Isabel Valera acknowledge the support of Plan Regional-Programas I+D of Comunidad de Madrid (AGES-CM S2010/BMD-2422), Ministerio de Ciencia e Innovaci´on of Spain (project DEIPRO TEC2009-14504-C02-00 and program Consolider-Ingenio 2010 CSD2008-00010 COMONSENS). Zoubin Ghahramani is supported by the EPSRC grant EP/I036575/1 and a Google Focused Research Award. 8 References [1] Pew Research Centre. 25th anniversary of the web. Available on: http://www.pewinternet.org/datasets/january-2014-25th-anniversary-of-the-web-omnibus/. [2] W. Chu and Z. Ghahramani. Gaussian processes for ordinal regression. J. Mach. Learn. Res., 6:1019– 1041, December 2005. [3] P. Cortez, A. Cerdeira, F. Almeida, T. Matos, and J. Reis. Modeling wine preferences by data mining from physicochemical properties. Decision Support Systems. Dataset available on: http://archive.ics.uci.edu/ml/datasets.html, 47(4):547–553, 2009. [4] F. Doshi-Velez and Z. Ghahramani. Accelerated sampling for the indian buffet process. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, pages 273–280, New York, NY, USA, 2009. ACM. [5] J. Eggermont, J. N. Kok, and W. A. Kosters. Genetic programming for data classification: Partitioning the search space. In In Proceedings of the 2004 Symposium on applied computing (ACM SAC04). Dataset available on: http://archive.ics.uci.edu/ml/datasets.html, pages 1001–1005. ACM, 2004. [6] M. Girolami and S. Rogers. Variational Bayesian multinomial probit regression with Gaussian process priors. Neural Computation, 18:2006, 2005. [7] P. Gopalan, F. J. R. Ruiz, R. Ranganath, and D. M. Blei. Bayesian Nonparametric Poisson Factorization for Recommendation Systems. nternational Conference on Artificial Intelligence and Statistics (AISTATS), 2014. [8] T. L. Griffiths and Z. Ghahramani. The Indian buffet process: an introduction and review. Journal of Machine Learning Research, 12:1185–1224, 2011. [9] X.-B. Li. A Bayesian approach for estimating and replacing missing categorical data. J. Data and Information Quality, 1(1):3:1–3:11, June 2009. [10] K. Mansouri, T. Ringsted, D. Ballabio, R. Todeschini, and V. Consonni. Quantitative structureactivity relationship models for ready biodegradability of chemicals. Journal of Chemical Information and Modeling. Dataset available on: http://archive.ics.uci.edu/ml/datasets.html. [11] C. P. Robert. Simulation of truncated normal variables. Statistics and computing, 5(2):121–125, 1995. [12] F. J. R. Ruiz, I. Valera, C. Blanco, and F. Perez-Cruz. Bayesian nonparametric modeling of suicide attempts. Advances in Neural Information Processing Systems, 25:1862–1870, 2012. [13] F. J. R. Ruiz, I. Valera, C. Blanco, and F. Perez-Cruz. Bayesian nonparametric comorbidity analysis of psychiatric disorders. Journal of Machine Learning Research (To appear). Available on http://arxiv.org/pdf/1401.7620v1.pdf, 2013. [14] R. Salakhutdinov and A. Mnih. Probabilistic matrix factorization. In Advances in Neural Information Processing Systems, 2007. [15] R. Salakhutdinov and A. Mnih. Bayesian probabilistic matrix factorization using Markov Chain Monte Carlo. In Proceedings of the 25th International Conference on Machine Learning, ICML ’08, pages 880–887, New York, NY, USA, 2008. ACM. [16] E. Salazar, M. Cain, E. Darling, S. Mitroff, and L. Carin. Inferring latent structure from mixed real and categorical relational data. In Proceedings of the 29th International Conference on Machine Learning (ICML-12), ICML ’12, pages 1039–1046, New York, NY, USA, July 2012. Omnipress. [17] ScienceDaily. Big data, for better or worse: 90% of world’s data generated over last two years. [18] P. Shafto, C. Kemp, Mansinghka V., and Tenenbaum J. B. A probabilistic model of cross-categorization. Cognition, 120(1):1 – 25, 2011. [19] S. Singh and T. Graepel. Automated probabilistic modelling for relational data. In Proceedings of the ACM of Information and Knowledge Management, CIKM ’13, New York, NY, USA, 2013. ACM. [20] M. Titsias. The infinite gamma-Poisson feature model. Advances in Neural Information Processing Systems, 19, 2007. [21] A. Todeschini, F. Caron, and M. Chavent. Probabilistic low-rank matrix completion with adaptive spectral regularization algorithms. In C.J.C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K.Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 845–853. Curran Associates, Inc., Dec. 2013. [22] C. Wang and D. M. Blei. Collaborative topic modeling for recommending scientific articles. In Proceedings of the 17th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’11, pages 448–456, New York, NY, USA, 2011. ACM. [23] S. Williamson, C. Wang, K. Heller, and D. Blei. The IBP compound Dirichlet process and its application to focused topic modeling. Proceedings of the 27th Annual International Conference on Machine Learning, 2010. 9
2014
348
5,456
A Representation Theory for Ranking Functions Harsh Pareek, Pradeep Ravikumar Department of Computer Science University of Texas at Austin {harshp,pradeepr}@cs.utexas.edu Abstract This paper presents a representation theory for permutation-valued functions, which in their general form can also be called listwise ranking functions. Pointwise ranking functions assign a score to each object independently, without taking into account the other objects under consideration; whereas listwise loss functions evaluate the set of scores assigned to all objects as a whole. In many supervised learning to rank tasks, it might be of interest to use listwise ranking functions instead; in particular, the Bayes Optimal ranking functions might themselves be listwise, especially if the loss function is listwise. A key caveat to using listwise ranking functions has been the lack of an appropriate representation theory for such functions. We show that a natural symmetricity assumption that we call exchangeability allows us to explicitly characterize the set of such exchangeable listwise ranking functions. Our analysis draws from the theories of tensor analysis, functional analysis and De Finetti theorems. We also present experiments using a novel reranking method motivated by our representation theory. 1 Introduction A permutation-valued function, also called a ranking function, outputs a ranking over a set of objects given features corresponding to the objects, and learning such ranking functions given data is becoming an increasingly key machine learning task. For instance, tracking a set of objects given a particular order of uncertain sensory inputs involves predicting the permutation of objects corresponding to the inputs at each time step. Collaborative filtering and recommender systems can be modeled as ranking movies (or other consumer objects). Extractive document summarization involves ranking sentences in order of their importance, while also taking diversity into account. Learning rankings over documents, in particular, has received considerable attention in the Information Retrieval community, under the subfield of “learning to rank”. The problems above involve diverse kinds of supervision and diverse evaluation metrics, but with the common feature that the object of interest is a ranking function, that when given an input set of objects, outputs a permutation over the set of objects. In this paper, we will consider the standard generalization of ranking functions which output a real-valued score vector, which can be sorted to yield the desired permutation. The tasks above then entail learning a ranking function given data, and given some evaluation metric which captures the compatibility between two permutations. These evaluation metrics are domainspecific, and even in specific domains such as information retrieval, could be varied based on actual user preferences. Popular IR evaluation metrics for instance include Mean Average Precision (MAP) [1], Expected Reciprocal Rank (ERR) [7] and Normalized Discounted Cumulative Gain (NDCG) [17]. A common characteristic of these evaluation loss functionals are that these are typically listwise: so that the loss evaluates the entire set of scores assigned to all the objects in a manner that is not separable in the individual scores. Indeed, some tasks by their very nature require listwise evaluation metrics. A key example is that of ranking with diversity[5], where the user prefers results that are not only relevant individually, but also diverse mutually; searching for web-pages with the query “Jaguar” should not just return individually relevant results, but also results that cover 1 the car, the animal and the sports team, among others. Chapelle et al [8] also mention ranking for diversity as an important future direction in learning to rank. Other fundamentally listwise ranking problems include pseudo-relevance feedback, topic distillation, subtopic retrieval and ranking over graphs (e.g.. social networks) [22]. While these evaluation/loss functionals (and typically their corresponding surrogate loss functionals as well) are listwise, most parameterizations of the ranking functions used within these (surrogate) loss functionals are typically pointwise, i.e. they rank each object (e.g. document) independently of the other objects. Why should we require listwise ranking functions for listwise ranking tasks? Pointwise ranking functions have the advantage of computational efficiency: since these evaluate each object independently, they can be parameterized very compactly. Moreover, for certain ranking tasks, such as vanilla rank prediction with 0/1 loss or multilabel ranking with certain losses[11], it can be shown that the Bayes-consistent ranking function is pointwise, so that one would lose statistical efficiency by not restricting to the sub-class of pointwise ranking functions. However, as noted above, many modern ranking tasks have an inherently listwise flavor, and correspondingly their Bayes-consistent ranking functions are listwise as well. For instance, [24] show that the Bayesconsistent ranking function of the popular NDCG evaluation metric is inherently listwise. There is however a caveat to using listwise ranking functions: a lack of representation theory, and corresponding guidance to parameterizing such listwise ranking functions. Indeed, the most commonly used ranking functions are linear ranking functions and decision trees, both of which are pointwise. With decision trees, gradient boosting is often used as a technique to increase the complexity of the function class. The Yahoo! Learning to Rank challenge [6] was dominated by such methods, which comprise the state-of-the-art in learning to rank for information retrieval today. It should be noted that gradient boosted decision trees, even if trained with listwise loss functions (e.g.. via LambdaMART[3]), are still a sum of pointwise ranking functions and therefore pointwise ranking functions themselves, and hence subject to the theoretical limitations outlined in this paper. In a key contribution of this paper, we impose a very natural assumption on general listwise ranking functions, which we term exchangeability, which formalizes the notion that the ranking function depends only on the object features, and not the order in which the documents are presented. Specifically, as detailed further in Section 3, we define exchangeable ranking functions as those listwise functions where if their set of input objects is permuted, their output permutation/score vector is permuted in the same way. This simple assumption allows us to provide an explicit characterization of the set of listwise ranking functions in the following form: (f(x))i = h(xi, {x\i}) = X t Πj̸=igt(xi, xj) (1) This representation theorem is the principal contribution of this work. We hope that this result will provide a general recipe for designing learning to rank algorithms for diverse domains. For each domain, practitioners would need to utilize domain knowledge to define a suitable class of pairwise functions g parameterized by w, and use this ranking function in conjunction with a suitable listwise loss. Individual terms in (1) can be fit via standard optimization methods such as gradient descent, while multiple terms can be fit via gradient boosting. In recent work, two papers have proposed specific listwise ranking functions. Qin et al. [22] suggest the use of conditional random fields (CRFs) to predict the relevance scores of the individual documents via the the most probable configuration of the CRF. They distinguish between “local ranking,” which we called ranking with pointwise ranking functions above, and “global ranking” which corresponds to listwise ranking functions; and argue that using CRFs would allow for global ranking. Weston and Blitzer [26] propose a listwise ranking function (“Latent Structured Ranking”) assuming a low rank structure for the set of items to be ranked. Both of these ranking functions are exchangeable as we detail in Appendix A. The improved performance of these specific classes of ranking functions also provides empirical support for the need for a representation theory of general listwise ranking functions. We first consider the case where features are discrete and derive our representation theorem using the theory of symmetric tensor decomposition. For the more general continuous case, we first present the the case with three objects using functional analytic spectral theory. We then present the extension to the general continuous case by drawing upon De Finetti’s theorem. Our analysis highlights the correspondences between these theories, and brings out an important open problem in the functional analysis literature. 2 2 Problem Setup We consider the general ranking setting, where the m objects to be ranked (possibly contingent on a query), are represented by the feature vectors x = (x1, x2, . . . , xm) ∈X m. Typically, X = Rk for some k. The key object of interest in this paper is a ranking function: Definition 2.1 (Ranking function) Given a set of object feature vectors x (possibly contingent on a query q), a ranking function f : X m →Rm is a function that takes as input the m object feature vectors, and has as output a vector of scores for the set of objects, so that f(x) = (f1(x), . . . , fm(x)); for some functions fj : X m →R. It is instructive at this juncture to distinguish between pointwise (local) and listwise (global) ranking functions. A pointwise ranking function f would score each object xi independently, ignoring the other objects, so that each component function fj(x) above depends only on xj, and can be written as a function fj(xj) with some overloading of notation. In contrast, the components fj(x) of the output vector of a listwise ranking function would depend on the feature-vectors of all the documents. 3 Representation theory We investigate the class of ranking functions which satisfy a very natural property: exchanging the feature-vectors of any two documents should cause their positions in the output ranking order to be exchanged. Definition 3.1 formalizes this intuition. Definition 3.1 (Exchangeable Ranking Function) A listwise ranking function f : X m →Rm is said to be exchangeable if f(π(x)) = π(f(x)) for every permutation π ∈Sk (where Sk is the set of all permutations of order k) Letting (f1, f2, . . . , fm) denote the components of the ranking function f, we arrive at the following key characterization of exchangeable ranking functions. Theorem 3.2 Every exchangeable ranking function f : X m →Rm can be written as f(x) = (f1(x), f2(x), . . . , fm(x)) with fi(x) = h(xi, {x\i}) (2) where {x\i} = {xj|1 ≤j ≤m, j ̸= i}, and for some h : X m →R symmetric in {x\i} (i.e. h(y) = h(π(y)), ∀y ∈X m−1, π ∈Sk) Proof The components of a ranking function f : X m →Rm, viz. fi(x), represent the score assigned to each document. First, exchangeability implies that exchanging the feature values of some two documents does not affect the scores of the remaining documents, i.e. fi(x) does not change if i is not involved in the exchange, i.e. fi(x) is symmetric in {x\i} Second, exchanging the feature values of documents 1 and i exchanges their scores, i.e., fi(x1, . . . , xi, . . . , xn) = f1(xi, . . . , x1, . . . , xn) (3) Thus, the scoring function for the ith document can be expressed in terms of that of the first document. Call that scoring function h. Then, combining the two properties above, we have, fi(x) = h(xi, {x\i}) (4) where h is symmetric in {x\i}. Theorem 3.2 entails the intuitive result that the component functions fi of exchangeable ranking functions f can all be expressed in terms of a single partially symmetric function h whose first argument is the document corresponding to that component and which is symmetric in the other documents. Pointwise ranking functions then correspond to the special case where h is independent of the other document-feature-vectors (so that h(xi, {x\i}) = h(xi) with some overloading of notation) and are thus trivially exchangeable. 3 As the main result of this paper, we will characterize the class of such partially symmetric functions h, and thus the set of exchangeable listwise ranking functions, for various classes X as fi(x) = ∞ X t=1 Πj̸=igt(xi, xj) (5) for some set of functions {gt}∞ t=1, gt : X × X →R. 3.1 The Discrete Case: Tensor Decomposition We first consider a decomposition theorem for symmetric tensors, and then through a correspondence between symmetric tensors and symmetric functions with finite domains, derive the corresponding decomposition for symmetric functions. We then simply extend the analysis to obtain the corresponding decomposition theorem for partially symmetric functions. The term tensor may have connotations (from its use in Physics) with regards to how a quantity behaves under linear transformations, but here we use it only to mean “multi-way array”. Definition 3.3 (Tensor) A real-valued order-k tensor is a collection of real-valued elements Ai1,i2,...,ik ∈R indexed by tuples (i1, i2, . . . , ik) ∈X k. Definition 3.4 (Symmetric tensor) An order-k tensor A = [Ai1,i2...,ik] is said to be symmetric iff for any permutation π ∈Sk, Ai1,i2,...,ik = Aiπ(1),iπ(2),...,iπ(k). (6) Comon et al. [9] show that such a symmetric tensor (sometimes called supersymmetric since it is symmetric w.r.t. all dimensions) can be decomposed into a sum of rank-1 symmetric tensors, where a rank-1 symmetric tensor is a k-way outer product of some vector v (we will use the standard notation ⊗to denote an outer product u ⊗v ⊗· · · ⊗z = [uj1vj2 . . . zjk]j1,...,jk). Proposition 3.5 (Decomposition theorem for symmetric tensors [9]) Any order-k symmetric tensor A can be decomposed as a sum of k-fold outer product tensors as follows: A = ∞ X i=1 ⊗kvi (7) The special matrix case (k = 2) of this theorem should be familiar to the reader as the spectral theorem. In that case, the vi are orthogonal, the smallest such representation is unique and can be recovered by tractable algorithms. In the general symmetric tensor case, the vi are not necessarily orthogonal and the decomposition need not be unique; it is however finite [9]. While the spectral theory for symmetric tensors is relatively straightforward, bearing similarity to that for matrices, the theory for general non-symmetric tensors is nontrivial: we refer the interested reader to [21, 20, 10]. However, since we are interested not in general non-symmetric tensors, but partially symmetric tensors, the above theorem can be extended in a straightforward way in our case as we shall see in Theorem 3.7. Our next step involves generalizing the earlier proposition to multivariate symmetric functions by representing them as tensors, which then yields a corresponding spectral theorem of product decompositions for such functions. In particular, note that when the feature vector of each document takes values only from a finite set X, of size |X|, a symmetric function h(x1, x2, . . . , xm) can be represented as an order-m symmetric tensor H where Hv1v2...vm = h(v1, v2, . . . , vm) for vi ∈X. We can thus leverage Proposition 3.5 to obtain the result of the following proposition: Proposition 3.6 (Symmetric Product decomposition for multivariate functions (finite domain)) Any symmetric function f : X m →R for a finite set X can be decomposed as f(x) = ∞ X t=1 Πjgt(xj), (8) for some set of functions {gt}T t=1, gt : X →R, T < ∞ 4 In the case of ranking three documents, each fi assigns a score to document i taking the other document’s features as arguments. fi then corresponds to a matrix and the functions gt correspond to the set of eigenvectors of this matrix. In the general case of ranking m documents, fi is an order m −1 tensor and gt are the eigenvectors for a symmetric decomposition of the tensor. Our class of exchangeable ranking functions corresponds to partially symmetric functions. In the following, we extend the theory above to the partially symmetric case (proof in Appendix B). Theorem 3.7 (Product decomposition for partially symmetric functions) A partially symmetric function h : X m →R symmetric in x2, . . . , xm on a finite set X can be decomposed as h(x1, {x\1}) = ∞ X t=1 Πj̸=1gt(x1, xj) (9) for some set of functions {gt}T t=1, gt : X × X →R, T < ∞. Remarks: I. To the best of our knowledge, the study of partially symmetric tensors and their decompositions as above has not been considered in the literature. Notions such as rank and best successive approximations would be interesting areas for future research. II. The tensor view of learning to rank gives rise to a host of other interesting research directions. Consider the learning to rank problem: each training example corresponds to one entry in the resulting ranking tensor. A candidate approach to learning to rank might thus be tensor-completion, perhaps using a convex nuclear tensor norm regularization [14]. 3.2 The Continuous Case In this section, we generalize the results of the previous section to the more realistic setting where the feature space X is compact. The extension to the partially symmetric case from the symmetric one is similar to that in the discrete case and is given as Theorem C.1 in Appendix C, so we discuss only decomposition theorems for symmetric functions below. 3.2.1 Argument via Functional Analytic Spectral Theorem We first recall some key definitions from functional analysis [25, pp.203]. A linear operator T is bounded if its norm ∥T∥= sup∥x∥=1 ∥Tx∥is finite. A bounded linear operator T is self-adjoint if T = T ∗, where T ∗is the adjoint operator. A linear operator A from a Banach space X to a Banach space Y is compact if it takes bounded sets in X into relatively compact sets (i.e. whose closure is compact) in Y. The Hilbert-Schmidt theorem [25] provides a spectral decomposition for such compact self-adjoint operators. Let A be a compact self-adjoint operator on a Hilbert space H. Then, by the HilbertSchmidt theorem, there is a complete orthonormal basis, {φn}, for H so that Aφn = λnφn and λn →0 as n →∞. A can then be written as: A = ∞ X n=1 λnφn⟨φn, ·⟩. (10) We refer the reader to [25] for further details. The compactness condition can be relaxed to boundedness, but in that case a discrete spectrum {λn} does not exist, and is replaced by a measure µ, and the summation in the Hilbert-Schmidt theorem 3.8 is replaced by an integral. We consider only compact self-adjoint operators in this paper. In the following key theorem, we provide a decomposition theorem for bivariate symmetric functions Theorem 3.8 (Product decomposition for symmetric bivariate functions) A symmetric function f(x, y) ∈L2(X × X) corresponds to a compact self-adjoint operator, and can be decomposed as f(x, y) = ∞ X t=1 λtgt(x)gt(y), 5 for some functions gt ∈L2(X), λt →0 as t →∞ The above result gives a corresponding decomposition theorem (via Theorem C.1) for partially symmetric functions in three variables. Extending the result to beyond three variables would require extending this decomposition result for linear operators to the general multilinear operator case. Unfortunately, to the best of our knowledge, a decomposition theorem for multilinear operators is an open problem in the functional analysis literature. Indeed, even the corresponding discrete tensor case has only been studied recently. Instead, in the next section, we will use a result from probability theory instead, and obtain a proof for our decomposition theorem under additional conditions. 3.2.2 Argument via De Finetti’s Theorem In the previous section, we leveraged the interpretation of multivariate functions as multilinear operators. However, it is also possible to interpret multivariate functions as measures on a product space. Under appropriate assumptions, we will show that a De Finetti-like theorem gives us the required decomposition theorem for symmetric measures. We first review De Finetti’s theorem and related terms. Definition 3.9 (Infinite Exchangeability) An infinite sequence X1, X2, . . . of random variables is said to be exchangeable if for any n ∈N and any permutation π ∈Sn, p(X1, X2, . . . , Xn) = p(Xπ(1), Xπ(2), . . . , Xπ(n)) (11) We note that exchangeability as defined in the probability theory literature refers to symmetricity of the kind above, and is a distinct if related notion compared to that used in the rest of this paper. Then, we have a class of De-Finetti-like theorems: Theorem 3.10 (De Finetti-like theorems) A sequence of random variables X1, X2, . . . is infinitely exchangeable iff, for all n, there exists a probability distribution function µ, such that , p(X1, . . . , Xn) = Z Πn i=1p(Xi; θ)µ(dθ) (12) where p denotes the pdf of the corresponding distribution This decomposes the joint distribution over n variables into an integral over product distributions. De Finetti originally proved this result for 0-1 random variables, in which case the p(Xi; θ) are Bernoulli with parameter θ a real-valued random variable, θ = limn→∞ P i Xi/n. For accessible proofs of this result and a similar one for the case when Xi are instead discrete, we refer the reader to [15, 2]. This result was later extended to the case where the variables Xi take values in a compact set X by Hewitt and Savage [16]. (The proof in [16] first shows that the set of symmetric measures is a convex set whose set of extreme points is precisely the set of all product measures, i.e. independent distributions. Then, it establishes a Choquet representation i.e. an integral representation of this convex set as a convex combination of its extreme points, giving us a De Finetti-like theorem as above.) In this general case, the parameter θ can be interpreted as being distribution-valued – as opposed to real valued in the binary case described above. Our description of this result is terse for lack of space, see [2, pp.188] for details. Thus, we derive the following theorem: Theorem 3.11 (Product decomposition for Symmetric functions) Given an infinite sequence of documents with features xi from a compact set X, if a function f : X m →R+ is symmetric in every leading subset of n documents, and R f = M < ∞, then f/M corresponds to a probability measure and f can be decomposed as f(x) = Z Πjg(xj; θ)µ(dθ) (13) for some set of functions {g(·; θ)}, g : X →R This theorem can also be applied to discrete valued features Xi, and we would obtain a representation similar to that obtained through tensor analysis in Section 3.1. Applied to features Xi 6 belonging to a compact set, we obtain the required representation theorem similar to the functional analytic theory of Section 3.2.1. However, note that De Finetti’s theorem integrates over products of probabilities, so that each term is non-negative, a restriction not present in the functional analytic case. Moreover, we have an integral in the De Finetti decomposition, while via tensor analysis in the discrete case, we have a finite sum whose size is given by the rank of the tensor, and in the functional analytic analysis, the spectrum for bounded operators is discrete. De Finetti’s theorem also requires the existence of infinitely many objects for which every leading finite subsequence is exchangeable. The similarities and differences between the functional analytic viewpoint and De Finetti’s theorem have been previously noted in the literature, for instance in Kingman’s 1977 Wald Lecture [19] and we discuss them further in Appendix E. 4 Experiments For our experiments, we consider the information retrieval learning to rank task, where we are given a training set consisting of n queries. Each query q(i) is associated with m documents, represented via feature vectors x(i) = (x(i) 1 , x(i) 2 , . . . , x(i) m ) ∈X m. The documents for q(i) have relevance levels r(i) = (r(i) 1 , r(i) 2 , . . . , r(i) m ) ∈Rm. Typically, R = {0, 1, . . . , l −1}. The training set thus consists of the tuples T = {x(i), r(i)}n i=1. T is assumed sampled i.i.d. from a distribution D over X m ×Rm. Ranking Loss Functionals We are interested in the NDCG ranking evaluation metric, and hence for the ranking loss functional, we focus on optimization-amenable listwise surrogates for NDCG; specifically, a convex class of strongly NDCG-consistent loss functions introduced in [24] and nonconvex listwise loss functions, ListNet [4] and the Cosine Loss. In addition, we impose an ℓ2 regularization penalty on ∥w∥. [24] exhaustively characterized the set of strongly NDCG consistent surrogates as Bregman divergences Dψ corresponding to strictly convex ψ (see Appendix F). We choose the following instances of ψ: the Cross Entropy loss with ψ(x) = 0.01(P i xi log xi−xi), the square loss with ψ(x) = ∥x∥2 and the q-norm loss with ψ(x) = ∥x∥2 q, q = log(m) + 2 (where m is the number of documents). Note that the multiplicative factor in ψ is significant as it does affect φ. Ranking Functions The representation theory of the previous sections gives a functional form for listwise ranking functions. In this section, we pick a simple class of ranking functions inspired by this representation theory, and use it to rerank the scores output by various pointwise ranking functions. Consider the following class of exchangeable ranking functions f(x) where the score for the ith document is given by: fi(x) = b(xi)Πj̸=ig(xi, xj; w) = b(xi)Πj̸=i exp X k wkSk(xi, xj) ! (14) where b(xi) is the score provided by the base ranker for the i-th document, and Sk are pairwise functions (“kernels”) applied to xi and xj. Note that w = 0 yields the base ranking functions. Our theory suggests that we can combine several such terms as fi(x) = P t b(xi; vt)Πj̸=ig(xi, xj; wt). For our experiments, we only use one such term. A Gradient Boosting procedure can be used on top of our procedure to fit multiple terms for this series. Our choice of g is motivated by computational considerations: For general functions g, the computation of (14) would require O(m) time per function evaluation, where m is the number of documents. However, the specific functional form in (14) allows O(1) time per function evaluation as fi(x; w) = b(xi)Πk(exp(wk P j̸=i Sk(xi, xj))), where the inner term P j̸=i Sk(xi, xj) in the RHS does not depend on w and can be precomputed. Thus after the precomputation step, each function evaluation is as efficient as that for a pointwise ranking function. As the base pointwise rankers b, we use those provided by RankLib1: MART, RankNet, RankBoost, AdaRank, Coordinate Ascent (CA), LambdaMART, ListNet, Random Forests, Linear regression. We refer the reader to the RankLib website for details on these. 1https://sourceforge.net/p/lemur/wiki/RankLib/ 7 Table 1: Results for our reranking procedure across LETOR 3.0 datasets. For each dataset, the first column is the base ranker, second column is the loss function used for reranking. OHSUMED TD2003 NP2003 Base Reranked w/ Base Reranked w/ Base Reranked w/ RankBoost Cross Ent CA q-Norm MART Square ndcg@1 0.5104 0.5421 0.3500 0.3250 0.5467 0.5600 ndcg@2 0.4798 0.4901 0.2875 0.3375 0.6500 0.6567 ndcg@5 0.4547 0.4615 0.3228 0.3461 0.7112 0.7128 ndcg@10 0.4356 0.4445 0.3210 0.3385 0.7326 0.7344 HP2003 HP2004 NP2004 Base Reranked w/ Base Reranked w/ Base Reranked w/ MART Cross Ent RankBoost q-Norm MART Square ndcg@1 0.6667 0.7333 0.5200 0.5333 0.3600 0.3733 ndcg@2 0.7667 0.7667 0.6067 0.6533 0.4733 0.4867 ndcg@5 0.7546 0.7618 0.7034 0.7042 0.5603 0.5719 ndcg@10 0.7740 0.7747 0.7387 0.7420 0.5951 0.6102 Results We use the LETOR 3.0 collection [23], which contains the OHSUMED dataset and the Gov collection: HP2003/04, TD2003/04, NP2003/04, which respectively correspond to the listwise Homepage Finding, Topic Distillation and Named Page Finding tasks. We use NDCG as evaluation metric and show gains instead of losses, so larger values are better. We use the following pairwise functions/kernels {Sk}: we construct a cosine similarity function for documents using the Query Normalized document features for each LETOR dataset. In addition, OHSUMED contains document similarity information for each query and the Gov datasets contain link information and a sitemap, i.e. a parent-child relation. We use these relations directly as the kernels Sk in (14). Thus, we have two kernels for OHSUMED and three for the Gov datasets, and w is 2- and 3-dimensional respectively. To obtain the scores b for the baseline pointwise ranking function, we used Ranklib v2.1-patched with its default parameter values. LETOR contains 5 predefined folds with training, validation and test sets. We use these directly and report averaged results on the test set. For the ℓ2 regularization parameter, we pick a C from [0, 1e-5,1e-2, 1e-1, 1, 10, 1e2,1e3] tuning for maximum NDCG@10 on the validation set. We used gradient descent on w to fit parameters. Though our objective is nonconvex, we found that random restarts did not affect the achieved minimum and used the initial value w = 0 for our experiments. Since w = 0 corresponds to the base pointwise rankers, we expect the reranking method to perform as well as the base rankers in the worst case. Table 1 shows some results across LETOR datasets which show improvements over the base rankers. For each dataset, we compare the NDCG for the specified base rankers with the NDCG for our reranking method with that base ranker and the specified listwise loss. (Detailed results are presented in Appendix G). Gradient descent required on average only 17 iterations and 20 function evaluations, thus the principal computational cost of this method was the precomputation for eq. (14). The low computational cost and shown empirical results for the reranking method are promising and validate our theoretical investigation. We hope that this representation theory will enable the development of listwise ranking functions across diverse domains, especially those less studied than ranking in information retrieval. Acknowledgements We acknowledge the support of ARO via W911NF-12-1-0390 and NSF via IIS-1149803, IIS1320894, IIS-1447574, and DMS-1264033. 8 References [1] R. Baeza-Yates and B. Ribeiro-Neto. Modern information retrieval. Addison Wesley, 1999. [2] J. M. Bernardo and A. F. Smith. Bayesian theory, volume 405. John Wiley & Sons, 2009. [3] C. J. Burges. From RankNet to LambdaRank to LambdaMart: An overview. Learning, 11:23–581, 2010. [4] Z. Cao, T. Qin, T.-Y. Liu, M.-F. Tsai, and H. Li. Learning to rank: from pairwise approach to listwise approach. In International Conference on Machine learning 24, pages 129–136. ACM, 2007. [5] J. Carbonell and J. Goldstein. The use of MMR, diversity-based reranking for reordering documents and producing summaries. In Proceedings of the 21st annual international ACM SIGIR conference on Research and development in information retrieval, pages 335–336. ACM, 1998. [6] O. Chapelle and Y. Chang. Yahoo! learning to rank challenge overview. Journal of Machine Learning Research-Proceedings Track, 14:1–24, 2011. [7] O. Chapelle, D. Metzler, Y. Zhang, and P. Grinspan. Expected reciprocal rank for graded relevance. In Conference on Information and Knowledge Management (CIKM), 2009. [8] O. Chapelle, Y. Chang, and T. Liu. Future directions in learning to rank. In JMLR Workshop and Conference Proceedings, volume 14, pages 91–100, 2011. [9] P. Comon, G. Golub, L. Lim, and B. Mourrain. Symmetric tensors and symmetric tensor rank. SIAM Journal on Matrix Analysis and Applications, 30(3):1254–1279, 2008. [10] L. De Lathauwer, B. De Moor, and J. Vandewalle. A multilinear singular value decomposition. SIAM journal on Matrix Analysis and Applications, 21(4):1253–1278, 2000. [11] K. Dembczynski, W. Kotlowski, and E. Huellermeier. Consistent multilabel ranking through univariate losses. arXiv preprint arXiv:1206.6401, 2012. [12] P. Diaconis. Finite forms of de Finetti’s theorem on exchangeability. Synthese, 36(2):271–281, 1977. [13] P. Diaconis and D. Freedman. Finite exchangeable sequences. The Annals of Probability, pages 745–764, 1980. [14] S. Gandy, B. Recht, and I. Yamada. Tensor completion and low-n-rank tensor recovery via convex optimization. Inverse Problems, 27(2):025010, 2011. [15] D. Heath and W. Sudderth. De Finetti’s theorem on exchangeable variables. The American Statistician, 30(4):188–189, 1976. [16] E. Hewitt and L. J. Savage. Symmetric measures on Cartesian products. Transactions of the American Mathematical Society, pages 470–501, 1955. [17] K. J¨arvelin and J. Kek¨al¨ainen. IR evaluation methods for retrieving highly relevant documents. In SIGIR ’00: Proceedings of the 23rd annual international ACM SIGIR conference on research and development in information retrieval, pages 41–48, New York, NY, USA, 2000. ACM. [18] E. T. Jaynes. Some applications and extensions of the de Finetti representation theorem. Bayesian Inference and Decision Techniques, 31:42, 1986. [19] J. F. Kingman. Uses of exchangeability. The Annals of Probability, pages 183–197, 1978. [20] T. G. Kolda and B. W. Bader. Tensor decompositions and applications. SIAM review, 51(3):455–500, 2009. [21] L. Qi. The spectral theory of tensors (Rough Version). arXiv preprint arXiv:1201.3424, 2012. [22] T. Qin, T. Liu, X. Zhang, D. Wang, and H. Li. Global ranking using continuous conditional random fields. In Proceedings of the Twenty-Second Annual Conference on Neural Information Processing Systems (NIPS 2008), 2008. [23] T. Qin, T. Liu, J. Xu, and H. Li. LETOR: A benchmark collection for research on learning to rank for information retrieval. Information Retrieval, 13(4):346–374, 2010. [24] P. Ravikumar, A. Tewari, and E. Yang. On NDCG consistency of listwise ranking methods. 2011. [25] M. C. Reed and B. Simon. Methods of modern mathematical physics: Functional analysis, volume 1. Gulf Professional Publishing, 1980. [26] J. Weston and J. Blitzer. Latent Structured Ranking. arXiv preprint arXiv:1210.4914, 2012. 9
2014
349
5,457
PEWA: Patch-based Exponentially Weighted Aggregation for image denoising Charles Kervrann Inria Rennes - Bretagne Atlantique Serpico Project-Team Campus Universitaire de Beaulieu, 35 042 Rennes Cedex, France charles.kervrann@inria.fr Abstract Patch-based methods have been widely used for noise reduction in recent years. In this paper, we propose a general statistical aggregation method which combines image patches denoised with several commonly-used algorithms. We show that weakly denoised versions of the input image obtained with standard methods, can serve to compute an efficient patch-based aggregated estimator. In our approach, we evaluate the Stein’s Unbiased Risk Estimator (SURE) of each denoised candidate image patch and use this information to compute the exponential weighted aggregation (EWA) estimator. The aggregation method is flexible enough to combine any standard denoising algorithm and has an interpretation with Gibbs distribution. The denoising algorithm (PEWA) is based on a MCMC sampling and is able to produce results that are comparable to the current state-of-the-art. 1 Introduction Several methods have been proposed to solve the image denoising problem including anisotropic diffusion [15], frequency-based methods [26], Bayesian and Markov Random Fields methods [20], locally adaptive kernel-based methods [17] and sparse representation [10]. The objective is to estimate a clean image generally assumed to be corrupted with additive white Gaussian (AWG) noise. In recent years, state-of-the-art results have been considerably improved and the theoretical limits of denoising algorithms are currently discussed in the literature [4, 14]. The most competitive methods are mostly patch-based methods, such as BM3D [6], LSSC [16], EPLL [28], NL-Bayes [12], inspired from the N(on)L(ocal)-means [2]. In the NL-means method, each patch is replaced by a weighted mean of the most similar patches found in the noisy input image. BM3D combines clustering of noisy patches, DCT-based transform and shrinkage operation to achieve the current state-of-the-art results [6]. PLOW [5], S-PLE [24] and NL-Bayes [12], falling in the same category of the so-called internal methods, are able to produce very comparable results. Unlike BM3D, covariances matrices of clustered noisy patches are empirically estimated to compute a Maximum A Posteriori (MAP) or a Minimum-Mean-Squared-Error (MMSE) estimate. The aforementioned algorithms need two iterations [6, 12, 18] and the performances are surprisingly very close to the state-of-the-art in average while the motivation and the modeling frameworks are quite different. In this paper, the proposed Patch-based Exponential Weighted Aggregation (PEWA) algorithm, requiring no patch clustering, achieves also the state-of-the-art results. A second category of patch-based external methods (e.g. FoE [20], EPLL [28], MLP [3]) has been also investigated. The principle is to approximate the noisy patches using a set of patches of an external learned dictionary. The statistics of a noise-free training set of image patches, serve as priors for denoising. EPLL computes a prior from a mixture of Gaussians trained with a database of clean image patches [28]; denoising is then performed by maximizing the so-called Expected Patch Log Likelihood (EPLL) criteria using an optimization algorithm. In this line of work, a multi1 layer perceptron (MLP) procedure exploiting a training set of noisy and noise-free patches was able to achieve the state-of-the-art performance [3]. Nevertheless, the training procedure is dedicated to handle a fixed noise level and the denoising method is not flexible enough, especially for real applications when the signal-to-noise ratio is not known. Recently, the similarity of patch pairs extracted from the input noisy image and from clean patch dataset has been studied in [27]. The authors observed that more repetitions are found in the same noisy image than in a clean image patch database of natural images; also, it is not necessary to examine patches far from the current patch to find good matching. While the external methods are attractive, computation is not always feasible since a very large collection of clean patches are required to denoise all patches in the input image. Other authors have previously proposed to learn a dictionary on the noisy image [10] or to combine internal and external information (LSSC) [16]. In this paper, we focus on internal methods since they are more flexible for real applications than external methods. They are less computationally demanding and remain the most competitive. Our approach consists in estimating an image patch from “weakly” denoised image patches in the input image. We consider the general problem of combining multiple basic estimators to achieve an estimation accuracy not much worse than that of the “best” single estimator in some sense. This problem is important for practical applications because single estimators often do not perform as well as their combinations. The most important and widely studied aggregation method that achieves the optimal average risk is the Exponential Weighted Aggregation (EWA) algorithm [13, 7, 19]. Salmon & Le Pennec have already interpreted the NL-means as a special case of the EWA procedure but the results of the extended version described in [21] were similar to [2]. Our estimator combination is then achieved through a two-step procedure, where multiple estimators are first computed and are then combined in a second separate computing step. We shall see that the proposed method can be thought as a boosting procedure [22] since the performance of the precomputed estimators involved in the first step are rather poor, both visually and in terms of peak signal-to-noise ratio (PSNR). Our contributions are the following ones: 1. We show that “weak” denoised versions of the input noisy images can be combined to get a boosted estimator. 2. A spatial Bayesian prior and a Gibbs energy enable to select good candidate patches. 3. We propose a dedicated Monte Carlo Markov Chain (MCMC) sampling procedure to compute efficiently the PEWA estimator. The experimental results are comparable to BM3D [6] and the method is implemented efficiently since all patches can be processed independently. 2 Patch-based image representation and SURE estimation Formally, we represent a n-dimensional image patch at location x ∈X ⊂R2 as a vector f(x) ∈Rn. We define the observation patch v(x) ∈Rn as: v(x) = f(x) + ε(x) where ε(x) ∼N(0, σ2In×n) represents the errors. We are interested in an estimator bf(x) of f(x) assumed to be independent of f(x) that achieves a small L2 risk. We consider the Stein’s Unbiased Risk Estimator R( bf(x)) = ∥v(x) −bf(x)∥2 n −nσ2 in the Mean Square Error sense such that E[R( bf(x))] = E[∥f(x) −bf(x)∥2 n] (E denotes the mathematical expectation). SURE has been already investigated for image denoising using NL-means [23, 9, 22, 24] and for image deconvolution in [25]. 3 Aggregation by exponential weights Assume a family {fλ(x), λ ∈Λ} of functions such that the mapping λ →fλ(x) is measurable and Λ = {1, · · · , M}. Functions fλ(x) can be viewed as some pre-computed estimators of f(x) or “weak” denoisers independent of observations v(x), and considered as frozen in the following. The set of M estimators is assumed to be very large, that is composed of several hundreds of thousands 2 of candidates. In this paper, we consider aggregates that are weighted averages of the functions in the set {fλ(x), λ ∈Λ} with some data-dependent weights: bf(x) = M X λ=1 wλ(x) fλ(x) such that wλ(x) ≥0 and M X λ=1 wλ(x) = 1. (1) As suggested in [19], we can associate two probability measures w(x) = {w1(x), · · · , wM(x)} and π(x) = {π1(x), · · · , πM(x)} on {1, · · · , M} and we define the Kullback-Leibler divergence as: DKL(w(x), π(x)) = M X λ=1 wλ(x) log wλ(x) πλ(x)  . (2) The exponential weights are obtained as the solution of the following optimization problem: bw(x) = arg min w(x)∈RM ( M X λ=1 wλ(x)φ(R(fλ(x))) + β DKL(w(x), π(x)) ) subject to (1) (3) where β > 0 and φ(z) is a function of the following form φ(z) = |z|. From the Karush-KuhnTucker conditions, the unique closed-form solution is wλ(x) = exp(−φ(R(fλ(x)))/β) πλ(x) PM λ′=1 exp(−φ(R(fλ′(x)))/β) πλ′(x) , (4) where β can be interpreted as a “temperature” parameter. This estimator satisfies oracle inequalities of the following form [7]: E[R( bf(x))] ≤ min w(x)∈RM ( M X λ=1 wλ(x)φ(R(fλ(x))) + β DKL(w(x), π(x)) ) . (5) The role of the distribution π is to put a prior weight on the functions in the set. When there is no preference, the uniform prior is a common choice but other choices are possible (see [7]). In the proposed approach, we define the set of estimators as the set of patches taken in denoised versions of the input image v. The next question is to develop a method to efficiently compute the sum in (1) since the collection can be very large. For a typical image of N = 512 × 512 pixels, we could potentially consider M = L × N pre-computed estimators if we apply L denoisers to the input image v. 4 PEWA: Patch-based EWA estimator Suppose that we are given a large collection of M competing estimators. These basis estimators can be chosen arbitrarily among the researchers favorite denoising algorithm: Gaussian, Bilateral, Wiener, Discrete Cosine Transform or other transform-based filterings. Let us emphasize here that the number of basic estimators M is not expected to grow and is typically very large (M is chosen on the order of several hundreds of thousands). In addition, the essential idea is that these basic estimators only slightly improve the PSNR values of a few dBs. Let us consider uℓ, ℓ= 1, · · · , L denoised versions of v. A given pre-computed patch estimator fλ(x) is then a n-dimensional patch taken in the denoised image uℓat any location y ∈X, in the spirit of the NL-means algorithm which considers only the noisy input patches for denoising. The proposed estimator is then more general since a set of denoised patches at a given location are used. Our estimator is then of the following form if we choose φ(z) = |z|: bf(x) = 1 Z(x) L X ℓ=1 X y∈X e−|R(uℓ(y))|/β πℓ(y) uℓ(y), Z(x) = L X ℓ′=1 X y′∈X e−|R(uℓ′(y′))|/β πℓ′(y) (6) where Z(x) is a normalization constant. Instead of considering a uniform prior over the set of denoised patches taken in the whole image, it is appropriate to encourage patches located in the 3 neighborhood of x [27]. This can be achieved by introducing a spatial Gaussian prior Gτ(z) ∝ e−z2/(2τ 2) in the definition as bfPEWA(x) = 1 Z(x) L X ℓ=1 X y∈X e−|R(uℓ(y))|/β Gτ(x −y) uℓ(y). (7) The Gaussian prior has a significant impact on the performance of the EWA estimator. Moreover, the practical performance of the estimator strongly relies on an appropriate choice of β. This important question has been thoroughly discussed in [13] and β = 4σ2 is motivated by the authors. Finally, our patch-based EWA (PEWA) estimator can be written in terms of energies and Gibbs distributions as: bfPEWA(x) = 1 Z(x) L X ℓ=1 X y∈X e−E(uℓ(y)) uℓ(y), Z(x) = L X ℓ′=1 X y′∈X e−E(uℓ′(y′)), (8) E(uℓ(y)) = |∥v(x) −uℓ(y)∥2 n −nσ2| 4σ2 + ∥x −y∥2 2 2τ 2 . The sums in (8) cannot be computed, especially when we consider a large collection of estimators. In that sense, it differs from the NL-means methods [2, 11, 23, 9] which exploits patches generally taken in a neighborhood of fixed size. Instead, we propose a Monte-Carlo sampling method to approximately compute such an EWA when the number of aggregated estimators is large [1, 19]. 4.1 Monte-Carlo simulations for computation Because of the high dimensionality of the problem, we need efficient computational algorithms, and therefore we suggest a stochastic approach to compute the PEWA estimator. Let us consider a random process (Fn(x))n≥0 consisting in an initial noisy patch F0(x) = v(x). The proposed Monte-Carlo procedure recommended to compute the estimator is based on the following Metropolis-Hastings algorithm: Draw a patch by considering a two-stage drawing procedure: • draw uniformly a value ℓin the set {1, 2, · · · , L}. • draw a pixel y = yc + γ, y ∈X, with γ ∼N(0, I2×2τ 2) and yc is the position of the current patch. At the initialization yc = x. Define Fn+1(x) as: Fn+1(x) =  uℓ(y) if α ≤e−∆E(uℓ(y)),Fn(x)) Fn(x) otherwise (9) where α is a random variable: α ∼U[0, 1] and ∆E(uℓ(y), Fn(x)) △= E(uℓ(y)) −E(Fn(x)). If we assume the Markov chain is ergodic, homogeneous, reductible, reversible and stationary, for any F0(x), we have almost surely lim T →+∞ 1 T −Tb T X n=Tb Fn(x) ≈bfPEWA(x) (10) where T is the maximum number of samples of the Monte-Carlo procedure. It is also recommended to introduce a burn-in phase to get a more satisfying estimator. Hence, the first Tb samples are discarded in the average The Metropolis-Hastings rule allows reversibility and then stationarity of the Markov chain. The chain is irreducible since it is possible to reach any patch in the set of possible considered patches. The convergence is ensured when T tends to infinity. In practice, T is assumed to be high to get a reasonable approximation of bfPEWA(x). In our implementation, we set T ≈1000 and Tb = 250 to produce fast and satisfying results. To improve convergence speed, we can use several chains instead of only one [21]. In the Metropolis-Hastings dynamics, some patches are more frequently selected than others at a given location. The number of occurrences of a particular candidate patch can be then evaluated. In constant image areas, there is probably no preference for any one patch over any other and a low number of candidate patches is expected along image contours and discontinuities. 4 4.2 Patch overlapping and iterations The next step is to extend the PEWA procedure at every position of the entire image. To avoid block effects at the patch boundaries, we overlap the patches. As a result, for the pixels lying in the overlapping regions, we obtain multiple EWA estimates. These competing estimates must be fused or aggregated into the single final estimate. The final aggregation can be performed by a weighted average of the multiple EWA estimates as suggested in [21, 5, 22]. The simplest method of aggregating such multiple estimates is to average them using equal weights. Such uniform averaging provided the best results in our experiments and amounts to fusing n independent Markov chains. The proposed implementation proceeds in two identical iterations. At the first iteration, the estimation is performed using several denoised versions of the noisy image. At the second iteration, the first estimator is used as an additional denoised image in the procedure to improve locally the estimation as in [6, 12]. The second iteration improves the PSNR values in the range of 0.2 to 0.5 dB as demonstrated by the experiments presented in the next section. Note that the first iteration is able to produce very satisfying results for low and medium levels of noise. In practical imaging, we use the method described in [11] to estimate the noise variance σ2 for real-world noisy images. 5 Experimental results We evaluated the PEWA algorithm on 25 natural images showing natural, man-made, indoor and outdoor scenes (see Fig. 1). Each original image was corrupted with white Gaussian noise with zero mean and variance σ2. In our experiments, the best results are obtained with n = 7 × 7 patches and L = 4 images ul denoised with DCT-based transform [26] ; we consider three different DCT shrinkage thresholds: 1.25σ, 1.5σ and 1.75σ to improve the PSNR of 1 to 6 db at most, depending on σ and images (see Figs. 2-3). The fourth image is the noisy input image itself. We evaluated the algorithm with a larger number L of denoised images and the quality drops by 0.1 db to 0.3 db, which is visually imperceptible. Increasing L suggest also to considering more than 1000 samples since the space of candidate patches is larger. The prior neighborhood size corresponds to a disk of radius τ = 7 pixels but it can be smaller. Performances of PEWA and other methods are quantified in terms of PSNR values for several noise levels (see Tables 1-3). Table 1 reports the results obtained with PEWA on each individual image for different values of standard deviation of noise. Table 2 compares the average PSNR values on these 25 images obtained by PEWA (after 1 and 2 iterations) and two state-of-the-art denoising methods [6, 12]. We used the implementations provided by the authors: BM3D (http://www.cs.tut.fi/˜foi/GCFBM3D/) and NL-Bayes (www.ipol.im). The best PSNR values are in bold and the results are quantitatively quite comparable except for very high levels of noise. We compared PEWA to the baseline NL-means [2] and DCT [26] (using the implementation of www.ipol.im) since they form the core of PEWA. The PSNR values increases of 1.5 db and 1.35 db on average over NL-means and DCT respectively. Finally, we compared the results to the recent S-PLE method which uses SURE to guide the probabilistic patch-based filtering described in [24]. Figure 2 shows the denoising results on the noisy Valdemossa (σ = 15), Man (σ = 20) and Castle (σ = 25) images denoised with BM3D, NL-Bayes and PEWA. Visual quality of methods is comparable. Table 3 presents the denoising results with PEWA if the pre-computed estimators are obtained with a Wiener filtering (spatial domain1) and DCT-based transform [26]. The results of PEWA with 5×5 or 7 × 7 patches are also given in Table 3, for one and two iterations. Note that NL-means can be considered as a special case of the proposed method in which the original noisy patches constitute the set of “weak” estimators. The MCMC-based procedure can be then considered as an alternative procedure to the usual implementation of NL-means to accelerate summation. Accordingly, in Table 3 we added a fair comparison (7×7 patches) with the implementation of NL-means algorithm (IPOL (ipol.im)) which restricts the search of similar patches in a neighborhood of 21 × 21 pixels. In these experiments, “PEWA basic” (1 iteration) produced better results especially for σ ≥10. Finally we compared these results with the most popular and competitive methods on the same images. The PSNR values are selected from publications cited in the literature. LSSC and BM3D are the most 1 uℓ(x) = mean(v(x)) + max  0, var(v(x)) −aℓσ2 var(v(x))  × (v(x) −mean(v(x))), where ℓ= {1, 2, 3} and a1 = 0.15, a2 = 0.20, a3 = 0.25. 5 cameraman (256 × 256) peppers house Lena barbara (256 × 256) (256 × 256) (512 × 512) (512 × 512) boat man couple hill (512 × 512) (512 × 512) (512 × 512) (512 × 512) alley computer dice flowers (192 × 128) (704 × 469) (704 × 469) (704 × 469) girl traffic trees valldemossa (704 × 469) (704 × 469) (192 × 128) (769 × 338) maya asia (313 × 473) (313 × 473) aircraft panther (473 × 313) (473 × 313) castle young man (313 × 473) (313 × 473) tiger man on wall picture (473 × 313) (473 × 313) Figure 1: Set of 25 tested images. Top left: images from the BM3D website (cs.tut.fi/˜foi/GCFBM3D/) ; Bottom left: images from IPOL (ipol.im); Right: images from the Berkeley segmentation database (eecs.berkeley.edu/Research/Projects/CS/ vision/bsds/). performant but PEWA is able to produce better results on several piecewise smooth images while BM3D is more appropriate for textured images. In terms of computational complexity, denoising a 512 × 512 grayscale image with an unoptimized implementation of our method in C++ take about 2 mins (Intel Core i7 64-bit CPU 2.4 Ghz). Recently, PEWA has been implemented in parallel since every patch can be processed independently and the computational times become a few seconds. 6 Conclusion We presented a new general two-step denoising algorithm based on non-local image statistics and patch repetition, that combines ideas from the popular NL-means [6] and BM3D algorithms [6] and theoretical results from the statistical literature on Exponentially Weighted Aggregation [7, 21]. The first step of PEWA involves the computation of denoised images obtained with a separate collection of multiple denoisers (Wiener, DCT... ) applied to the input image. In the second step, the set of denoised image patches are selectively exploited to compute an aggregated estimator. We showed that the estimator can be computed in reasonable time using a Monte-Carlo Markov Chain (MCMC) sampling procedure. If we consider DCT-based transform [6] in the first step, the results are comparable in average to the state-of-the-art results. The PEWA method generalizes the NLmeans algorithm in some sense but share also common features with BM3D (e.g. DCT transform, two-stage collaborative filtering). tches, contrary to NL-Bayes and BM3D. For future work, waveletbased transform, multiple image patch sizes, robust statistics and sparse priors will be investigated to improve the results of the flexible PEWA method. 6 noisy (PSNR = 24.61) PEWA (PSNR = 29.25) BM3D [6] (PSNR = 29.19) NL-Bayes [12] (PSNR = 29.22) Figure 2: Comparison of algorithms. Valldemossa image corrupted with white Gaussian noise (σ = 15). The PSNR values of the three images denoised with DCT-based transform [26] are combined with PEWA are 27.78, 27.04 and 26.26.) noisy PEWA BM3D [6] NL-Bayes [12] (PSNR = 20.18) (PSNR = 29.49) (PSNR = 29.36) (PSNR = 29.48) noisy PEWA BM3D [6] NL-Bayes [12] (PSNR = 22.11) (PSNR = 30.50) (PSNR = 30.59) (PSNR = 30.60) Figure 3: Comparison of algorithms. First row: Castle image corrupted with white Gaussian noise (σ = 25). The PSNR values of the three images denoised with DCT-based transform [26] and combined with PEWA are 25.77, 24.26 and 22.85. Second row: Man image corrupted with white Gaussian noise (σ = 20). The PSNR values of the three images denoised with DCT-based transform [26] and combined with PEWA are 27.42, 26.00 and 24.67. 7 σ = 5 σ = 10 σ = 15 σ = 20 σ = 25 σ = 50 σ = 100 Cameraman 38.20 34.23 31.98 30.60 29.48 26.25 22.81 Peppers 38.00 34.68 32.75 31.40 30.30 26.69 22.84 House 39.56 36.40 34.86 33.72 32.77 29.29 25.35 Lena 38.57 35.78 34.12 32.90 31.89 28.83 25.65 Barbara 38.09 34.73 32.86 31.43 30.28 26.58 22.95 Boat 37.12 33.75 31.94 30.64 29.65 26.64 23.63 Man 37.68 33.93 31.93 30.50 29.50 26.67 24.15 Couple 37.35 33.91 31.98 30.57 29.48 26.02 23.27 Hill 37.01 33.52 31.69 30.50 29.56 26.92 24.49 Alley 36.29 32.20 29.98 28.54 27.46 24.13 21.37 Computer 39.04 35.13 32.81 31.23 30.01 26.38 23.27 Dice 46.82 43.87 42.05 40.58 39.36 35.33 30.82 Flowers 43.48 39.67 37.47 35.90 34.55 30.81 27.53 Girl 43.95 41.22 39.52 38.27 37.33 34.14 30.50 Traffic 37.85 33.54 31.13 29.58 28.48 25.50 22.90 Trees 34.88 29.93 27.49 25.86 24.69 21.78 20.03 Valldemossa 36.65 31.79 29.25 27.59 26.37 23.18 20.71 Aircraft 37.59 34.62 33.00 31.75 30.72 27.68 24.99 Asia 38.67 34.46 32.25 30.73 29.60 26.63 24.32 Castle 38.06 34.13 32.02 30.56 29.49 26.15 23.09 Man Picture 37.78 33.58 31.27 29.73 28.44 24.65 21.50 Maya 34.72 29.64 27.17 25.42 24.28 22.85 18.17 Panther 38.53 33.91 31.56 30.02 28.83 25.59 22.75 Tiger 36.92 32.85 30.63 29.13 27.99 24.63 21.90 Young man 40.79 37.36 35.58 34.30 33.25 29.59 25.20 Average 38.54 34.75 32.67 31.26 30.15 26.95 23.76 Table 1: Denoising results on the 25 tested images for several values of σ. The PSNR values are averaged over 3 experiments corresponding to 3 different noise realizations. σ = 5 σ = 10 σ = 15 σ = 20 σ = 25 σ = 50 σ = 100 PEWA 1 38.27 34.39 32.26 30.76 29.62 26.00 22.35 PEWA 2 38.54 34.75 32.67 31.26 30.15 26.95 23.76 BM3D [6] 38.64 34.78 32.68 31.25 30.19 26.97 24.08 NL-Bayes [12] 38.60 34.75 32.48 31.22 30.12 26.90 23.65 S-PLE [24] 38.17 34.38 32.35 30.67 29.77 26.46 23.21 NL-means [2] 37.44 33.35 31.00 30.16 28.96 25.53 22.29 DCT [26] 37.81 33.57 31.87 29.95 28.97 25.91 23.08 Table 2: Average of denoising results over the 25 tested images for several values of σ. The experiments with NL-Bayes [12], S-PLE[24], NL-means [2] and DCT [26] have been performed using the using the implementation of IPOL (ipol.im). The best PSNR values are in bold. Image Peppers House Lena Barbara (256 × 256) (256 × 256) (512 × 512) (512 × 512) σ 5.00 15.00 25.00 50.00 5.00 15.00 25.00 50.00 5.00 15.00 25.00 50.00 5.00 15.00 25.00 50.00 PEWA 1 (W) (5×5) 36.69 30.58 27.50 22.85 37.89 31.88 28.55 23.49 37.27 31.43 28.30 23.45 36.39 30.18 29.31 22.71 PEWA 2 (W) (5×5) 37.45 32.20 29.72 26.09 38.98 34.27 32.13 28.35 38.05 33.40 31.11 27.80 37.13 31.94 29.47 25.58 PEWA 1 (W) (7 ×7) 36.72 30.60 27.60 22.82 37.90 31.90 28.59 23.52 37.26 31.45 28.33 23.45 36.40 30.18 27.32 22.71 PEWA 2 (W) (7 ×7) 37.34 32.34 30.11 26.53 39.00 34.57 32.51 29.04 38.00 33.65 31.56 28.40 37.00 32.10 30.00 26.20 PEWA 1 (D) (5 ×5) 37.70 32.45 29.83 26.01 39.28 34.23 31.79 27.72 38.46 33.72 31.33 27.59 37.71 32.20 29.55 25.58 PEWA 2 (D) (5 ×5) 37.95 32.80 30.20 26.66 39.46 34.74 31.67 29.15 38.57 33.96 31.81 28.43 38.03 32.70 30.03 26.01 PEWA 1 (D) (7 ×7) 37.71 32.43 29.87 26.00 39.27 34.26 31.79 27.71 38.45 33.72 31.25 27.62 37.70 32.30 29.84 26.20 PEWA 2 (D) (7 ×7) 38.00 32.75 30.30 26.69 39.56 34.83 32.77 29.29 38.58 34.12 31.89 28.83 38.09 32.86 30.28 26.58 PEWA Basic (7×7) 36.88 31.34 29.47 26.02 37.88 34.13 32.14 28.25 37.39 33.26 31.20 27.92 36.80 31.89 29.76 25.83 NL-means [2] (7×7) 36.77 30.93 28.76 24.24 37.75 32.36 31.11 27.54 36.65 32.00 30.45 27.32 36.79 30.65 28.99 25.63 BM3D [6] 38.12 32.70 30.16 26.68 39.83 34.94 32.86 29.69 38.72 34.27 32.08 29.05 38.31 33.11 30.72 27.23 NL-Bayes [12] 38.09 32.26 29.79 26.10 39.39 33.77 31.36 27.62 38.75 33.51 31.16 27.62 38.38 32.47 30.02 26.45 ND-SAFIR [11] 37.34 32.13 29.73 25.29 37.62 34.08 32.22 28.67 37.91 33.70 31.73 28.38 37.12 31.80 29.24 24.09 K-SVD [10] 37.80 32.23 29.81 26.24 39.33 34.19 31.97 28.01 38.63 33.76 31.35 27.85 38.08 32.33 29.54 25.43 LSSC [16] 38.18 32.82 30.21 26.62 39.93 35.35 33.15 30.04 38.69 34.15 31.87 28.87 38.48 33.00 30.47 27.06 PLOW [5] 37.69 31.82 29.53 26.32 39.52 34.72 32.70 29.08 38.66 33.90 31.92 28.32 37.98 21.17 30.20 26.29 SOP [18] 37.63 32.40 30.01 26.75 38.76 34.35 32.54 29.64 38.31 33.84 31.80 28.96 37.74 32.65 30.37 27.35 Table 3: Comparison of several versions of PEWA (W (Wiener), D (DCT), Basic) and competitive methods on a few standard images corrupted with white Gaussian noise. The best PSNR values are in bold (PSNR values from publications cited in the literature). 8 References [1] Alquier, P., Lounici, K. (2011) PAC-Bayesian bounds for sparse regression estimation with exponential weights. Electronic Journal of Statistics 5:127-145. [2] Buades A., Coll, B. & Morel, J.-M. (2005) A review of image denoising algorithms, with a new one. SIAM J. Multiscale Modeling & Simulation, 4(2):490-530. [3] Burger, H., Schuler, C. & Harmeling, S. (2012) Image denoising: can plain neural networks compete with BM3D ? In IEEE Conf. Comp. Vis. Patt. Recogn. (CVPR’12), pp. 2392-2399, Providence, Rhodes Island. [4] Chatterjee, P. & Milanfar, P. (2010) Is denoising dead?, IEEE Transactions on Image Processing, 19(4):895-911. [5] Chatterjee, P. & Milanfar, P. (2012) Patch-based near-optimal image denoising, IEEE Transactions on Image Processing, 21(4):1635-1649. [6] Dabov, K., Foi, A., Katkovnik, V. & Egiazarian, K. (2007) Image denoising by sparse 3D transform-domain collaborative filtering, IEEE Transactions on Image Processing, 16(8):2080-2095. [7] Dalayan, A.S. & Tsybakov, A. B. (2008) Aggregation by exponential weighting, sharp PAC-Bayesian bounds and sparsity. Machine Learning 72:39-61. [8] Dalayan, A.S. & Tsybakov, A. B. (2009) Sparse regression learning by aggregation and Langevin Monte Carlo. Available at ArXiv:0903.1223 [9] Deledalle, C.-A., Duval, V., Salmon, J. (2012) Non-local methods with shape-adaptive patches (NLMSAP). J. Mathematical Imaging and Vision, 43:103-120. [10] Elad, M. & Aharon, M. (2006) Image denoising via sparse and redundant representations over learned dictionaries. IEEE Transactions on Image Processing, 15(12):3736-3745. [11] Kervrann, C. & Boulanger, J. (2006) Optimal spatial adaptation for patch-based image denoising. IEEE Transcations on Image Processing, 15(10):2866-2878. [12] Lebrun, M., Buades, A. & Morel, J.-M. (2013) Implementation of the “Non-Local Bayes” (NL-Bayes) image denoising algorithm, Image Processing On Line, 3:1-42. http://dx.doi.org/10.5201/ipol.2013.16 [13] Leung, G. & Barron, A. R. (2006) Information theory and mixing least-squares regressions. IEEE Transactions on Information Theory 52:3396-3410. [14] Levin, A., Nadler, B., Durand, F. & Freeman, W.T. (2012) Patch complexity, finite pixel correlations and optimal denoising. Europ. Conf. Comp. Vis. (ECCV’12), pp. 73-86, Firenze, Italy. [15] Louchet, C. & Moisan, L. (2011) Total Variation as a local filter. SIAM J. Imaging Sciences 4(2):651-694. [16] Mairal, J., Bach, F., Ponce, J., Sapiro, G. &. Zisserman, A. (2009) Non-local sparse models for image restoration. In IEEE Int. Conf. Comp. Vis. (ICCV’09), pp. 2272-2279, Tokyo, Japan. [17] Milanfar, P. (2013) A Tour of modern image filtering. IEEE Signal Processing Magazine, 30(1):106-128. [18] Ram, I., Elad, M. & Cohen, I. (2013) Image processing using smooth ordering of its patches. IEEE Transactions on Image Processing, 22(7):2764–2774 [19] Rigollet, P. & Tsybakov, A. B. (2012) Sparse estimation by exponential weighting. Statistical Science 27(4):558-575. [20] Roth, S. & Black, M.J. (2005) Fields of experts: A framework for learning image priors. In IEEE Conf. Comp. Vis. Patt. Recogn. (CVPR’05), vol. 2, pp. 860-867, San Diego, CA. [21] Salmon, J. & Le Pennec, E. (2009) NL-Means and aggregation procedures. In IEEE Int. Conf. Image Process. (ICIP’09), pp. 2977-2980, Cairo, Egypt. [22] Talebi, H., Xhu, X. & Milanfar, P. (2013) How to SAIF-ly boost denoising performance. In IEEE Transactions on Image Processing 22(4):1470-1485. [23] Van De Ville, D. & Kocher, M. (2009) SURE based non-local means. IEEE Signal Processing Letters, 16(11):973-976, 2009. [24] Wang, Y.-Q. & Morel, J.-M. (2013). SURE guided Gaussian mixture image denoising. SIAM J. Imaging Sciences, 6(2):999-1034. [25] Xue, F., Luisier, F. & Blu T. (2013) Multi-wiener SURE-LET deconvolution. IEEE Transactions on Image Processing, 22(5):1954-1968. [26] Yu G. & Sapiro G. (2011) . DCT image denoising: a simple and effective image denoising algorithm. Image Processing On Line (http://dx.doi.org/10.5201/ipol.2011.ys-dct). [27] Zontak, M. & Irani, M. (2011) Internal statistics of a single natural image. In IEEE Comp. Vis. Patt. Recogn. (CVPR’11), pp. 977-984, Colorado Springs, CO. [28] Zoran, D. & Weiss, Y. (2011) From learning models of natural image patches to whole image restoration. In IEEE Int. Conf. Comp. Vis. (ICCV’11), pp. 479-486, Barcelona, Spain. 9
2014
35
5,458
Multivariate Regression with Calibration⇤ Han Liu Department of Operations Research and Financial Engineering Princeton University Lie Wang Department of Mathematics Massachusetts Institute of Technology Tuo Zhao† Department of Computer Science Johns Hopkins University Abstract We propose a new method named calibrated multivariate regression (CMR) for fitting high dimensional multivariate regression models. Compared to existing methods, CMR calibrates the regularization for each regression task with respect to its noise level so that it is simultaneously tuning insensitive and achieves an improved finite-sample performance. Computationally, we develop an efficient smoothed proximal gradient algorithm which has a worst-case iteration complexity O(1/✏), where ✏is a pre-specified numerical accuracy. Theoretically, we prove that CMR achieves the optimal rate of convergence in parameter estimation. We illustrate the usefulness of CMR by thorough numerical simulations and show that CMR consistently outperforms other high dimensional multivariate regression methods. We also apply CMR on a brain activity prediction problem and find that CMR is as competitive as the handcrafted model created by human experts. 1 Introduction Given a design matrix X 2 Rn⇥d and a response matrix Y 2 Rn⇥m, we consider a multivariate linear model Y = XB0 + Z, where B0 2 Rd⇥m is an unknown regression coefficient matrix and Z 2 Rn⇥m is a noise matrix [1]. For a matrix A = [Ajk] 2 Rd⇥m, we denote Aj⇤= (Aj1, ..., Ajm) 2 Rm and A⇤k = (A1k, ..., Adk)T 2 Rd to be its jth row and kth column respectively. We assume that all Zi⇤’s are independently sampled from an m-dimensional Gaussian distribution with mean 0 and covariance matrix ⌃2 Rm⇥m. We can represent the multivariate linear model as an ensemble of univariate linear regression models: Y⇤k = XB0 ⇤k+Z⇤k, k = 1, ..., m. Then we get a multi-task learning problem [3, 2, 26]. Multi-task learning exploits shared common structure across tasks to obtain improved estimation performance. In the past decade, significant progress has been made towards designing a variety of modeling assumptions for multivariate regression. A popular assumption is that all the regression tasks share a common sparsity pattern, i.e., many B0 j⇤’s are zero vectors. Such a joint sparsity assumption is a natural extension of that for univariate linear regressions. Similar to the L1-regularization used in Lasso [23], we can adopt group regularization to obtain a good estimator of B0 [25, 24, 19, 13]. Besides the aforementioned approaches, there are other methods that aim to exploit the covariance structure of the noise matrix Z [7, 22]. For ⇤The authors are listed in alphabetical order. This work is partially supported by the grants NSF IIS1408910, NSF IIS1332109, NSF Grant DMS-1005539, NIH R01MH102339, NIH R01GM083084, and NIH R01HG06841. †Tuo Zhao is also affiliated with Department of Operations Research and Financial Engineering at Princeton University. 1 instance, [22] assume that all Zi⇤’s follow a multivariate Gaussian distribution with a sparse inverse covariance matrix ⌦= ⌃−1. They propose an iterative algorithm to estimate sparse B0 and ⌦by maximizing the penalized Gaussian log-likelihood. Such an iterative procedure is effective in many applications, but the theoretical analysis is difficult due to its nonconvex formulation. In this paper, we assume an uncorrelated structure for the noise matrix Z, i.e., ⌃ = diag(σ2 1, σ2 2, . . . , σ2 m−1, σ2 m). Under this setting, we can efficiently solve the resulting estimation problem with a convex program as follows bB = argmin B 1 pn||Y −XB||2 F + λ||B||1,p, (1.1) where λ > 0 is a tuning parameter, and ||A||F = qP j,k A2 jk is the Frobenius norm of a matrix A. Popular choices of p include p = 2 and p = 1: ||B||1,2 = Pd j=1 qPm k=1 B2 jk and ||B||1,1 = Pd j=1 max1km |Bjk|. Computationally, the optimization problem in (1.1) can be efficiently solved by some first order algorithms [11, 12, 4]. The problem with the uncorrelated noise structure is amenable to statistical analysis. Under suitable conditions on the noise and design matrices, let σmax = maxk σk, if we choose λ = 2c · σmax $plog d + m1−1/p% , for some c > 1, then the estimator bB in (1.1) achieves the optimal rates of convergence1 [13], i.e., there exists some universal constant C such that with high probability, we have 1 pm||bB −B0||F C · σmax r s log d nm + r sm1−2/p n ! , where s is the number of rows with non-zero entries in B0. However, the estimator in (1.1) has two drawbacks: (1) All the tasks are regularized by the same tuning parameter λ, even though different tasks may have different σk’s. Thus more estimation bias is introduced to the tasks with smaller σk’s to compensate the tasks with larger σk’s. In another word, these tasks are not calibrated. (2) The tuning parameter selection involves the unknown parameter σmax. This requires tuning the regularization parameter over a wide range of potential values to get a good finite-sample performance. To overcome the above two drawbacks , we formulate a new convex program named calibrated multivariate regression (CMR). The CMR estimator is defined to be the solution of the following convex program: bB = argmin B ||Y −XB||2,1 + λ||B||1,p, (1.2) where ||A||2,1 = P k qP j A2 jk is the nonsmooth L2,1 norm of a matrix A = [Ajk] 2 Rd⇥m. This is a multivariate extension of the square-root Lasso [5]. Similar to the square-root Lasso, the tuning parameter selection of CMR does not involve σmax. Moreover, the L2,1 loss function can be viewed as a special example of the weighted least square loss, which calibrates each regression task (See more details in §2). Thus CMR adapts to different σk’s and achieves better finite-sample performance than the ordinary multivariate regression estimator (OMR) defined in (1.1). Since both the loss and penalty functions in (1.2) are nonsmooth, CMR is computationally more challenging than OMR. To efficiently solve CMR, we propose a smoothed proximal gradient (SPG) algorithm with an iteration complexity O(1/✏), where ✏is the pre-specified accuracy of the objective value [18, 4]. Theoretically, we provide sufficient conditions under which CMR achieves the optimal rates of convergence in parameter estimation. Numerical experiments on both synthetic and real data show that CMR universally outperforms existing multivariate regression methods. For a brain activity prediction task, prediction based on the features selected by CMR significantly outperforms that based on the features selected by OMR, and is even competitive with that based on the handcrafted features selected by human experts. Notations: Given a vector v = (v1, . . . , vd)T 2 Rd, for 1 p 1, we define the Lp-vector norm of v as ||v||p = ⇣Pd j=1 |vj|p⌘1/p if 1 p < 1 and ||v||p = max1jd |vj| if p = 1. 1The rate of convergence is optimal when p = 2, i.e., the regularization function is ||B||1,p 2 Given two matrices A = [Ajk] and C = [Cjk] 2 Rd⇥m, we define the inner product of A and C as hA, Ci = Pd j=1 Pm k=1 AjkCjk = tr(AT C), where tr(A) is the trace of a matrix A. We use A⇤k = (A1k, ..., Adk)T and Aj⇤= (Aj1, ..., Ajm) to denote the kth column and jth row of A. Let S be some subspace of Rd⇥m, we use AS to denote the projection of A onto S: AS = argminC2S ||C −A||2 F. Moreover, we define the Frobenius and spectral norms of A as ||A||F = p hA, Ai and ||A||2 = 1(A), 1(A) is the largest singular value of A. In addition, we define the matrix block norms as ||A||2,1 = Pm k=1 ||A⇤k||2, ||A||2,1 = max1km ||A⇤k||2, ||A||1,p = Pd j=1 ||Aj⇤||p, and ||A||1,q = max1jd ||Aj⇤||q, where 1 p 1 and 1 q 1. It is easy to verify that ||A||2,1 is the dual norm of ||A||2,1. Let 1/1 = 0, then if 1/p + 1/q = 1, ||A||1,q and ||A||1,p are also dual norms of each other. 2 Method We solve the multivariate regression problem by the following convex program, bB = argmin B ||Y −XB||2,1 + λ||B||1,p. (2.1) The only difference between (2.1) and (1.1) is that we replace the L2-loss function by the nonsmooth L2,1-loss function. The L2,1-loss function can be viewed as a special example of the weighted square loss function. More specifically, we consider the following optimization problem, bB = argmin B m X k=1 1 σk pn||Y⇤k −XB⇤k||2 2 + λ||B||1,p, (2.2) where 1 σk pn is a weight assigned to calibrate the kth regression task. Without prior knowledge on σk’s, we use the following replacement of σk’s, eσk = 1 pn||Y⇤k −XB⇤k||2, k = 1, ..., m. (2.3) By plugging (2.3) into the objective function in (2.2), we get (2.1). In another word, CMR calibrates different tasks by solving a penalized weighted least square program with weights defined in (2.3). The optimization problem in (2.1) can be solved by the alternating direction method of multipliers (ADMM) with a global convergence guarantee [20]. However, ADMM does not take full advantage of the problem structure in (2.1). For example, even though the L2,1 norm is nonsmooth, it is nondifferentiable only when a task achieves exact zero residual, which is unlikely in applications. In this paper, we apply the dual smoothing technique proposed by [18] to obtain a smooth surrogate function so that we can avoid directly evaluating the subgradient of the L2,1 loss function. Thus we gain computational efficiency like other smooth loss functions. We consider the Fenchel’s dual representation of the L2,1 loss: ||Y −XB||2,1 = max ||U||2,11hU, Y −XBi. (2.4) Let µ > 0 be a smoothing parameter. The smooth approximation of the L2,1 loss can be obtained by solving the following optimization problem ||Y −XB||µ = max ||U||2,11hU, Y −XBi −µ 2 ||U||2 F, (2.5) where ||U||2 F is the proximity function. Due to the fact that ||U||2 F m||U||2 2,1, we obtain the following uniform bound by combing (2.4) and (2.5), ||Y −XB||2,1 −mµ 2 ||Y −XB||µ ||Y −XB||2,1. (2.6) From (2.6), we see that the approximation error introduced by the smoothing procedure can be controlled by a suitable µ. Figure 2.1 shows several two-dimensional examples of the L2 norm smoothed by different µ’s. The optimization problem in (2.5) has a closed form solution bUB with bUB ⇤k = (Y⇤k −XB⇤k)/ max {||Y⇤k −XB⇤k||2, µ}. The next lemma shows that ||Y −XB||µ is smooth in B with a simple form of gradient. 3 (a) µ = 0 (b) µ = 0.1 (c) µ = 0.25 (d) µ = 0.5 Figure 2.1: The L2 norm (µ = 0) and its smooth surrogates with µ = 0.1, 0.25, 0.5. A larger µ makes the approximation more smooth, but introduces a larger approximation error. Lemma 2.1. For any µ > 0, ||Y −XB||µ is a convex and continuously differentiable function in B. In addition, Gµ(B)—the gradient of ||Y −XB||µ w.r.t. B—has the form Gµ(B) = @ ⇣ h bUB, Y −XBi + µ|| bUB||2 F/2 ⌘ @B = −XT bUB. (2.7) Moreover, let γ = ||X||2 2, then we have that Gµ(B) is Lipschitz continuous in B with the Lipschitz constant γ/µ, i.e., for any B0, B00 2 Rd⇥m, ||Gµ(B0) −Gµ(B00)||F = ||hX, bUB0 −bUB00i||F 1 µ||XT X(B0 −B00)||F γ µ||B0 −B00||F. Lemma 2.1 is a direct result of Theorem 1 in [18] and implies that ||Y −XB||µ has good computational structure. Therefore we apply the smooth proximal gradient algorithm to solve the smoothed version of the optimization problem as follows, eB = argmin B ||Y −XB||µ + λ||B||1,p. (2.8) We then adopt the fast proximal gradient algorithm to solve (2.8) [4]. To derive the algorithm, we first define three sequences of auxiliary variables {A(t)}, {V(t)}, and {H(t)} with A(0) = H(0) = V(0) = B(0), a sequence of weights {✓t = 2/(t + 1)}, and a nonincreasing sequence of step-sizes {⌘t > 0}. For simplicity, we can set ⌘t = µ/γ. In practice, we use the backtracking line search to dynamically adjust ⌘t to boost the performance. At the tth iteration, we first take V(t) = (1 −✓t)B(t−1) + ✓tA(t−1). We then consider a quadratic approximation of ||Y −XH||µ as Q ⇣ H, V(t), ⌘t ⌘ = ||Y −XV(t)||µ + hGµ(V(t)), H −V(t)i + 1 2⌘t ||H −V(t)||2 F. Consequently, let eH(t) = V(t) −⌘tGµ(V(t)), we take H(t) = argmin H Q ⇣ H, V(t), ⌘t ⌘ + λ||H||1,p = argmin H 1 2⌘t ||H −eH(t)||2 F + λ||H||1,p. (2.9) When p = 2, (2.9) has a closed form solution H(t) j⇤= eHj⇤· max n 1 −⌘tλ/|| eHj⇤||2, 0 o . More details about other choices of p in the L1,p norm can be found in [11] and [12]. To ensure that the objective value is nonincreasing, we choose B(t) = argmin B2{H(t), B(t−1)} ||Y −XB||µ + λ||B||1,p. (2.10) At last, we take A(t) = B(t−1)+ 1 ✓t (H(t)−B(t−1)). The algorithm stops when ||H(t)−V(t)||F ", where " is the stopping precision. The numerical rate of convergence of the proposed algorithm with respect to the original optimization problem (2.1) is presented in the following theorem. Theorem 2.2. Given a pre-specified accuracy ✏and let µ = ✏/m, after t = 2pmγ||B(0)−bB||F/✏− 1 = O (1/✏) iterations, we have ||Y −XB(t)||2,1 + λ||B(t)||1,p ||Y −XbB||2,1 + λ||bB||1,p + ✏. The proof of Theorem 2.2 is provided in Appendix A.1. This result achieves the minimax optimal rate of convergence over all first order algorithms [18]. 4 3 Statistical Properties For notational simplicity, we define a re-scaled noise matrix W = [Wik] 2 Rn⇥m with Wik = Zik/σk, where EZ2 ik = σ2 k. Thus W is a random matrix with all entries having mean 0 and variance 1. We define G0 to be the gradient of ||Y −XB||2,1 at B = B0. It is easy to see that G0 ⇤k = XT Z⇤k ||Z⇤k||2 = XT W⇤kσk ||W⇤kσk||2 = XT W⇤k ||W⇤k||2 does not depend on the unknown quantities σk for all k = 1, ..., m. G0 ⇤k works as an important pivotal in our analysis. Moreover, our analysis exploits the decomposability of the L1,p norm [17]. More specifically, we assume that B0 has s rows with all zero entries and define S = 0 C 2 Rd⇥m | Cj⇤= 0 for all j such that B0 j⇤= 0 , (3.1) N = 0 C 2 Rd⇥m | Cj⇤= 0 for all j such that B0 j⇤6= 0 . (3.2) Note that we have B0 2 S and the L1,p norm is decomposable with respect to the pair (S, N), i.e., ||A||1,p = ||AS||1,p + ||AN ||1,p. The next lemma shows that when λ is suitably chosen, the solution to the optimization problem in (2.1) lies in a restricted set. Lemma 3.1. Let B0 2 S and bB be the optimum to (2.1), and 1/p + 1/q = 1. We denote the estimation error as b∆= bB −B0. If λ ≥c||G0||1,q for some c > 1, we have b∆2 Mc := ⇢ ∆2 Rd⇥m | ||∆N ||1,p c + 1 c −1||∆S||1,p 3 . (3.3) The proof of Lemma 3.1 is provided in Appendix B.1. To prove the main result, we also need to assume that the design matrix X satisfies the following condition. Assumption 3.1. Let B0 2 S, then there exist positive constants and c > 1 such that  min ∆2Mc\{0} ||X∆||F pn||∆||F . Assumption 3.1 is the generalization of the restricted eigenvalue conditions for analyzing univariate sparse linear models [17, 15, 6], Many common examples of random design satisfy this assumption [13, 21]. Note that Lemma 3.1 is a deterministic result of the CMR estimator for a fixed λ. Since G is essentially a random matrix, we need to show that λ ≥cR⇤(G0) holds with high probability to deliver a concrete rate of convergence for the CMR estimator in the next theorem. Theorem 3.2. We assume that each column of X is normalized as m1/2−1/pkX⇤jk2 = pn for all j = 1, ..., d. Then for some universal constant c0 and large enough n, taking λ = 2c(m1−1/p + plog d) p1 −c0 , (3.4) with probability at least 1 −2 exp(−2 log d) −2 exp $ −nc2 0/8 + log m % , we have 1 pm||bB −B0||F 16cσmax 2(c −1) r 1 + c0 1 −c0 r sm1−2/p n + r s log d nm ! . The proof of Theorem 3.2 is provided in Appendix B.2. Note that when we choose p = 2, the column normalization condition is reduced to kX⇤jk2 = pn. Meanwhile, the corresponding error bound is further reduced to 1 pm||bB −B0||F = OP r s n + r s log d nm ! , which achieves the minimax optimal rate of convergence presented in [13]. See Theorem 6.1 in [13] for more technical details. From Theorem 3.2, we see that CMR achieves the same rates of convergence as the noncalibrated counterpart, but the tuning parameter λ in (3.4) does not involve σk’s. Therefore CMR not only calibrates all the regression tasks, but also makes the tuning parameter selection insensitive to σmax. 5 4 Numerical Simulations To compare the finite-sample performance between the calibrated multivariate regression (CMR) and ordinary multivariate regression (OMR), we generate a training dataset of 200 samples. More specifically, we use the following data generation scheme: (1) Generate each row of the design matrix Xi⇤, i = 1, ..., 200, independently from a 800-dimensional normal distribution N(0, ⌃) where ⌃jj = 1 and ⌃j` = 0.5 for all ` 6= j.(2) Let k = 1, . . . , 13, set the regression coefficient matrix B0 2 R800⇥13 as B0 1k = 3, B0 2k = 2, B0 4k = 1.5, and B0 jk = 0 for all j 6= 1, 2, 4. (3) Generate the random noise matrix Z = WD, where W 2 R200⇥13 with all entries of W are independently generated from N(0, 1), and D is either of the following matrices DI = σmax · diag ⇣ 20/4, 2−1/4, · · · , 2−11/4, 2−12/4⌘ 2 R13⇥13 DH = σmax · I 2 R13⇥13. We generate a validation set of 200 samples for the regularization parameter selection and a testing set of 10,000 samples to evaluate the prediction accuracy. In numerical experiments, we set σmax = 1, 2, and 4 to illustrate the tuning insensitivity of CMR. The regularization parameter λ of both CMR and OMR is chosen over a grid ⇤= 0 240/4λ0, 239/4λ0, · · · , 2−17/4λ0, 2−18/4λ0 , where λ0 = plog d + pm. The optimal regularization parameter bλ is determined by the prediction error as bλ = argminλ2⇤|| eY −eXbBλ||2 F, where bBλ denotes the obtained estimate using the regularization parameter λ, and eX and eY denote the design and response matrices of the validation set. Since the noise level σk’s are different in regression tasks, we adopt the following three criteria to evaluate the empirical performance: Pre. Err. = 1 10000||Y −XbB||F, Adj. Pre. Err. = 1 10000m||(Y −XbB)D−1||2 F, and Est. Err. = 1 m||bB −B0||2 F, where X and Y denotes the design and response matrices of the testing set. All simulations are implemented by MATLAB using a PC with Intel Core i5 3.3GHz CPU and 16GB memory. CMR is solved by the proposed smoothing proximal gradient algorithm, where we set the stopping precision " = 10−4, the smoothing parameter µ = 10−4. OMR is solved by the monotone fast proximal gradient algorithm, where we set the stopping precision " = 10−4. We set p = 2, but the extension to arbitrary p > 2 is straightforward. We first compare the smoothed proximal gradient (SPG) algorithm with the ADMM algorithm (the detailed derivation of ADMM can be found in Appendix A.2). We adopt the backtracking line search to accelerate both algorithms with a shrinkage parameter ↵= 0.8. We set σmax = 2 for the adopted multivariate linear models. We conduct 200 simulations. The results are presented in Table 4.1. The SPG and ADMM algorithms attain similar objective values, but SPG is up to 4 times faster than ADMM. Both algorithms also achieve similar estimation errors. We then compare the statistical performance between CMR and OMR. Tables 4.2 and 4.3 summarize the results averaged over 200 replicates. In addition, we also present the results of the oracle estimator, which is obtained by solving (2.2), since we know the true values of σk’s. Note that the oracle estimator is only for comparison purpose, and it is not a practical estimator. Since CMR calibrates the regularization for each task with respect to σk, CMR universally outperforms OMR, and achieves almost the same performance as the oracle estimator when we adopt the scale matrix DI to generate the random noise. Meanwhile, when we adopt the scale matrix DH, where all σk’s are the same, CMR and OMR achieve similar performance. This further implies that CMR can be a safe replacement of OMR for multivariate regressions. In addition, we also examine the optimal regularization parameters for CMR and OMR over all replicates. We visualize the distribution of all 200 selected bλ’s using the kernel density estimator. In particular, we adopt the Gaussian kernel, and the kernel bandwidth is selected based on the 10fold cross validation. Figure 4.1 illustrates the estimated density functions. The horizontal axis corresponds to the rescaled regularization parameter as log ⇣ bλ plog d+pm ⌘ . We see that the optimal regularization parameters of OMR significantly vary with different σmax. In contrast, the optimal regularization parameters of CMR are more concentrated. This is inconsistent with our claimed tuning insensitivity. 6 Table 4.1: Quantitive comparison of the computational performance between SPG and ADMM with the noise matrices generated using DI. The results are averaged over 200 replicates with standard errors in parentheses. SPG and ADMM attain similar objective values, but SPG is up to about 4 times faster than ADMM. λ Algorithm Timing (second) Obj. Val. Num. Ite. Est. Err. 2λ0 SPG 2.8789(0.3141) 508.21(3.8498) 493.26(52.268) 0.1213(0.0286) ADMM 8.4731(0.8387) 508.22(3.7059) 437.7(37.4532) 0.1215(0.0291) λ0 SPG 3.2633(0.3200) 370.53(3.6144) 565.80(54.919) 0.0819(0.0205) ADMM 11.976(1.460) 370.53(3.4231) 600.94(74.629) 0.0822(0.0233) 0.5λ0 SPG 3.7868(0.4551) 297.24(3.6125) 652.53(78.140) 0.1399(0.0284) ADMM 18.360(1.9678) 297.25(3.3863) 1134.0(136.08) 0.1409(0.0317) Table 4.2: Quantitive comparison of the statistical performance between CMR and OMR with the noise matrices generated using DI. The results are averaged over 200 simulations with the standard errors in parentheses. CMR universally outperforms OMR, and achieves almost the same performance as the oracle estimator. σmax Method Pre. Err. Adj. Pre.Err Est. Err. 1 Oracle 5.8759(0.0834) 1.0454(0.0149) 0.0245(0.0086) CMR 5.8761(0.0673) 1.0459(0.0123) 0.0249(0.0071) OMR 5.9012(0.0701) 1.0581(0.0162) 0.0290(0.0091) 2 Oracle 23.464(0.3237) 1.0441(0.0148) 0.0926(0.0342) CMR 23.465(0.2598) 1.0446(0.0121) 0.0928(0.0279) OMR 23.580(0.2832) 1.0573(0.0170) 0.1115(0.0365) 4 Oracle 93.532(0.8843) 1.0418(0.0962) 0.3342(0.1255) CMR 93.542(0.9794) 1.0421(0.0118) 0.3346(0.1063) OMR 94.094(1.0978) 1.0550(0.0166) 0.4125(0.1417) Table 4.3: Quantitive comparison of the statistical performance between CMR and OMR with the noise matrices generated using DH. The results are averaged over 200 simulations with the standard errors in parentheses. CMR and OMR achieve similar performance. σmax Method Pre. Err. Adj. Pre.Err Est. Err. 1 CMR 13.565(0.1408) 1.0435(0.0108) 0.0599(0.0164) OMR 13.697(0.1554) 1.0486(0.0142) 0.0607(0.0128) 2 CMR 54.171(0.5771) 1.0418(0.0110) 0.2252(0.0649) OMR 54.221(0.6173) 1.0427(0.0118) 0.2359(0.0821) 4 CMR 215.98(2.104) 1.0384(0.0101) 0.80821(0.25078) OMR 216.19(2.391) 1.0394(0.0114) 0.81957(0.31806) −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.5 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Oracle(1) Oracle(2) Oracle(4) CMR(1) CMR(2) CMR(4) OMR(1) OMR(2) OMR(4) (a) The noise matrices are generated using DI −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.5 0 0.2 0.4 0.6 0.8 1 1.2 1.4 CMR(1) CMR(2) CMR(4) OMR(1) OMR(2) OMR(4) (b) The noise matrices are generated using DH Figure 4.1: The distributions of the selected regularization parameters using the kernel density estimator. The numbers in the parentheses are σmax’s. The optimal regularization parameters of OMR are spreader with different σmax than those of CMR and the oracle estimator. 7 5 Real Data Experiment We apply CMR on a brain activity prediction problem which aims to build a parsimonious model to predict a person’s neural activity when seeing a stimulus word. As is illustrated in Figure 5.1, for a given stimulus word, we first encode it into an intermediate semantic feature vector using some corpus statistics. We then model the brain’s neural activity pattern using CMR. Creating such a predictive model not only enables us to explore new analytical tools for the fMRI data, but also helps us to gain deeper understanding on how human brain represents knowledge [16]. (b) model for predicting fMRI brain activity pattern Predict fMRI brain activity patterns in response to text stimulus !"#$%&'()*' ? +',%,-.& Model !"#$%)/01'2 !"#$%0334'& %50//'.& !"#$%50//'.& %6)*7*4'& !"#$%6)*7*4'& 89/:4:2%,-.&2 %0334'& Standard solution Linear models (More restrictive) Our solution Nonlinear models (Less restrictive) . ;5'%'<3'.)/'+=2%0.'%*-+&:*='&%)+%>")=*5'44%'=%0?%8*)'+*'%@AB (a) illustration of the data collection procedure "apple" predicted activities for "apple" stimulus word intermediate semantic features mapping learned from fMRI data (Mitchell et al., Science,2008) Figure 5.1: An illustration of the fMRI brain activity prediction problem [16]. (a) To collect the data, a human participant sees a sequence of English words and their images. The corresponding fMRI images are recorded to represent the brain activity patterns; (b) To build a predictive model, each stimulus word is encoded into intermediate semantic features (e.g. the co-occurrence statistics of this stimulus word in a large text corpus). These intermediate features can then be used to predict the brain activity pattern. Our experiments involves 9 participants, and Table 5.1 summarizes the prediction performance of different methods on these participants. We see that the prediction based on the features selected by CMR significantly outperforms that based on the features selected by OMR, and is as competitive as that based on the handcrafted features selected by human experts. But due to the space limit, we present the details of the real data experiment in the technical report version. Table 5.1: Prediction accuracies of different methods (higher is better). CMR outperforms OMR for 8 out of 9 participants, and outperforms the handcrafted basis words for 6 out of 9 participants Method P. 1 P. 2 P. 3 P. 4 P. 5 P. 6 P. 7 P. 8 P. 9 CMR 0.840 0.794 0.861 0.651 0.823 0.722 0.738 0.720 0.780 OMR 0.803 0.789 0.801 0.602 0.766 0.623 0.726 0.749 0.765 Handcraft 0.822 0.776 0.773 0.727 0.782 0.865 0.734 0.685 0.819 6 Discussions A related method is the square-root sparse multivariate regression [8]. They solve the convex program with the Frobenius loss function and L1,p regularization function bB = argmin B ||Y −XB||F + λ||B||1,p. (6.1) The Frobenius loss function in (6.1) makes the regularization parameter selection independent of σmax, but it does not calibrate different regression tasks. Note that we can rewrite (6.1) as (bB, bσ) = argmin B,σ 1 pnmσ ||Y −XB||2 F + λ||B||1,p s. t. σ = 1 pnm||Y −XB||F. (6.2) Since σ in (6.2) is not specific to any individual task, it cannot calibrate the regularization. Thus it is fundamentally different from CMR. 8 References [1] T.W Anderson. An introduction to multivariate statistical analysis. Wiley New York, 1958. [2] Rie Kubota Ando and Tong Zhang. A framework for learning predictive structures from multiple tasks and unlabeled data. The Journal of Machine Learning Research, 6(11):1817–1853, 2005. [3] J Baxter. A model of inductive bias learning. Journal of Artificial Intelligence Research, 12:149–198, 2000. [4] A. Beck and M Teboulle. Fast gradient-based algorithms for constrained total variation image denoising and deblurring problems. IEEE Transactions on Image Processing, 18(11):2419–2434, 2009. [5] A. Belloni, V. Chernozhukov, and L Wang. Square-root lasso: pivotal recovery of sparse signals via conic programming. Biometrika, 98(4):791–806, 2011. [6] Peter J Bickel, Yaacov Ritov, and Alexandre B Tsybakov. Simultaneous analysis of lasso and dantzig selector. The Annals of Statistics, 37(4):1705–1732, 2009. [7] L. Breiman and J.H Friedman. Predicting multivariate responses in multiple linear regression. Journal of the Royal Statistical Society: Series B, 59(1):3–54, 2002. [8] Florentina Bunea, Johannes Lederer, and Yiyuan She. The group square-root lasso: Theoretical properties and fast algorithms. IEEE Transactions on Information Theory, 60:1313 – 1325, 2013. [9] Iain M Johnstone. Chi-square oracle inequalities. Lecture Notes-Monograph Series, pages 399–418, 2001. [10] Michel Ledoux and Michel Talagrand. Probability in Banach Spaces: isoperimetry and processes. Springer, 2011. [11] H. Liu, M. Palatucci, and J Zhang. Blockwise coordinate descent procedures for the multi-task lasso, with applications to neural semantic basis discovery. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 649–656. ACM, 2009. [12] J. Liu and J Ye. Efficient `1/`q norm regularization. Technical report, Arizona State University, 2010. [13] K. Lounici, M. Pontil, S. Van De Geer, and A.B Tsybakov. Oracle inequalities and optimal inference under group sparsity. The Annals of Statistics, 39(4):2164–2204, 2011. [14] N. Meinshausen and P. B¨uhlmann. Stability selection. Journal of the Royal Statistical Society: Series B, 72(4):417–473, 2010. [15] Nicolai Meinshausen and Bin Yu. Lasso-type recovery of sparse representations for high-dimensional data. The Annals of Statistics, 37(1):246–270, 2009. [16] T.M. Mitchell, S.V. Shinkareva, A. Carlson, K.M. Chang, V.L. Malave, R.A. Mason, and M.A Just. Predicting human brain activity associated with the meanings of nouns. Science, 320(5880):1191–1195, 2008. [17] Sahand N. Negahban, Pradeep Ravikumar, Martin J. Wainwright, and Bin Yu. A unified framework for high-dimensional analysis of m-estimators with decomposable regularizers. Statistical Science, 27(4):538–557, 2012. [18] Y. Nesterov. Smooth minimization of non-smooth functions. Mathematical Programming, 103(1):127– 152, 2005. [19] G. Obozinski, M.J. Wainwright, and M.I Jordan. Support union recovery in high-dimensional multivariate regression. The Annals of Statistics, 39(1):1–47, 2011. [20] Hua Ouyang, Niao He, Long Tran, and Alexander Gray. Stochastic alternating direction method of multipliers. In Proceedings of the 30th International Conference on Machine Learning, pages 80–88, 2013. [21] Garvesh Raskutti, Martin J Wainwright, and Bin Yu. Restricted eigenvalue properties for correlated gaussian designs. The Journal of Machine Learning Research, 11(8):2241–2259, 2010. [22] A.J. Rothman, E. Levina, and J Zhu. Sparse multivariate regression with covariance estimation. Journal of Computational and Graphical Statistics, 19(4):947–962, 2010. [23] R. Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society, Series B, 58(1):267–288, 1996. [24] B.A. Turlach, W.N. Venables, and S.J Wright. Simultaneous variable selection. Technometrics, 47(3):349–363, 2005. [25] M. Yuan and Y Lin. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B, 68(1):49–67, 2005. [26] Jian Zhang. A probabilistic framework for multi-task learning. PhD thesis, Carnegie Mellon University, Language Technologies Institute, School of Computer Science, 2006. 9
2014
350
5,459
Blossom Tree Graphical Models Zhe Liu Department of Statistics University of Chicago John Lafferty Department of Statistics Department of Computer Science University of Chicago Abstract We combine the ideas behind trees and Gaussian graphical models to form a new nonparametric family of graphical models. Our approach is to attach nonparanormal “blossoms”, with arbitrary graphs, to a collection of nonparametric trees. The tree edges are chosen to connect variables that most violate joint Gaussianity. The non-tree edges are partitioned into disjoint groups, and assigned to tree nodes using a nonparametric partial correlation statistic. A nonparanormal blossom is then “grown” for each group using established methods based on the graphical lasso. The result is a factorization with respect to the union of the tree branches and blossoms, defining a high-dimensional joint density that can be efficiently estimated and evaluated on test points. Theoretical properties and experiments with simulated and real data demonstrate the effectiveness of blossom trees. 1 Introduction Let p∗(x) be a probability density on Rd corresponding to a random vector X = (X1, . . . , Xd). The undirected graph G = (V, E) associated with p∗has d = |V | vertices corresponding to X1, . . . , Xd, and missing edges (i, j) ̸∈E whenever Xi and Xj are conditionally independent given the other variables. The undirected graph is a useful way of exploring and modeling the distribution. In this paper we are concerned with building graphical models for continuous variables, under weaker assumptions than those imposed by existing methods. If p∗(x) > 0 is strictly positive, the Hammersley-Clifford theorem implies that the density has the form p∗(x) ∝ Y C∈C ψC(xC) = exp X C∈C fC(xC) ! . (1.1) In this expression, C denotes the set of cliques in the graph, and ψC(xC) = exp(fC(xC)) > 0 denotes arbitrary potential functions. This represents a very large and rich set of nonparametric graphical models. The fundamental difficulty is that it is in general intractable to compute the normalizing constant. A compromise must be made to achieve computationally tractable inference, typically involving strong assumptions on the functions fC, on the graph G = {C}, or both. The default model for graphical modeling of continuous data is the multivariate Gaussian. When the Gaussian has covariance matrix Σ, the graph is encoded in the sparsity pattern of the precision matrix Ω= Σ−1. Specifically, edge (i, j) is missing if and only if Ωij = 0. Recent work has focused on sparse estimates of the precision matrix [8, 10]. In particular, an efficient algorithm for computing the estimator using a graphical version of the lasso is developed in [3]. The nonparanormal [5], a form of Gaussian copula, weakens the Gaussian assumption by imposing Gaussianity on the transformed random vector f(X) = (f1(X1), . . . , fd(Xd)), where each fj is a monotonic function. This allows arbitrary single variable marginal probability distributions in the model [5]. 1 Both the Gaussian graphical model and the nonparanormal maintain tractable inference without placing limitations on the independence graph. But they are limited in their ability to flexibly model the bivariate and higher order marginals. At another extreme, forest-structured graphical models permit arbitrary bivariate marginals, but maintain tractability by restricting to acyclic graphs. An nonparametric approach based on forests and trees is developed in [7] as a nonparametric method for estimating the density in high-dimensional settings. However, the ability to model complex independence graphs is compromised. In this paper we bring together the Gaussian, nonparanormal, and forest graphical models, using what we call blossom tree graphical models. Informally, a blossom tree consists of a forest of trees, and a collection of subgraphs–the blossoms—possibly containing many cycles. The vertex sets of the blossoms are disjoint, and each blossom contains at most one node of a tree. We estimate nonparanormal graphical models over the blossoms, and nonparametric bivariate densities over the branches (edges) of the trees. Using the properties of the nonparanormal, these components can be combined, or factored, to give a valid joint density for X = (X1, . . . , Xd). The details of our construction are given in Section 2. We develop an estimation procedure for blossom tree graphical models, including an algorithm for selecting tree branches, partition the remaining vertices into potential blossoms, and then estimating the graphical structures of the blossoms. Since an objective is to relax the Gaussian assumption, our criterion for selecting tree branches is deviation from Gaussianity. Toward this end, we use the negentropy, showing that it has strong statistical properties in high dimensions. In order to partition the nodes into blossoms, we employ a nonparametric partial correlation statistic. We use a data-splitting scheme to select the optimal blossom tree structure based on held-out risk. In the following section, we present the details of our method, including definitions of blossom tree graphs, the associated family of graphical models, and our estimation methods. In Sections 3 and 4, we present experiments with simulated and real data. Finally, we conclude in Section 5. Statistical properties, detailed proofs, and further experimental results are collected in a supplement. 2 Blossom Tree Graphs and Estimation Methods To unify the Gaussian, nonparanormal and forest graphical models we make the following definition. Definition 2.1. A blossom tree on a node set V = {1, 2, . . . , d} is a graph G = (V, E), together with a decomposition of the edge set E as E = F ∪{∪B∈BB} satisfying the following properties: 1. F is acyclic; 2. V (B) ∩V (B′) = ∅, for B, B′ ∈B with B ̸= B′, where V (B) denotes the vertex set of B. 3. |V (B) ∩V (F)| ≤1 for each B ∈B; 4. V (F) ∪S B V (B) = V . The subgraphs B ∈B are called blossoms. The unique node ρ(B) ∈V (B) ∩V (F), which may be empty, is called the pedicel of the blossom. The set of pedicels is denoted P(F) ⊂V (F). Property 1 says that the set of edges F forms a union of trees—a forest. Property 2 says that distinct blossoms share no vertices or edges in common. Property 3 says that each blossom is connected to at most one tree node. Property 4 says that every node in the graph is either in a tree or a blossom. Note that the blossoms are not required to be connected, but must have at most one vertex in common with the forest—this is the pedicel node. 2 (a) blossom tree (b) violation (c) blossom tree (d) violation Figure 1: Four graphs, two blossom trees. The tree edges are colored blue, the blossom edges are colored black, and pedicels are orange. Graphs (a) and (c) correspond to blossom trees. Graphs (b) and (d) violate the restriction that each blossom has only a single pedicel, or attachment to a tree. Suppose that p(x) = p(x1, . . . , xd) is the density of a distribution that has an independence graph given by a blossom tree F ∪{∪BB}. Then from the blossom tree properties we have that p(x) = p(XV (F )) Y B∈B p(XV (B) | XV (F )) (2.1) = p(XV (F )) Y B∈B p(XV (B) | Xρ(B)) (2.2) = p(XV (F )) Y B∈B p(XV (B)) p(Xρ(B)) (2.3) = Y (s,t)∈F p(Xs, Xt) p(Xs)p(Xt) Y s∈V (F ) p(Xs) Y B∈B p(XV (B)) p(Xρ(B)) (2.4) = Y (s,t)∈F p(Xs, Xt) p(Xs)p(Xt) Y s∈V (F )\P(F ) p(Xs) Y B∈B p(XV (B)). (2.5) The first equality follows from disjointness of the blossoms. The second equality follows from the existence of a single pedicel node attaching the blossom to a tree. The fourth equality follows from the standard factorization of forests, and the last equality follows from the fact that each non-empty pedicel for a blossom is unique. We call the set of distributions that factor in this way the family of blossom tree graphical models. A key property of the nonparanormal [5] is that the single node marginal probabilities p(Xs) are arbitrary. This property allows us to form graphical models where each blossom distribution satisfies XV (B) ∼NPN(µB, ΣB, fB), while enforcing that the single node marginal of the pedicel ρ(B) agrees with the marginals of this node defined by the forest. This allows us to define and estimate distributions that are consistent with the factorization (2.5). Let X(1), . . . , X(n) be n i.i.d. Rd-valued data vectors sampled from p∗(x) where X(l) = (X(l) 1 , . . . , X(l) d ). Our goal is to derive a method for high-dimensional undirected graph estimation and density estimation, using a family of semiparametric estimators based on the blossom tree structure. Let FB denote the blossom tree structure F ∪{∪BB}. Our estimation procedure is the following. First, randomly partition the data X(1), . . . , X(n) into two sets D1 and D2 of sample size n1 and n2. Then apply the following steps. 1. Using D1, estimate the bivariate densities p∗(xi, xj) using kernel density estimation. Also, estimate the covariance Σij for each pair of variables. Apply Kruskal’s algorithm on the estimated pairwise negentropy matrix to construct a family of forests { bF (k)} with k = 0, . . . , d −1 edges; 2. Using D1, for each forest bF (k) obtained in Step 1, build the blossom tree-structured graph bF (k) b B . The forest structure bF (k) is modeled by nonparametric kernel density estimators, while each blossom bB(k) i is modeled by the graphical lasso or nonparanormal. A family of 3 graphs is obtained by computing regularization paths for the blossoms, using the graphical lasso. 3. Using D2, choose bF (bk) b B from this family of blossom tree models that maximizes the heldout log-likelihood. The details of each step are presented below. 2.1 Step 1: Construct A Family of Forests In information theory and statistics, negentropy is used as a measure of distance to normality. The negentropy is zero for Gaussian densities and is always nonnegative. The negentropy between variables Xi and Xj is defined as J(Xi; Xj) = H(φ(xi, xj)) −H(p∗(xi, xj)), (2.6) where H(·) denotes the differential entropy of a density, and φ(xi, xj) is an Gaussian density with the same mean and covariance matrix as p∗(xi, xj). Kruskal’s algorithm [4] is a greedy algorithm to find a maximum weight spanning tree of a weighted graph. At each step it includes an edge connecting the pair of nodes with the maximum weight among all unvisited pairs, if doing so does not form a cycle. The algorithm also results in the best k-edge weighted forest after k < d edges have been included. In our setting, we define the weight w(i, j) of nodes i and j as the negentropy between Xi and Xj, and use Kruskal’s algorithm to build the maximum weight spanning forest bF (k) with k edges where k < d. In such a way, the pairs of nodes that are less likely to be a bivariate Gaussian are included in the forest and then are modeled nonparametrically. Since the true density p∗is unknown, we replace the population negentropy J(Xi; Xj) by the estimate bJn1(Xi; Xj) = H(bφn1(xi, xj)) −bH(bpn1(xi, xj)), (2.7) where bφn1(xi, xj) is an estimate of the Gaussian density φ(xi, xj) for Xi and Xj using D1, bpn1(xi, xj) is a bivariate kernel density estimate for Xi and Xj, and bH(·) denotes the empirical differential entropy. In particular, let Σij be the covariance matrix of Xi and Xj. Denote bΣij n1 as the empirical covariance matrix of Xi and Xj based on D1, then the plug-in estimate H(bφn1(xi, xj)) = 1 + log(2π) + 1 2logdet(bΣij n1). (2.8) Let K(·) be a univariate kernel function. Then given an evaluation point (xi, xj), the bivariate kernel density estimate for (Xi, Xj) based on observations {X(l) i , X(l) j }l∈D1 is given by bpn1(xi, xj) = 1 n1 X l∈D1 1 h2ih2j K X(l) i −xi h2i ! K X(l) j −xj h2j ! , (2.9) where h2i and h2j are bandwidth parameters for (Xi, Xj). To compute the empirical differential entropy bH(bpn1(xi, xj)), we numerically evaluate a two-dimensional integral. Once the estimated negentropy matrix h bJn1(Xi; Xj) i d×d is obtained, we apply Kruskal’s algorithm to construct a family of forests { bF (k)}k=0...d−1. 2.2 Step 2: Build and Model the Blossom Tree Graphs Suppose that we have a forest-structured graph F with |V (F)| < d vertices. Then for each remaining non-forest node, we need to determine which blossom it belongs to. We exploit the following basic fact. 4 Proposition 2.1. Suppose that X ∼p∗is a density for a blossom tree graphical model with forest F. Let i ̸∈V (F) and s ∈V (F). Then node i is not in a blossom attached to tree node s if and only if Xi ⊥⊥Xs | Xt for some node t ∈V (F) such that (s, t) ∈E(F). (2.10) We use this property, together with a measure of partial correlation, in order to partition the nonforest nodes into blossoms. Partial correlation measures the degree of association between two random variables, with the effect of a set of controlling random variables removed. Traditionally, the partial correlation between variables Xi and Xs given a controlling variable Xt is the correlation between the residuals ϵi\t and ϵs\t resulting from the linear regression of Xi with Xt and of Xs with Xt, respectively. However, if the underlying joint Gaussian or nonparanormal assumption is not satisfied, linear regression cannot remove all of the effects of the controlling variable. We thus use a nonparametric version of partial correlation. Following [1], suppose Xi = g(Xt)+ϵi\t and Xs = h(Xt)+ϵs\t, for certain functions g and h such that E(ϵi\t | Xt) = 0 and E(ϵs\t | Xt) = 0. Define the nonparametric partial correlation as ρis·t = E(ϵi\tϵs\t) .q E(ϵ2 i\t) E(ϵ2 s\t). (2.11) It is shown in [1] that if Xi ⊥⊥Xs | Xt, then ρis·t = 0. We thus conclude the following. Proposition 2.2. If ρis·t ̸= 0 for all t such that (s, t) ∈E(F), node i is in a blossom attached to node s. Let bg and bh be local polynomial estimators of g and h, and bϵ(l) i\t = X(l) i −bg(X(l) t ), bϵ(l) s\t = X(l) s − bh(X(l) t ) for any l ∈D1, then an estimate of ρis·t is given by bρis·t = X l∈D1 (bϵ(l) i\t bϵ(l) s\t) .s X l∈D1 (bϵ(l) i\t)2 X l∈D1 (bϵ(l) s\t)2. (2.12) Based on Proposition 2.2, for each forest bF (k) obtained in Step 1, we then assign each non-forest node i to the blossom with the pedicel given by bsi = argmax s∈V ( b F (k)) min {t: (s,t)∈E( b F (k))} |bρis·t|. (2.13) After iterating over all non-forest nodes, we obtain a blossom tree-structured graph bF (k) b B . Then the forest structure is nonparametrically modeled by the bivariate and univariate kernel density estimations, while each blossom is modeled with the graphical lasso or nonparanormal. In particular, when k = 0 that there is no forest node, our method is reduced to modeling the entire graph by the graphical lasso or nonparanormal. Alternative testing procedures based on nonparametric partial correlations could be adopted for partitioning nodes into blossoms. However, such methods may have large computational cost, and low power for small sample sizes. Note that while each non-forest node is associated with a pedicel in this step, after graph estimation for the blossoms, the node may well become disconnected from the forest. 2.3 Step 3: Optimize the Blossom Tree Graphs The full blossom tree graph bF (d−1) b B obtained in Steps 1 and 2 might result in overfitting in the density estimate. Thus we need to choose an optimal graph with the number of forest edges k ≤d −1. Besides, the tuning parameters involved in the fitting of each blossom by the graphical lasso or nonparanormal also induce a bias-variance tradeoff. 5 To optimize the blossom tree structures over { bF (k) b B }k=0...d−1, we choose the complexity parameter bk as the one that maximizes the log-likelihood on D2, using the factorization (2.5): bk = argmax k∈{0,...,d−1} 1 n2 X l∈D2 log   Y (i,j)∈E( b F (k)) bpn1(X(l) i , X(l) j ) bpn1(X(l) i )bpn1(X(l) j ) · Y s∈V ( b F (k))\P( b F (k)) bpn1(X(l) s ) k Y i=1 bφ λ(k) i n1 X(l) V ( b B(k) i )   , (2.14) where bφ λ(k) i n1 is the density estimate for blossoms by the graphical lasso or nonparanormal, with the tuning parameter λ(k) i selected to maximize the held-out log-likelihood. That is, the complexity of each blossom is also optimized on D2. Thus the final blossom tree density estimator is given by p b F (bk) b B (x) = Y (i,j)∈E( b F (bk)) bpn1(xi, xj) bpn1(xi)bpn1(xj) Y s∈V ( b F (bk))\P( b F (bk)) bpn1(X(l) s ) bk Y i=1 bφ λ(bk) i n1 (x b B(bk) i ). (2.15) In practice, Step 3 can be carried out simultaneously with Steps 1 and 2. Whenever a new edge is added to the current forest in Kruskal’s algorithm, the blossoms are re-constructed and re-modeled. Then the held-out log-likelihood of the obtained density estimator can be immediately computed. In addition, since there are no overlapping nodes between different blossoms, the sparsity tuning parameters are selected separately for each blossom, which reduces the computational cost considerably. 3 Analysis of Simulated Data Here we present numerical results based on simulations. We compare the blossom tree density estimator with the graphical lasso [3] and forest density estimator [7]. To evaluate the performance of these estimators, we compute and compare the log-likelihood of each method on held-out data. We simulate high-dimensional data which are consistent with an undirected graph. We generate multivariate non-Gaussian data using a sequence of mixtures of two Gaussian distributions with contrary correlation and equal weights. Then a subset of variables are chosen to generate the blossoms that are distributed as multivariate Gaussians. In dimensional d = 80, we sample n1 = n2 = 400 data points from this synthetic distribution. A typical run showing the held-out log-likelihood and estimated graphs is provided in Figures 2 and 3. The term “trunk” is used to represent the edge added to the forest in a blossom tree graph. We can see that the blossom tree density estimator is superior to other methods in terms of generalization performance. In particular, the graphical lasso is unable to uncover the edges that are generated nonparametrically. This is expected, since different blossoms have zero correlations among each other and are thus regarded as independent by the algorithm of graphical lasso. For the modeling of the variables that are contained in a blossom and are thus multivariate Gaussian distributed, there is an efficiency loss in the forest density estimator, compared to the graphical lasso. This illustrates the advantage of blossom tree density estimator. As is seen from the number of selected edges by each method shown in Figure 2, the blossom tree density estimator selects a graph with a similar sparsity pattern as the true graph. 4 Analysis of Cell Signalling Data We analyze a flow cytometry dataset on d = 11 proteins from [9]. A subset of n = 853 cells were chosen. A nonparanormal transformation was estimated and the observations, for each variable, 6 0 20 40 60 80 −113 −112 −111 −110 −109 −108 Number of trunks Held out log−likelihood 0 20 40 60 80 20 30 40 50 60 70 80 Number of trunks Number of selected edges Figure 2: Results on simulations. Left: Held-out log-likelihood of the graphical lasso (horizontal dotted line), forest density estimator (horizontal dashed line), and blossom tree density estimator (circles); Right: Number of selected edges by these methods. The horizontal solid line indicates the number of edges in the true graph, and the solid triangle indicates the best blossom tree graph. The first circle for blossom tree refers to the 1-trunk case. true glasso forest forest−blossom true glasso forest forest−blossom true glasso forest forest−blossom true glasso forest forest−blossom (a) true (b) glasso (c) forest (d) blossom tree Figure 3: Results on simulations. Graph (a) corresponds to the true graph. Graphs (b), (c) and (d) correspond to the estimated graphs by the graphical lasso, forest density estimator, and blossom tree density estimator, respectively. The tree edges are colored red, and the blossom edges are colored black. were replaced by their respective normal scores, subject to a Winsorized truncation [5]. We study the associations among the proteins using the graphical lasso, forest density estimator, and blossom tree forest density estimator. The maximum held-out log-likelihood for glasso, forest, and blossom tree are -14.3, -13.8, and -13.7, respectively. We can see that blossom tree is slighter better than forest in terms of the generalization performance, both of which outperform glasso. Results of estimated graphs are provided in Figures 4. When the maximum of held-out log-likelihood curve is achieved, glasso selects 28 edges, forest selects 7 edges, and blossom tree selects 10 edges. The two graphs uncovered by forest and blossom tree agree on most edges, although the latter contains cycles. 5 Conclusion We have proposed a combination of tree-based graphical models and Gaussian graphical models to form a new nonparametric approach for high dimensional data. Blossom tree models relax the normality assumption and increase statistical efficiency by modeling the forest with nonparametric kernel density estimators and modeling each blossom with the graphical lasso or nonparanormal. Our experimental results indicate that this method can be a practical alternative to standard approaches to graph and density estimation. 7 (a) graph reported in [9] (b) glasso (c) forest (d) blossom tree Figure 4: Results on cell signalling data. Graph (a) refers to the fitted graph reported in [9]. Graphs (b), (c) and (d) correspond to the estimated graphs by the graphical lasso, forest density estimator, and blossom tree density estimator, respectively. Acknowledgements Research supported in part by NSF grant IIS-1116730, AFOSR grant FA9550-09-1-0373, ONR grant N000141210762, and an Amazon AWS in Education Machine Learning Research grant. References [1] Wicher Bergsma. A note on the distribution of the partial correlation coefficient with nonparametrically estimated marginal regressions. arXiv:1101.4616, 2011. [2] T. Tony Cai, Tengyuan Liang, and Harrison H. Zhou. Law of log determinant of sample covariance matrix and optimal estimation of differential entropy for high-dimensional gaussian distributions. arXiv:1309.0482, 2013. [3] Jerome H. Friedman, Trevor Hastie, and Robert Tibshirani. Sparse inverse covariance estimation with the graphical lasso. Biostatistics, 9(3):432–441, 2008. [4] Joseph B. Kruskal. On the shortest spanning subtree of a graph and the traveling salesman problem. In Proceedings of the American Mathematical Society, volume 7, pages 48–50, 1956. [5] Han Liu, John Lafferty, and Larry Wasserman. The nonparanormal: Semiparametric estimation of high dimensional undirected graphs. Journal of Machine Learning Research, 10:2295–2328, 2009. [6] Han Liu, Larry Wasserman, and John D. Lafferty. Exponential concentration for mutual information estimation with application to forests. In Advances in Neural Information Processing Systems (NIPS), 2012. [7] Han Liu, Min Xu, Haijie Gu, Anupam Gupta, John Lafferty, and Larry Wasserman. Forest density estimation. Journal of Machine Learning Research, 12:907–951, 2011. [8] Nicolai Meinshausen and Peter B¨uhlmann. High dimensional graphs and variable selection with the lasso. Annals of Statistics, 34(3), 2006. [9] Karen Sachs, Omar Perez, Dana Pe’er, Douglas A. Lauffenburger, and Garry P. Nolan. Causal protein-signaling networks derived from multiparameter single-cell data. Science, 308(5721):523–529, 2003. [10] Ming Yuan and Yi Lin. Model selection and estimation in the Gaussian graphical model. Biometrika, 94(1):19–35, 2007. 8
2014
351
5,460
Scalable Methods for Nonnegative Matrix Factorizations of Near-separable Tall-and-skinny Matrices Austin R. Benson ICME Stanford University Stanford, CA arbenson@stanford.edu Jason D. Lee ICME Stanford University Stanford, CA jdl17@stanford.edu Bartek Rajwa Bindley Biosciences Center Purdue University West Lafeyette, IN brajwa@purdue.edu David F. Gleich Computer Science Department Purdue University West Lafeyette, IN dgleich@purdue.edu Abstract Numerous algorithms are used for nonnegative matrix factorization under the assumption that the matrix is nearly separable. In this paper, we show how to make these algorithms scalable for data matrices that have many more rows than columns, so-called “tall-and-skinny matrices.” One key component to these improved methods is an orthogonal matrix transformation that preserves the separability of the NMF problem. Our final methods need to read the data matrix only once and are suitable for streaming, multi-core, and MapReduce architectures. We demonstrate the efficacy of these algorithms on terabyte-sized matrices from scientific computing and bioinformatics. 1 Nonnegative matrix factorizations at scale A nonnegative matrix factorization (NMF) for an m × n matrix X with real-valued, nonnegative entries is X = WH (1) where W is m × r, H is r × n, r < min(m, n), and both factors have nonnegative entries. While there are already standard dimension reduction techniques for general matrices such as the singular value decomposition, the advantage of NMF is in interpretability of the data. A common example is facial image decomposition [17]. If the columns of X are pixels of a facial image, the columns of W may be facial features such as eyes or ears, and the coefficients in H represent the intensity of these features. For this reason, among a host of other reasons, NMF is used in a broad range of applications including graph clustering [21], protein sequence motif discovery [20], and hyperspectral unmixing [18]. An important property of matrices in these applications and other massive scientific data sets is that they have many more rows than columns (m ≫n). For example, this matrix structure is common in big data applications with hundreds of millions of samples and a small set of features—see, e.g., Section 4.2 for a bioinformatics application where the data matrix has 1.6 billion rows and 25 columns. We call matrices with many more rows than columns tall-and-skinny. The number of columns of these matrices is small, so there is no problem storing or manipulating them. Our use 1 of NMF is then to uncover the hidden structure in the data rather than for dimension reduction or compression. In this paper, we present scalable and computationally efficient NMF algorithms for tall-and-skinny matrices as prior work has not taken advantage of this structure for large-scale factorizations. The advantages of our method are: we preserve the geometry of the problem, we only read the data matrix once, and we can test several different nonnegative ranks (r) with negligible cost. Furthermore, we show that these methods can be implemented in parallel (Section 3) to handle large data sets. In Section 2.3, we present a new dimension reduction technique using orthogonal transformations. These transformations are particularly effective for tall-and-skinny matrices and lead to algorithms that only need to read the data matrix once. We compare this method with a Gaussian projection technique from the hyperspectral unmixing community [5, 7]. We test our algorithms on data sets from two scientific applications, heat transfer simulations and flow cytometry, in Section 4. Our new dimension reduction technique outperforms Gaussian projections on these data sets. In the remainder of the introduction, we review the state of the art for computing non-negative matrix factorizations. 1.1 Separable NMF We first turn to the issue of how to practically compute the factorization in Equation (1). Unfortunately, for a fixed non-negative rank r, finding the factors W and H for which the residual ∥X −WH∥ is minimized is NP-complete [26]. To make the problem tractable, we make assumptions about the data. In particular, we require a separability condition on the matrix. A nonnegative matrix X is separable if X = X(:, K)H, where K is an index set with |K| = r and X(:, K) is Matlab notation for the matrix X restricted to the columns indexed by K. Since the coefficients of H are nonnegative, all columns of X live in the conical hull of the “extreme” columns indexed by K. The idea of separability was developed by Donoho and Stodden [15], and recent work has produced tractable NMF algorithms by assuming that X almost satisfies a separability condition [3, 6]. A matrix X is noisy r-separable or near-separable if X = X(:, K)H + N, where N is a noise matrix whose entries are small. Near-separability means that all data points approximately live in the conical hull of the extreme columns. The algorithms for near-separable NMF are typically based on convex geometry (see Section 2.1) and can be described by the same two-step approach: 1. Determine the extreme columns, indexed by K, and let W = X(:, K). 2. Solve H = arg minY∈Rr×n + ∥X −WY∥. The bulk of the literature is focused on the first step. In Section 3, we show how to implement both steps in a single pass over the data and provide the details of a MapReduce implementation. We note that separability (or near-separability) is a severe and restrictive assumption. The tradeoff is that our algorithms are extremely scalable and provably correct under this assumption. In big data applications, scalability is at a premium, and this provides some justification for using separability as a tool for exploratory data analysis. Furthermore, our experiments on real scientific data sets in Section 4 under the separability assumption lead to new insights. 1.2 Alternative NMF algorithms and related work There are several approaches to solving Equation (1) that do not assume the separability condition. These algorithms typically employ block coordinate descent, optimizing over W and H while keeping one factor fixed. Examples include the seminal work by Lee and Seung [23], alternating least squares [10], and fast projection-based least squares [19]. Some of these methods are used in MapReduce architectures at scale [24]. Alternating methods require updating the entire factor W or H after each optimization step. When one of the factors is large, repeated updates can be prohibitively expensive. The problem is exacerbated in Hadoop MapReduce, where intermediate results are written to disk. In addition, alternating methods can take an intolerable number of iterations to converge. Regardless of the approach or computing platform, the algorithms are too slow when the matrices cannot fit in main memory In 2 contrast, we show in Sections 2 and 3 that the separability assumption leads to algorithms that do not require updates to large matrices. This approach is scalable for large tall-and-skinny matrices in big data problems. 2 Algorithms and dimension reduction for near-separable NMF There are several popular algorithms for near-separable NMF, and they are motivated by convex geometry. The goal of this section is to show that when X is tall-and-skinny, we can apply dimension reduction techniques so that established algorithms can execute on n × n matrices, rather than the original m × n. Our new dimension reduction technique in Section 2.3 is also motivated by convex geometry. In Section 3, we leverage the dimension reduction into scalable algorithms. 2.1 Geometric algorithms There are two geometric strategies typically employed for near-separable NMF. The first deals with conical hulls. A cone C ⊂Rm is a non-empty convex set with C = {P i αixi | αi ∈R+, xi ∈Rm}. The xi are generating vectors. In separable NMF, X = X(:, K)H implies that all columns of X lie in the cone generated by the columns indexed by K. For any k ∈K, {αX(:, k) | α ∈R+} is an extreme ray of this cone, In other words, the set of columns indexed by K are the set of extreme rays of the cone. The goal of the XRAY algorithm [22] is to find these extreme rays (i.e., to find K). In particular, the greedy variant of XRAY selects the maximum column norm arg maxj ∥RT X(:, j)∥2/∥X(:, j)∥2, where R is a residual matrix that gets updated with each new extreme column. The second approach deals with convex hulls, where the columns of X are ℓ1-normalized. If D is a diagonal matrix with Dii = ∥X(:, i)∥1 and X is separable, then XD−1 = X(:, K)D(K, K)−1D(K, K)HD−1 = (XD−1)(:, K) ˜H. Thus, XD−1 is also separable (in fact, this holds for any nonsingular diagonal matrix D). Since the columns are ℓ1-normalized, the columns of ˜H have non-negative entries and sum to one. In other words, all columns of XD−1 are in the convex hull of the columns indexed by K. The problem of determining K is reduced to finding the extreme points of a convex hull. Popular approaches in the context of NMF include the Successive Projection Algorithm (SPA, [2]) and its generalization [16]. Another alternative, based on linear programming, is Hott Topixx [6]. Other geometric approaches had good heuristic performance [9, 25] before the more recent theoretical work. As an example of the particulars of one such method, SPA, which we will use in Section 4, finds extreme points by computing arg maxj ∥R(:, j)∥2 2, where R is a residual matrix related to the data matrix X. In any algorithm, we call the columns indexed by K extreme columns. The next two subsections are devoted to dimension reduction techniques for finding the extreme columns in the case when X is tall-and-skinny. 2.2 Gaussian projection A common dimension reduction technique is random Gaussian projections, and the idea has been used in hyperspectral unmixing problems [5]. In the hyperspectral unmixing literature, the separability is referred to as the pure-pixel assumption, and the random projections are motivated by convex geometry [7]. In particular, given a matrix G ∈Rm×k with Gaussian i.i.d. entries, the extreme columns of X are taken as the extreme columns of GT X, which is of dimension k × n. Recent work shows that when X is nearly r-separable and k = O(r log r), then all of the extreme columns are found with high probability [13]. 2.3 Orthogonal transformations Our new alternative dimension reduction technique is also motivated by convex geometry. Consider a cone C ⊂Rm and a nonsingular m × m matrix M. It is easily shown that x is an extreme ray of C 3 if and only if Mx is an extreme ray of MC = {Mz | z ∈C}. Similarly, for any convex set, invertible transformations preserve extreme points. We take advantage of these facts by applying specific orthogonal transformations as the nonsingular matrix M. Let X = Q ˜R and X = U ˜ΣVT be the full QR factorization and singular value decomposition (SVD) of X, so that Q and U are m × m orthogonal (and hence nonsingular) matrices. Then QT X = R 0 ! , UT X = ΣVT 0 ! , where R and Σ are the top n × n blocks of ˜R and ˜Σ and 0 is an (m −n) × n matrix of zeroes. The zero rows provide no information on which columns of QT X or UT X are extreme rays or extreme points. Thus, we can restrict ourselves to finding the extreme columns of R and ΣVT. These matrices are n × n, and we have significantly reduced the dimension of the problem. In fact, if X = X(:, K)H is a separable representation, we immediately have separated representations for R and ΣVT: R = R(:, K)H, ΣVT = ΣVT(:, K)H. We note that, although any invertible transformation preserves extreme columns, many transformations will destroy the geometric structure of the data. However, orthogonal transformations are either rotations or reflections, and they preserve the data’s geometry. Also, although QT and UT are m × m, we will only apply them implicitly (see Section 3.1), i.e., these matrices are never formed or computed. This dimension reduction technique is exact when X is r-separable, and the results will be the same for orthogonal transformations QT and UT. This is a consequence of the transformed data having the same separability as the original data. The SPA and XRAY algorithms briefly described in Section 2.1 only depend on computing column 2-norms, which are preserved under orthogonal transformations. For these algorithms, applying QT or UT preserves the column 2-norms of the data, and the selected extreme columns are the same. However, other NMF algorithms do not possess this invariance. For this reason, we present both of the orthogonal transformations. Finally, we highlight an important benefit of this dimension reduction technique. In many applications, the data is noisy and the separation rank (r in Equation (1)) is not known a priori. In Section 2.4, we show that the H factor can be computed in the small dimension. Thus, it is viable to try several different values of the separation rank and pick the best one. This idea is extremely useful for the applications presented in Section 4, where we do not have a good estimate of the separability of the data. 2.4 Computing H Selecting the extreme columns indexed by K completes one half of the NMF factorization in Equation (1). How do we compute H? We want H = arg minY∈Rr×n + ∥X −X(:, K)Y∥2 for some norm. Choosing the Frobenius norm results in a set of n nonnegative least squares (NNLS) problems: H(:, i) = arg min y∈Rr + ∥X(:, K)y −X(:, i)∥2 2, i = 1, . . . , n. Let X = Q ˜R with R the upper n × n block of ˜R. Then H(:, i) is computed by finding y ∈Rr + that minimizes ∥X(:, K)y −X(:, i)∥2 2 = ∥QT (X(:, K)y −X(:, i)) ∥2 2 = ∥R(:, K)y −R(:, i)∥2 2 Thus, we can solve the NNLS problem with matrices of size n × n. After computing just the small R factor from the QR factorization, we can compute the entire nonnegative matrix factorization by working with matrices of size n × n. Analogous results hold for the SVD, where we replace Q by U, the left singular vectors. In Section 3, we show that these computations are simple and scalable. Since m ≫n, computations on O(n2) data are fast, even in serial. Finally, note that we can also compute the residual in this reduced space, i.e.: min y∈Rn + ∥X(:, K)y −X(:, i)∥2 2 = min y∈Rn + ∥R(:, K)y −R(:, i)∥2 2. This simple fact is significant in practice. When there are several candidate sets of extreme columns K, the residual error for each set can be computed quickly. In Section 4, we compute many residual errors for different sets K in order to choose an optimal separation rank. 4 We have now shown how to use dimension reduction techniques for tall-and-skinny matrix data in near-separable NMF algorithms. Following the same strategy as many NMF algorithms, we first compute extreme columns and then solve for the coefficient matrix H. Fortunately, once the upfront cost of the orthogonal transformation is complete, both steps can be computed using O(n2) data. 3 Implementation Remarkably, when the matrix is tall-and-skinny, we only need to read the data matrix once. The reads can be performed in parallel, and computing platforms such as MapReduce, Spark, distributed memory MPI, and GPUs can all achieve optimal parallel communication. For our implementation, we use Hadoop MapReduce for convenience.1 While all of the algorithms use sophisticated computation, these routines are only ever invoked with matrices of size n × n. Furthermore, the local memory requirements of these algorithms are only O(n2). Thus, we get extremely scalable implementations. We note that, using MapReduce, computing GT X for the Gaussian projection technique is a simple variation of standard methods to compute XT X [4]. 3.1 TSQR and R-SVD The thin QR factorization of an m × n real-valued matrix X with m > n is X = QR where Q is an m × n orthogonal matrix and R is an n × n upper triangular matrix. This is precisely the factorization we need in Section 2. For our purposes, QT is applied implicitly, and we only need to compute R. When m ≫n, communication-optimal algorithms for computing the factorization are referred to as TSQR [14]. Implementations and specializations of the TSQR ideas are available in several environments, including MapReduce [4, 11], distributed memory MPI [14], and GPUs [1]. All of these methods avoid computing XT X and hence are numerically stable. The thin SVD used in Section 2.3 is a small extension of the thin QR factorization. The thin SVD is X = UΣVT, where U is m × n and orthogonal, Σ is diagonal with decreasing, nonnegative diagonal entries, and V is n×n and orthogonal. Let X = QR be the thin QR factorization of X and R = URΣVT be the SVD of R. Then X = (QUR)ΣVT = UΣVT. The matrix U = QUR is m × n and orthogonal, so this is the thin SVD of X. The dimension of R is n × n, so computing its SVD takes O(n3) floating point operations (flops), a trivial cost when n is small. When m ≫n, this method for computing the SVD is called the R-SVD [8]. Both TSQR and R-SVD require O(mn2) flops. However, the dominant cost is data I/O, and TSQR only reads the data matrix once. 3.2 Column normalization The convex hull algorithms from Section 2.1 and the Gaussian projection algorithm from Section 2.2 require the columns of the data matrix X to be normalized. A naive implementation of the column normalization in a MapReduce environment is: (1) read X and compute the column norms; (2) read X, normalize the columns, and write the normalized data to disk; (3) use TSQR on the normalized matrix. This requires reading the data matrix twice and writing O(mn) data to disk once just to normalize the columns. The better approach is a single step: use TSQR on the unnormalized data X and simultaneously compute the column norms. If D is the diagonal matrix of column norms, then X = QR →XD−1 = Q(RD−1). The matrix ˆR = RD−1 is upper triangular, so Q ˆR is the thin QR factorization of the columnnormalized data. This approach reads the data once and only writes O(n2) data. The same idea applies to Gaussian projection since GT(XD−1) = (GT X)D−1. Thus, our algorithms only need to read the data matrix once in all cases. (We refer to the algorithm output as selecting the columns and computing the matrix H, which is typically what is used in practice. Retrieving the entries from the columns of A from K does require a subsequent pass.) 4 Applications In this section, we test our dimension reduction technique on massive scientific data sets. The data are nonnegative, but we do not know a priori that the data is separable. Experiments on synthetic 1The code is available at https://github.com/arbenson/mrnmf. 5 data sets are provided in an online version of this paper and show that our algorithms are effective and correct on near-separable data sets.2 All experiments were conducted on a 10-node, 40-core MapReduce cluster. Each node has 6 2-TB disks, 24 GB of RAM, and a single Intel Core i7-960 3.2 GHz processor. They are connected via Gigabit ethernet. We test the following three algorithms: (1) dimension reduction with the SVD followed by SPA; (2) Dimension reduction with the SVD followed by the greedy variant of the XRAY algorithm; (3) Gaussian projection (GP) as described in Section 2.2. We note that the greedy variant of XRAY is not exact in the separable case but works well in practice [22]. Using our dimension reduction technique, all three algorithms require reading the data only once. The algorithms were selected to be a representative set of the approaches in the literature, and we will refer to the three algorithms as SPA, XRAY, and GP. As discussed in Section 2.3, the choice of QR or SVD does not matter for these algorithms (although it may matter for other NMF algorithms). Thus, we only consider the SVD transformation in the subsequent numerical experiments. 4.1 Heat transfer simulation The heat transfer simulation data contains the simulated heat in a high-conductivity stainless steel block with a low-conductivity foam bubble inserted in the block [12].3 Each column of the matrix corresponds to simulation results for a foam bubble of a different radius. Several simulations for random foam bubble locations are included in a column. Each row corresponds to a three-dimensional spatial coordinate, a time step, and a bubble location. An entry of the matrix is the temperature of the block at a single spatial location, time step, bubble location, and bubble radius. The matrix is constructed such that columns near 64 have far more variability in the data – this is then responsible for additional “rank-like” structure. Thus, we would intuitively expect the NMF algorithms to select additional columns closer to the end of the matrix. (And indeed, this is what we will see shortly.) In total, the matrix has approximately 4.9 billion rows and 64 columns and occupies a little more than 2 TB on the Hadoop Distributed File System (HDFS). The left plot of Figure 1 shows the relative error for varying separation ranks. The relative error is defined as ∥X −X(:, K)H∥2 F/∥X∥2 F. Even a small separation rank (r = 4) results in a small residual. SPA has the smallest residuals, and XRAY and GP are comparable. An advantage of our projection method is that we can quickly test many values of r. For the heat transfer simulation data, we choose r = 10 for further experiments. This value is near an “elbow” in the residual plot for the GP curve. We note that the original SPA and XRAY algorithms would achieve the same reconstruction error if applied to the entire data set. Our dimension reduction technique allows us to accelerate these established methods for this large problem. The middle plot of Figure 1 shows the columns selected by each algorithm. Columns 5 through 30 are not extreme in any algorithm. Both SPA and GP select at least one column in indices one through four. Columns 41 through 64 have the highest density of extreme columns for all algorithms. Although the extreme columns are different for the algorithms, the coefficient matrix H exhibits remarkably similar characteristics in all cases. Figure 2 visualizes the matrix H for each algorithm. Each non-extreme column is expressed as a conic combination of only two extreme columns. In general, the two extreme columns corresponding to column i are j1 = arg max{j ∈K | j < i} and arg min{j ∈K | j > i}. In other words, a non-extreme column is a conic combination of the two extreme columns that “sandwich” it in the data matrix. Furthermore, when the index i is closer to j1, the coefficient for j1 is larger and the coefficient for j2 is smaller. This phenomenon is illustrated in the right plot of Figure 1. 4.2 Flow cytometry The flow cytometry (FC) data represent abundances of fluorescent molecules labeling antibodies that bind to specific targets on the surface of blood cells.4 The phenotype and function of individual cells can be identified by decoding these label combinations. The analyzed data set contains measurements of 40,000 single cells. The measurement fluorescence intensity conveying the abundance 2http://arxiv.org/abs/1402.6964. 3The heat transfer simulation data is available at https://www.opensciencedatacloud.org. 4The FC data is available at https://github.com/arbenson/mrnmf/tree/master/data. 6 Figure 1: (Left) Relative error in the separable factorization as a function of separation rank (r) for the heat transfer simulation data. Our dimension reduction technique lets us test all values of r quickly. (Middle) The first 10 extreme columns selected by SPA, XRAY, and GP. We choose 10 columns as there is an “elbow” in the GP curve there (left plot). The columns with larger indices are more extreme, but the algorithms still select different columns. (Right) Values of H(K−1(1), j) and H(K−1(34), j) computed by SPA for j = 2, . . . , 33, where K−1(1) and K−1(34) are the indices of the extreme columns 1 and 34 in W (X = WH). Columns 2 through 33 of X are roughly convex combinations of columns 1 and 34, and are not selected as extreme columns by SPA. As j increases, H(K−1(1), j) decreases and H(K−1(34), j) increases. Figure 2: Coefficient matrix H for SPA, XRAY, and GP for the heat transfer simulation data when r = 10. In all cases, the non-extreme columns are conic combinations of two of the selected columns, i.e., each column in H has at most two non-zero values. Specifically, the non-extreme columns are conic combinations of the two extreme columns that “sandwich” them in the matrix. See the right plot of Figure 1 for a closer look at the coefficients. information were collected at five different bands corresponding to the FITC, PE, ECD, PC5, and PC7 fluorescent labels tagging antibodies against CD4, CD8, CD19, CD45, and CD3 epitopes. The measurements are represented as the data matrix A of size 40, 000 × 5. Our interest in the presented analysis was to study pairwise interactions in the data (cell vs. cell, and marker vs. marker). Thus, we are interested in the matrix X = A ⊗A, the Kronecker product of A with itself. Each row of X corresponds to a pair of cells and each column to a pair of marker abundance values. X has dimension 40, 0002 × 52 and occupies 345 GB on HDFS. The left plot of Figure 3 shows the residuals for the three algorithms applied to the FC data for varying values of the separation rank. In contrast to the heat transfer simulation data, the relative errors are quite large for small r. In fact, SPA has large relative error until nearly all columns are selected (r = 22). XRAY has the smallest residual for any value of r. The right plot of Figure 3 shows the columns selected when r = 16. XRAY and GP only disagree on one column. SPA chooses different columns, which is not surprising given the relative residual error. Interestingly, the columns involving the second marker defining the phenotype (columns 2, 6, 7, 8, 9, 10, 12, 17, 22) are underrepresented in all the choices. This suggests that the information provided by the second marker may be redundant. In biological terms, it may indicate that the phenotypes of the individual cells can be inferred from a smaller number of markers. Consequently, this opens a possibility that in modified experimental conditions, the FC researchers may omit this particular label, and still be able to recover the complete phenotypic information. Owing to the preliminary nature of these studies, a more in-depth analysis involving multiple similar blood samples would be desirable in order to confirm this hypothesis. 7 Figure 3: (Left) Relative error in the separable factorization as a function of nonnegative rank (r) for the flow cytometry data. (Right) The first 16 extreme columns selected by SPA, XRAY, and GP. We choose 16 columns since the XRAY and GP curve levels for larger r (left plot). Figure 4: Coefficient matrix H for SPA, XRAY, and GP for the flow cytometry data when r = 16. The coefficients tend to be clustered near the diagonal. This is remarkably different to the coefficients for the heat transfer simulation data in Figure 2. Finally, Figure 4 shows the coefficient matrix H. The coefficients are larger on the diagonal, which means that the non-extreme columns are composed of nearby extreme columns in the matrix. 5 Discussion We have shown how to compute nonnegative matrix factorizations at scale for near-separable talland-skinny matrices. Our main tool was TSQR, and our algorithms only needed to read the data matrix once. By reducing the dimension of the problem, we can easily compute the efficacy of factorizations for several values of the separation rank r. With these tools, we have computed the largest separable nonnegative matrix factorizations to date. Furthermore, our algorithms provide new insights into massive scientific data sets. The coefficient matrix H exposed structure in the results of heat transfer simulations. Extreme column selection in flow cytometry showed that one of the labels used in measurements may be redundant. In future work, we would like to analyze additional large-scale scientific data sets. We also plan to test additional NMF algorithms. The practical limits of our algorithm are imposed by the tall-and-skinny requirement where we assume that it is easy to manipulate n × n matrices. The synthetic examples we explored used up to 200 columns, and regimes up to 5000 columns have been explored in prior work [11]. A rough rule of thumb is that our implementations should be possible as long as an n × n matrix fits into main memory. This means that implementations based on our work will scale up to 30, 000 columns on machines with more than 8 GB of memory; although at this point communication begins to dominate. Solving these problems with more columns is a challenging opportunity for the future. Acknowledgments ARB and JDL are supported by an Office of Technology Licensing Stanford Graduate Fellowship. JDL is also supported by a NSF Graduate Research Fellowship. DFG is supported by NSF CAREER award CCF-1149756. BR is supported by NIH grant 1R21EB015707-01. 8 References [1] M. Anderson, G. Ballard, J. Demmel, and K. Keutzer. Communication-avoiding QR decomposition for GPUs. In IPDPS, pages 48–58, 2011. [2] M. Ara´ujo et al. The successive projections algorithm for variable selection in spectroscopic multicomponent analysis. Chemometrics and Intelligent Laboratory Systems, 57(2):65–73, 2001. [3] S. Arora, R. Ge, R. Kannan, and A. Moitra. Computing a nonnegative matrix factorization–provably. In Proceedings of the 44th symposium on Theory of Computing, pages 145–162. ACM, 2012. [4] A. R. Benson, D. F. Gleich, and J. Demmel. Direct QR factorizations for tall-and-skinny matrices in MapReduce architectures. In 2013 IEEE International Conference on Big Data, pages 264–272, 2013. [5] J. M. Bioucas-Dias and A. Plaza. An overview on hyperspectral unmixing: geometrical, statistical, and sparse regression based approaches. In IGARSS, pages 1135–1138, 2011. [6] V. Bittorf, B. Recht, C. Re, and J. A. Tropp. Factoring nonnegative matrices with linear programs. In NIPS, pages 1223–1231, 2012. [7] J. W. Boardman et al. Automating spectral unmixing of aviris data using convex geometry concepts. In 4th Annu. JPL Airborne Geoscience Workshop, volume 1, pages 11–14. JPL Publication 93–26, 1993. [8] T. F. Chan. An improved algorithm for computing the singular value decomposition. ACM Trans. Math. Softw., 8(1):72–83, Mar. 1982. [9] M. T. Chu and M. M. Lin. Low-dimensional polytope approximation and its applications to nonnegative matrix factorization. SIAM Journal on Scientific Computing, 30(3):1131–1155, 2008. [10] A. Cichocki and R. Zdunek. Regularized alternating least squares algorithms for non-negative matrix/tensor factorization. In Advances in Neural Networks–ISNN 2007, pages 793–802. Springer, 2007. [11] P. G. Constantine and D. F. Gleich. Tall and skinny QR factorizations in MapReduce architectures. In Second international workshop on MapReduce and its applications, pages 43–50. ACM, 2011. [12] P. G. Constantine, D. F. Gleich, Y. Hou, and J. Templeton. Model reduction with MapReduce-enabled tall and skinny singular value decomposition. SIAM J. Sci. Comput., Accepted:To appear, 2014. [13] A. Damle and Y. Sun. Random projections for non-negative matrix factorization. arXiv:1405.4275, 2014. [14] J. Demmel, L. Grigori, M. Hoemmen, and J. Langou. Communication-optimal parallel and sequential QR and LU factorizations. SIAM J. Sci. Comp., 34, Feb. 2012. [15] D. Donoho and V. Stodden. When does non-negative matrix factorization give a correct decomposition into parts? In NIPS, 2003. [16] N. Gillis and S. Vavasis. Fast and robust recursive algorithms for separable nonnegative matrix factorization. Pattern Analysis and Machine Intelligence, IEEE Transactions on, PP(99):1–1, 2013. [17] D. Guillamet and J. Vitri`a. Non-negative matrix factorization for face recognition. In Topics in Artificial Intelligence, pages 336–344. Springer, 2002. [18] S. Jia and Y. Qian. Constrained nonnegative matrix factorization for hyperspectral unmixing. Geoscience and Remote Sensing, IEEE Transactions on, 47(1):161–173, 2009. [19] D. Kim, S. Sra, and I. S. Dhillon. Fast projection-based methods for the least squares nonnegative matrix approximation problem. Statistical Analysis and Data Mining, 1(1):38–51, 2008. [20] W. Kim, B. Chen, J. Kim, Y. Pan, and H. Park. Sparse nonnegative matrix factorization for protein sequence motif discovery. Expert Systems with Applications, 38(10):13198–13207, 2011. [21] D. Kuang, H. Park, and C. H. Ding. Symmetric nonnegative matrix factorization for graph clustering. In SDM, volume 12, pages 106–117, 2012. [22] A. Kumar, V. Sindhwani, and P. Kambadur. Fast conical hull algorithms for near-separable non-negative matrix factorization. In ICML, 2013. [23] D. D. Lee and H. S. Seung. Algorithms for non-negative matrix factorization. In NIPS, 2000. [24] C. Liu, H.-C. Yang, J. Fan, L.-W. He, and Y.-M. Wang. Distributed nonnegative matrix factorization for web-scale dyadic data analysis on mapreduce. In WWW, pages 681–690. ACM, 2010. [25] C. Thurau, K. Kersting, and C. Bauckhage. Yes we can: simplex volume maximization for descriptive web-scale matrix factorization. In CIKM, pages 1785–1788. ACM, 2010. [26] S. Vavasis. On the complexity of nonnegative matrix factorization. SIAM Journal on Optimization, 20(3):1364–1377, 2010. 9
2014
352
5,461
Rates of convergence for nearest neighbor classification Kamalika Chaudhuri Computer Science and Engineering University of California, San Diego kamalika@cs.ucsd.edu Sanjoy Dasgupta Computer Science and Engineering University of California, San Diego dasgupta@cs.ucsd.edu Abstract We analyze the behavior of nearest neighbor classification in metric spaces and provide finite-sample, distribution-dependent rates of convergence under minimal assumptions. These are more general than existing bounds, and enable us, as a by-product, to establish the universal consistency of nearest neighbor in a broader range of data spaces than was previously known. We illustrate our upper and lower bounds by introducing a new smoothness class customized for nearest neighbor classification. We find, for instance, that under the Tsybakov margin condition the convergence rate of nearest neighbor matches recently established lower bounds for nonparametric classification. 1 Introduction In this paper, we deal with binary prediction in metric spaces. A classification problem is defined by a metric space (X, ρ) from which instances are drawn, a space of possible labels Y = {0, 1}, and a distribution P over X × Y. The goal is to find a function h : X →Y that minimizes the probability of error on pairs (X, Y ) drawn from P; this error rate is the risk R(h) = P(h(X) ̸= Y ). The best such function is easy to specify: if we let µ denote the marginal distribution of X and η the conditional probability η(x) = P(Y = 1|X = x), then the predictor 1(η(x) ≥1/2) achieves the minimum possible risk, R∗= EX[min(η(X), 1 −η(X))]. The trouble is that P is unknown and thus a prediction rule must instead be based only on a finite sample of points (X1, Y1), . . . , (Xn, Yn) drawn independently at random from P. Nearest neighbor (NN) classifiers are among the simplest prediction rules. The 1-NN classifier assigns each point x ∈X the label Yi of the closest point in X1, . . . , Xn (breaking ties arbitrarily, say). For a positive integer k, the k-NN classifier assigns x the majority label of the k closest points in X1, . . . , Xn. In the latter case, it is common to let k grow with n, in which case the sequence (kn : n ≥1) defines a kn-NN classifier. The asymptotic consistency of nearest neighbor classification has been studied in detail, starting with the work of Fix and Hodges [7]. The risk of the NN classifier, henceforth denoted Rn, is a random variable that depends on the data set (X1, Y1), . . . , (Xn, Yn); the usual order of business is to first determine the limiting behavior of the expected value ERn and to then study stronger modes of convergence of Rn. Cover and Hart [2] studied the asymptotics of ERn in general metric spaces, under the assumption that every x in the support of µ is either a continuity point of η or has µ({x}) > 0. For the 1-NN classifier, they found that ERn →EX[2η(X)(1 −η(X))] ≤2R∗(1 −R∗); for kn-NN with kn ↑∞and kn/n ↓0, they found ERn →R∗. For points in Euclidean space, a series of results starting with Stone [15] established consistency without any distributional assumptions. For kn-NN in particular, Rn →R∗almost surely [5]. These consistency results place nearest neighbor methods in a favored category of nonparametric estimators. But for a fuller understanding it is important to also have rates of convergence. For 1 instance, part of the beauty of nearest neighbor is that it appears to adapt automatically to different distance scales in different regions of space. It would be helpful to have bounds that encapsulate this property. Rates of convergence are also important in extending nearest neighbor classification to settings such as active learning, semisupervised learning, and domain adaptation, in which the training data is not a fully-labeled data set obtained by i.i.d. sampling from the future test distribution. For instance, in active learning, the starting point is a set of unlabeled points X1, . . . , Xn, and the learner requests the labels of just a few of these, chosen adaptively to be as informative as possible about η. There are many natural schemes for deciding which points to label: for instance, one could repeatedly pick the point furthest away from the labeled points so far, or one could pick the point whose k nearest labeled neighbors have the largest disagreement among their labels. The asymptotics of such selective sampling schemes have been considered in earlier work [4], but ultimately the choice of scheme must depend upon finite-sample behavior. The starting point for understanding this behavior is to first obtain a characterization in the non-active setting. 1.1 Previous work on rates of convergence There is a large body of work on convergence rates of nearest neighbor estimators. Here we outline some of the types of results that have been obtained, and give representative sources for each. The earliest rates of convergence for nearest neighbor were distribution-free. Cover [3] studied the 1NN classifier in the case X = R, under the assumption of class-conditional densities with uniformlybounded third derivatives. He showed that ERn converges at a rate of O(1/n2). Wagner [18] and later Fritz [8] also looked at 1-NN, but in higher dimension X = Rd. The latter obtained an asymptotic rate of convergence for Rn under the milder assumption of non-atomic µ and lower semi-continuous class-conditional densities. Distribution-free results are valuable, but do not characterize which properties of a distribution most influence the performance of nearest neighbor classification. More recent work has investigated different approaches to obtaining distribution-dependent bounds, in terms of the smoothness of the distribution. A simple and popular smoothness parameter is the Holder constant. Kulkarni and Posner [12] obtained a fairly general result of this kind for 1-NN and kn-NN. They assumed that for some constants K and α, and for all x1, x2 ∈X, |η(x1) −η(x2)| ≤Kρ(x1, x2)2α. They then gave bounds in terms of the Holder parameter α as well as covering numbers for the marginal distribution µ. Gyorfi[9] looked at the case X = Rd, under the weaker assumption that for some function K : Rd →R and some α, and for all z ∈Rd and all r > 0, η(z) − 1 µ(B(z, r)) Z B(z,r) η(x)µ(dx) ≤K(z)rα. The integral denotes the average η value in a ball of radius r centered at z; hence, this α is similar in spirit to the earlier Holder parameter, but does not require η to be continuous. Gyorfiobtained asymptotic rates in terms of α. Another generalization of standard smoothness conditions was proposed recently [17] in a “probabilistic Lipschitz” assumption, and in this setting rates were obtained for NN classification in bounded spaces X ⊂Rd. The literature leaves open several basic questions that have motivated the present paper. (1) Is it possible to give tight finite-sample bounds for NN classification in metric spaces, without any smoothness assumptions? What aspects of the distribution must be captured in such bounds? (2) Are there simple notions of smoothness that are especially well-suited to nearest neighbor? Roughly speaking, we consider a notion suitable if it is possible to sharply characterize the convergence rate of nearest neighbor for all distributions satisfying this notion. As we discuss further below, the Holder constant is lacking in this regard. (3) A recent trend in nonparametric classification has been to study rates of convergence under “margin conditions” such as that of Tsybakov. The best achievable rates under these conditions are now known: does nearest neighbor achieve these rates? 2 Class 0 Class 1 Class 0 Class 1 Figure 1: One-dimensional distributions. In each case, the class-conditional densities are shown. 1.2 Some illustrative examples We now look at a couple of examples to get a sense of what properties of a distribution most critically affect the convergence rate of nearest neighbor. In each case, we study the k-NN classifier. To start with, consider a distribution over X = R in which the two classes (Y = 0, 1) have classconditional densities µ0 and µ1. Assume that these two distributions have disjoint support, as on the left side of Figure 1. The k-NN classifier will make a mistake on a specific query x only if x is near the boundary between the two classes. To be precise, consider an interval around x of probability mass k/n, that is, an interval B = [x−r, x+r] with µ(B) = k/n. Then the k nearest neighbors will lie roughly in this interval, and there will likely be an error only if the interval contains a substantial portion of the wrong class. Whether or not η is smooth, or the µi are smooth, is irrelevant. In a general metric space, the k nearest neighbors of any query point x are likely to lie in a ball centered at x of probability mass roughly k/n. Thus the central objects in analyzing k-NN are balls of mass ≈k/n near the decision boundary, and it should be possible to give rates of convergence solely in terms of these. Now let’s turn to notions of smoothness. Figure 1, right, shows a variant of the previous example in which it is no longer the case that η ∈{0, 1}. Although one of the class-conditional densities in the figure is highly non-smooth, this erratic behavior occurs far from the decision boundary and thus does not affect nearest neighbor performance. And in the vicinity of the boundary, what matters is not how much η varies within intervals of any given radius r, but rather within intervals of probability mass k/n. Smoothness notions such as Lipschitz and Holder constants, which measure changes in η with respect to x, are therefore not entirely suitable: what we need to measure are changes in η with respect to the underlying marginal µ on X. 1.3 Results of this paper Let us return to our earlier setting of pairs (X, Y ), where X takes values in a metric space (X, ρ) and has distribution µ, while Y ∈{0, 1} has conditional probability function η(x) = Pr(Y = 1|X = x). We obtain rates of convergence for k-NN by attempting to make precise the intuitions discussed above. This leads to a somewhat different style of analysis than has been used in earlier work. Our main result is an upper bound on the misclassification rate of k-NN that holds for any sample size n and for any metric space, with no distributional assumptions. The bound depends on a novel notion of the effective boundary for k-NN: for the moment, denote this set by An,k ⊂X. • We show that with high probability over the training data, the misclassification rate of the k-NN classifier (with respect to the Bayes-optimal classifer) is bounded above by µ(An,k) plus a small additional term that can be made arbitrarily small (Theorem 5). • We lower-bound the misclassification rate using a related notion of effective boundary (Theorem 6). • We identify a general condition under which, as n and k grow, An,k approaches the actual decision boundary {x | η(x) = 1/2}. This yields universal consistency in a wider range of metric spaces than just Rd (Theorem 1), thus broadening our understanding of the asymptotics of nearest neighbor. 3 We then specialize our generalization bounds to smooth distributions. • We introduce a novel smoothness condition that is tailored to nearest neighbor. We compare our upper and lower bounds under this kind of smoothness (Theorem 3). • We obtain risk bounds under the margin condition of Tsybakov that match the best known results for nonparametric classification (Theorem 4). • We look at additional specific cases of interest: when η is bounded away from 1/2, and the even more extreme scenario where η ∈{0, 1} (zero Bayes risk). 2 Definitions and results Let (X, ρ) be any separable metric space. For any x ∈X, let Bo(x, r) = {x′ ∈X | ρ(x, x′) < r} and B(x, r) = {x′ ∈X | ρ(x, x′) ≤r} denote the open and closed balls, respectively, of radius r centered at x. Let µ be a Borel regular probability measure on this space (that is, open sets are measurable, and every set is contained in a Borel set of the same measure) from which instances X are drawn. The label of an instance X = x is Y ∈{0, 1} and is distributed according to the measurable conditional probability function η : X →[0, 1] as follows: Pr(Y = 1|X = x) = η(x). Given a data set S = ((X1, Y1), . . . , (Xn, Yn)) and a query point x ∈X, we use the notation X(i)(x) to denote the i-th nearest neighbor of x in the data set, and Y (i)(x) to denote its label. Distances are calculated with respect to the given metric ρ, and ties are broken by preferring points earlier in the sequence. The k-NN classifier is defined by gn,k(x) =  1 if Y (1)(x) + · · · + Y (k)(x) ≥k/2 0 otherwise We analyze the performance of gn,k by comparing it with g(x) = 1(η(x) ≥1/2), the omniscient Bayes-optimal classifier. Specifically, we obtain bounds on PrX(gn,k(X) ̸= g(X)) that hold with high probability over the choice of data S, for any n. It is worth noting that convergence results for nearest neighbor have traditionally studied the excess risk Rn,k −R∗, where Rn,k = Pr(Y ̸= gn,k(X)). If we define the pointwise quantities Rn,k(x) = Pr(Y ̸= gn,k(x)|X = x) R∗(x) = min(η(x), 1 −η(x)), for all x ∈X, we see that Rn,k(x) −R∗(x) = |1 −2η(x)|1(gn,k(x) ̸= g(x)). (1) Taking expectation over X, we then have Rn,k −R∗≤PrX(gn,k(X) ̸= g(X)), and so we also obtain upper bounds on the excess risk. The technical core of this paper is the finite-sample generalization bound of Theorem 5. We begin, however, by discussing some of its implications since these relate directly to common lines of inquiry in the statistical literature. All proofs appear in the appendix. 2.1 Universal consistency A series of results, starting with [15], has shown that kn-NN is strongly consistent (Rn = Rn,kn → R∗almost surely) when X is a finite-dimensional Euclidean space and µ is a Borel measure. A consequence of the bounds we obtain in Theorem 5 is that this phenomenon holds quite a bit more generally. In fact, strong consistency holds in any metric measure space (X, ρ, µ) for which the Lebesgue differentiation theorem is true: that is, spaces in which, for any bounded measurable f, lim r↓0 1 µ(B(x, r)) Z B(x,r) f dµ = f(x) (2) for almost all (µ-a.e.) x ∈X. For more details on this differentiation property, see [6, 2.9.8] and [10, 1.13]. It holds, for instance: 4 • When (X, ρ) is a finite-dimensional normed space [10, 1.15(a)]. • When (X, ρ, µ) is doubling [10, 1.8], that is, when there exists a constant C(µ) such that µ(B(x, 2r)) ≤C(µ)µ(B(x, r)) for every ball B(x, r). • When µ is an atomic measure on X. For the following theorem, recall that the risk of the kn-NN classifier, Rn = Rn,kn, is a function of the data set (X1, Y1), . . . , (Xn, Yn). Theorem 1. Suppose metric measure space (X, ρ, µ) satisfies differentiation condition (2). Pick a sequence of positive integers (kn), and for each n, let Rn = Rn,kn be the risk of the kn-NN classifier gn,kn. 1. If kn →∞and kn/n →0, then for all ϵ > 0, lim n→∞Prn(Rn −R∗> ϵ) = 0. Here Prn denotes probability over the data set (X1, Y1), . . . , (Xn, Yn). 2. If in addition kn/(log n) →∞, then Rn →R∗almost surely. 2.2 Smooth measures Before stating our finite-sample bounds in full generality, we provide a glimpse of them under smooth probability distributions. We begin with a few definitions. The support of µ. The support of distribution µ is defined as supp(µ) = {x ∈X | µ(B(x, r)) > 0 for all r > 0}. It was shown by [2] that in separable metric spaces, µ(supp(µ)) = 1. For the interested reader, we reproduce their brief proof in the appendix (Lemma 24). The conditional probability function for a set. The conditional probability function η is defined for points x ∈X, and can be extended to measurable sets A ⊂X with µ(A) > 0 as follows: η(A) = 1 µ(A) Z A η dµ. (3) This is the probability that Y = 1 for a point X chosen at random from the distribution µ restricted to set A. We exclusively consider sets A of the form B(x, r), in which case η is defined whenever x ∈supp(µ). 2.2.1 Smoothness with respect to the marginal distribution For the purposes of nearest neighbor, it makes sense to define a notion of smoothness with respect to the marginal distribution on instances. For α, L > 0, we say the conditional probability function η is (α, L)-smooth in metric measure space (X, ρ, µ) if for all x ∈supp(µ) and all r > 0, |η(B(x, r)) −η(x)| ≤L µ(Bo(x, r))α. (As might be expected, we only need to apply this condition locally, so it is enough to restrict attention to balls of probability mass upto some constant po.) One feature of this notion is that it is scale-invariant: multiplying all distances by a fixed amount leaves α and L unchanged. Likewise, if the distribution has several well-separated clusters, smoothness is unaffected by the distance-scales of the individual clusters. It is common to analyze nonparametric classifiers under the assumption that X = Rd and that η is αH-Holder continuous for some α > 0, that is, |η(x) −η(x′)| ≤L∥x −x′∥αH for some constant L. These bounds typically also require µ to have a density that is uniformly bounded (above and/or below). We now relate these standard assumptions to our notion of smoothness. 5 Lemma 2. Suppose that X ⊂Rd, and η is αH-Holder continuous, and µ has a density with respect to Lebesgue measure that is ≥µmin on X. Then there is a constant L such that for any x ∈supp(µ) and r > 0 with B(x, r) ⊂X, we have |η(x) −η(B(x, r))| ≤Lµ(Bo(x, r))αH/d. (To remove the requirement that B(x, r) ⊂X, we would need the boundary of X to be wellbehaved, for instance by requiring that X contains a constant fraction of every ball centered in it. This is a familiar assumption in nonparametric classification, including the seminal work of [1] that we discuss shortly.) Our smoothness condition for nearest neighbor problems can thus be seen as a generalization of the usual Holder conditions. It applies in broader range of settings, for example for discrete µ. 2.2.2 Generalization bounds for smooth measures Under smoothness, our general finite-sample convergence rates (Theorems 5 and 6) take on an easily interpretable form. Recall that gn,k(x) is the k-NN classifier, while g(x) is the Bayes-optimal prediction. Theorem 3. Suppose η is (α, L)-smooth in (X, ρ, µ). The following hold for any n and k. (Upper bound on misclassification rate.) Pick any δ > 0 and suppose that k ≥16 ln(2/δ). Then Pr X (gn,k(X) ̸= g(X)) ≤δ + µ  x ∈X η(x) −1 2 ≤ r 1 k ln 2 δ + L  k 2n α ! . (Lower bound on misclassification rate.) Conversely, there is an absolute constant co such that En Pr X (gn,k(X) ̸= g(X)) ≥coµ  x ∈X η(x) ̸= 1 2, |η(x) −1 2| ≤ 1 √ k −L 2k n α  . Here En is expectation over the data set. The optimal choice of k is ∼n2α/(2α+1), and with this setting the upper and lower bounds are directly comparable: they are both of the form µ({x : |η(x) −1/2| ≤˜O(k−1/2)}), the probability mass of a band of points around the decision boundary η = 1/2. It is noteworthy that these upper and lower bounds have a pleasing resemblance for every distribution in the smoothness class. This is in contrast to the usual minimax style of analysis, in which a bound on an estimator’s risk is described as “optimal” for a class of distributions if there exists even a single distribution in that class for which it is tight. 2.2.3 Margin bounds An achievement of statistical theory in the past two decades has been margin bounds, which give fast rates of convergence for many classifiers when the underlying data distribution P (given by µ and η) satisfies a large margin condition stipulating, roughly, that η moves gracefully away from 1/2 near the decision boundary. Following [13, 16, 1], for any β ≥0, we say P satisfies the β-margin condition if there exists a constant C > 0 such that µ  x η(x) −1 2 ≤t  ≤Ctβ. Larger β implies a larger margin. We now obtain bounds for the misclassification rate and the excess risk of k-NN under smoothness and margin conditions. Theorem 4. Suppose η is (α, L)-smooth in (X, ρ, µ) and satisfies the β-margin condition (with constant C), for some α, β, L, C ≥0. In each of the two following statements, ko and Co are constants depending on α, β, L, C. (a) For any 0 < δ < 1, set k = kon2α/(2α+1)(log(1/δ))1/(2α+1). With probability at least 1 −δ over the choice of training data, PrX(gn,k(X) ̸= g(X)) ≤δ + Co log(1/δ) n αβ/(2α+1) . 6 (b) Set k = kon2α/(2α+1). Then EnRn,k −R∗≤Con−α(β+1)/(2α+1). It is instructive to compare these bounds with the best known rates for nonparametric classification under the margin assumption. The work of Audibert and Tsybakov [1] (Theorems 3.3 and 3.5) shows that when (X, ρ) = (Rd, ∥· ∥), and η is αH-Holder continuous, and µ lies in the range [µmin, µmax] for some µmax > µmin > 0, and the β-margin condition holds (along with some other assumptions), an excess risk of n−αH(β+1)/(2αH+d) is achievable and is also the best possible. This is exactly the rate we obtain for nearest neighbor classification, once we translate between the different notions of smoothness as per Lemma 2. We discuss other interesting scenarios in Section C.4 in the appendix. 2.3 A general upper bound on the misclassification error We now get to our most general finite-sample bound. It requires no assumptions beyond the basic measurability conditions stated at the beginning of Section 2, and it is the basis of the all the results described so far. We begin with some key definitions. The radius and probability-radius of a ball. When dealing with balls, we will primarily be interested in their probability mass. To this end, for any x ∈X and any 0 ≤p ≤1, define rp(x) = inf{r | µ(B(x, r)) ≥p}. Thus µ(B(x, rp(x))) ≥p (Lemma 23), and rp(x) is the smallest radius for which this holds. The effective interiors of the two classes, and the effective boundary. When asked to make a prediction at point x, the k-NN classifier finds the k nearest neighbors, which can be expected to lie in B(x, rp(x)) for p ≈k/n. It then takes an average over these k labels, which has a standard deviation of ∆≈1/ √ k. With this in mind, there is a natural definition for the effective interior of the Y = 1 region: the points x with η(x) > 1/2 on which the k-NN classifier is likely to be correct: X + p,∆= {x ∈supp(µ) | η(x) > 1 2, η(B(x, r)) ≥1 2 + ∆for all r ≤rp(x)}. The corresponding definition for the Y = 0 region is X − p,∆= {x ∈supp(µ) | η(x) < 1 2, η(B(x, r)) ≤1 2 −∆for all r ≤rp(x)}. The remainder of X is the effective boundary, ∂p,∆= X \ (X + p,∆∪X − p,∆). Observe that ∂p′,∆′ ⊂∂p,∆whenever p′ ≤p and ∆′ ≤∆. Under mild conditions, as p and ∆tend to zero, the effective boundary tends to the actual decision boundary {x | η(x) = 1/2} (Lemma 14), which we shall denote ∂o. The misclassification rate of the k-NN classifier can be bounded by the probability mass of the effective boundary: Theorem 5. Pick any 0 < δ < 1 and positive integers k < n. Let gn,k denote the k-NN classifier based on n training points, and g(x) the Bayes-optimal classifier. With probability at least 1 −δ over the choice of training data, PrX(gn,k(X) ̸= g(X)) ≤δ + µ ∂p,∆  , where p = k n · 1 1 − p (4/k) ln(2/δ) , and ∆= min 1 2, r 1 k ln 2 δ ! . 7 2.4 A general lower bound on the misclassification error Finally, we give a counterpart to Theorem 5 that lower-bounds the expected probability of error of gn,k. For any positive integers k < n, we identify a region close to the decision boundary in which a k-NN classifier has a constant probability of making a mistake. This high-error set is En,k = E+ n,k ∪E− n,k, where E+ n,k =  x ∈supp(µ) | η(x) > 1 2, η(B(x, r)) ≤1 2 + 1 √ k for all rk/n(x) ≤r ≤r(k+ √ k+1)/n(x)  E− n,k =  x ∈supp(µ) | η(x) < 1 2, η(B(x, r)) ≥1 2 −1 √ k for all rk/n(x) ≤r ≤r(k+ √ k+1)/n(x)  . (Recall the definition (3) of η(A) for sets A.) For smooth η this region turns out to be comparable to the effective decision boundary ∂k/n,1/ √ k. Meanwhile, here is a lower bound that applies to any (X, ρ, µ). Theorem 6. For any positive integers k < n, let gn,k denote the k-NN classifier based on n training points. There is an absolute constant co such that the expected misclassification rate satisfies EnPrX(gn,k(X) ̸= g(X)) ≥co µ(En,k), where En is expectation over the choice of training set. Acknowledgements The authors are grateful to the National Science Foundation for support under grant IIS-1162581. 8 References [1] J.-Y. Audibert and A.B. Tsybakov. Fast learning rates for plug-in classifiers. Annals of Statistics, 35(2):608–633, 2007. [2] T. Cover and P.E. Hart. Nearest neighbor pattern classification. IEEE Transactions on Information Theory, 13:21–27, 1967. [3] T.M. Cover. Rates of convergence for nearest neighbor procedures. In Proceedings of The Hawaii International Conference on System Sciences, 1968. [4] S. Dasgupta. Consistency of nearest neighbor classification under selective sampling. In Twenty-Fifth Conference on Learning Theory, 2012. [5] L. Devroye, L. Gyorfi, A. Krzyzak, and G. Lugosi. On the strong universal consistency of nearest neighbor regression function estimates. Annals of Statistics, 22:1371–1385, 1994. [6] H. Federer. Geometric Measure Theory. Springer, 1969. [7] E. Fix and J. Hodges. Discriminatory analysis, nonparametric discrimination. USAF School of Aviation Medicine, Randolph Field, Texas, Project 21-49-004, Report 4, Contract AD41(128)31, 1951. [8] J. Fritz. Distribution-free exponential error bound for nearest neighbor pattern classification. IEEE Transactions on Information Theory, 21(5):552–557, 1975. [9] L. Gyorfi. The rate of convergence of kn-nn regression estimates and classification rules. IEEE Transactions on Information Theory, 27(3):362–364, 1981. [10] J. Heinonen. Lectures on Analysis on Metric Spaces. Springer, 2001. [11] R. Kaas and J.M. Buhrman. Mean, median and mode in binomial distributions. Statistica Neerlandica, 34(1):13–18, 1980. [12] S. Kulkarni and S. Posner. Rates of convergence of nearest neighbor estimation under arbitrary sampling. IEEE Transactions on Information Theory, 41(4):1028–1039, 1995. [13] E. Mammen and A.B. Tsybakov. Smooth discrimination analysis. The Annals of Statistics, 27(6):1808–1829, 1999. [14] E. Slud. Distribution inequalities for the binomial law. Annals of Probability, 5:404–412, 1977. [15] C. Stone. Consistent nonparametric regression. Annals of Statistics, 5:595–645, 1977. [16] A.B. Tsybakov. Optimal aggregation of classifiers in statistical learning. The Annals of Statistics, 32(1):135–166, 2004. [17] R. Urner, S. Ben-David, and S. Shalev-Shwartz. Access to unlabeled data can speed up prediction time. In International Conference on Machine Learning, 2011. [18] T.J. Wagner. Convergence of the nearest neighbor rule. IEEE Transactions on Information Theory, 17(5):566–571, 1971. 9
2014
353
5,462
Inferring synaptic conductances from spike trains under a biophysically inspired point process model Kenneth W. Latimer The Institute for Neuroscience The University of Texas at Austin latimerk@utexas.edu E. J. Chichilnisky Department of Neurosurgery Hansen Experimental Physics Laboratory Stanford University ej@stanford.edu Fred Rieke Department of Physiology and Biophysics Howard Hughes Medical Institute University of Washington rieke@u.washington.edu Jonathan W. Pillow Princeton Neuroscience Institute Department of Psychology Princeton University pillow@princeton.edu Abstract A popular approach to neural characterization describes neural responses in terms of a cascade of linear and nonlinear stages: a linear filter to describe stimulus integration, followed by a nonlinear function to convert the filter output to spike rate. However, real neurons respond to stimuli in a manner that depends on the nonlinear integration of excitatory and inhibitory synaptic inputs. Here we introduce a biophysically inspired point process model that explicitly incorporates stimulus-induced changes in synaptic conductance in a dynamical model of neuronal membrane potential. Our work makes two important contributions. First, on a theoretical level, it offers a novel interpretation of the popular generalized linear model (GLM) for neural spike trains. We show that the classic GLM is a special case of our conductance-based model in which the stimulus linearly modulates excitatory and inhibitory conductances in an equal and opposite “push-pull” fashion. Our model can therefore be viewed as a direct extension of the GLM in which we relax these constraints; the resulting model can exhibit shunting as well as hyperpolarizing inhibition, and time-varying changes in both gain and membrane time constant. Second, on a practical level, we show that our model provides a tractable model of spike responses in early sensory neurons that is both more accurate and more interpretable than the GLM. Most importantly, we show that we can accurately infer intracellular synaptic conductances from extracellularly recorded spike trains. We validate these estimates using direct intracellular measurements of excitatory and inhibitory conductances in parasol retinal ganglion cells. The stimulus-dependence of both excitatory and inhibitory conductances can be well described by a linear-nonlinear cascade, with the filter driving inhibition exhibiting opposite sign and a slight delay relative to the filter driving excitation. We show that the model fit to extracellular spike trains can predict excitatory and inhibitory conductances elicited by novel stimuli with nearly the same accuracy as a model trained directly with intracellular conductances. 1 Introduction The point process generalized linear model (GLM) has provided a useful and highly tractable tool for characterizing neural encoding in a variety of sensory, cognitive, and motor brain areas [1–5]. 1 stimulus spikes nonlinearity inhibitory filter excitatory filter Poisson post-spike filter Figure 1: Schematic of conductance-based spiking model. However, there is a substantial gap between descriptive statistical models like the GLM and more realistic, biophysically interpretable neural models. Cascade-type statistical models describe input to a neuron in terms of a set of linear (and sometimes nonlinear) filtering steps [6–11]. Real neurons, on the other hand, receive distinct excitatory and inhibitory synaptic inputs, which drive conductance changes that alter the nonlinear dynamics governing membrane potential. Previous work has shown that excitatory and inhibitory conductances in retina and other sensory areas can exhibit substantially different tuning. [12, 13]. Here we introduce a quasi-biophysical interpretation of the generalized linear model. The resulting interpretation reveals that the GLM can be viewed in terms of a highly constrained conductancebased model. We expand on this interpretation to construct a more flexible and more plausible conductance-based spiking model (CBSM), which allows for independent excitatory and inhibitory synaptic inputs. We show that the CBSM captures neural responses more accurately than the standard GLM, and allows us to accurately infer excitatory and inhibitory synaptic conductances from stimuli and extracellularly recorded spike trains. 2 A biophysical interpretation of the GLM The generalized linear model (GLM) describes neural encoding in terms of a cascade of linear, nonlinear, and probabilistic spiking stages. A quasi-biological interpretation of GLM is known as “soft threshold” integrate-and-fire [14–17]. This interpretation regards the linear filter output as a membrane potential, and the nonlinear stage as a “soft threshold” function that governs how the probability of spiking increases with membrane potential, specifically: Vt = k⊤xt (1) rt = f(Vt) (2) yt|rt ∼ Poiss(rt∆t), (3) where k is a linear filter mapping the stimulus xt to the membrane potential Vt at time t, a fixed nonlinear function f maps Vt to the conditional intensity (or spike rate) rt, and spike count yt is a Poisson random variable in a time bin of infinitesimal width ∆t. The log likelihood is log p(y1:T |x1:T , k) = T X t=1 −rt∆t + yt log(rt∆t) −log(yt!). (4) The stimulus vector xt can be augmented to include arbitrary covariates of the response such as the neuron’s own spike history or spikes from other neurons [2, 3]. In such cases, the output does not form a Poisson process because spiking is history-dependent. The nonlinearity f is fixed a priori. Therefore, the only parameters are the coefficients of the filter k. The most common choice is exponential, f(z) = exp(z), corresponding to the canonical ‘log’ link function for Poisson GLMs. Prior work [6] has shown that if f grows at least linearly and at most exponentially, then the log-likelihood is jointly concave in model parameters θ. This ensures that the log-likelihood has no non-global maxima, and gradient ascent methods are guaranteed to find the maximum likelihood estimate. 2 3 Interpreting the GLM as a conductance-based model A more biophysical interpretation of the GLM can be obtained by considering a single-compartment neuron with linear membrane dynamics and conductance-based input: dV dt = −glV + ge(t)(V −Ee) −gi(t)(V −Ei) = −(gl + ge(t) + gi(t))V + ge(t)Ee + gi(t)Ei = −gtot(t)V + Is(t), (5) where (for simplicity) we have set the leak current reversal potential to zero. The “total conductance” at time t is gtot(t) = gl+ge(t)+gi(t) and the “effective input current” is Is(t) = ge(t)Ee+gi(t)Ei. Suppose that the stimulus affects the neuron via the synaptic conductances ge and gi. It is then natural to ask under which conditions, if any, the above model can correspond to a GLM. The definition of a GLM requires the solution V (t) to be a linear (or affine) function of the stimulus. This arises if the two following conditions are met: 1. Total conductance gtot is constant. Thus, for some constant c: ge(t) + gi(t) = c. (6) 2. The input Is is linear in x. This holds if we set: ge(xt) = ke ⊤xt + be gi(xt) = ki ⊤xt + bi. (7) We can satisfy these two conditions by setting ke = −ki, so that the excitatory and inhibitory conductances are driven by equal and opposite linear projections of the stimulus. This allows us to rewrite the membrane equation (eq. 5): dV dt = −gtotV + (ke ⊤xt + be)Ee + (ki ⊤xt + bi)Ei = −gtotV + ktot ⊤xt + btot, (8) where gtot = gl + be + bi is the (constant) total conductance, ktot = keEe + kiEi, and btot = beEe + biEi. If we take the initial voltage V0 to be btot, the equilibrium voltage in the absence of a stimulus, then the solution to this differential equation is Vt = Z t 0 e−gtot(t−s) ktot ⊤xs  ds + btot = kleak ∗(ktot ⊤xt) + btot = kglm ⊤xt + btot, (9) where kleak ∗(ktot⊤xt) denotes linear convolution of the exponential decay “leak” filter kleak(t) = e−gtot t with the linearly projected stimulus train, and kglm = ktot ∗kleak is the “true” GLM filter (from eq. 1) that results from temporally convolving the conductance filter with the leak filter. Since the membrane potential is a linear (affine) function of the stimulus (as in eq. 1), the model is clearly a GLM. Thus, to summarize, the GLM can be equated with a synaptic conductance-based dynamical model in which the GLM filter k results from a common linear filter driving excitatory and inhibitory synaptic conductances, blurred by convolution with an exponential leak filter determined by the total conductance. 4 Extending GLM to a nonlinear conductance-based model From the above, it is easy to see how to create a more realistic conductance-based model of neural responses. Such a model would allow the stimulus tuning of excitation and inhibition to differ (i.e., allow ke ̸= −ki), and would include a nonlinear relationship between x and the conductances to 3 preclude negative values (e.g., using a rectifying nonlinearity). As with the GLM, we assume that the only source of stochasticity on the model is in the spiking mechanism: we place no additional noise on the conductances or the voltage. This simplifying assumption allows us to perform efficient maximum likelihood inference using standard gradient ascent methods. We specify the membrane potential of the conductance-based point process model as follows: dV dt = ge(t)(Ee −V ) + gi(t)(Ei −V ) + gl(El −V ), (10) ge(t) = fe(ke ⊤xt), gi(t) = fi(ki ⊤xt), (11) where fe and fi are nonlinear functions ensuring positivity of the synaptic conductances. In practice, we evaluate V along a discrete lattice of points (t = 1, 2, 3, . . . T) of width ∆t. Assuming ge and gi remain constant within each bin, the voltage equation becomes a simple linear differential equation with the solution V (t + 1) = e−gtot(t)∆t  V (t) −Is(t) gtot(t)  + Is(t) gtot(t) (12) V (1) = El (13) gtot(t) = ge(t) + gi(t) + gl (14) Is(t) = ge(t)Ee + gi(t)Ei + glEl (15) The mapping from membrane potential to spiking is similar to that in the standard GLM (eq. 3): rt = f(V (t)) (16) f(V ) = exp (V −VT ) VS  (17) yt|rt ∼ Poiss(rt∆t). (18) The voltage-to-spike rate nonlinearity f follows the form proposed by Mensi et al. [17], where VT is a soft spiking threshold and VS determines the steepness of the nonlinearity. To account for refractory periods or other spike-dependent behaviors, we simply augment the function to include a GLM-like spike history term: f(V ) = exp (V −VT ) VS + h⊤yhist  (19) Spiking activity in real neurons influences both the membrane potential and the output nonlinearity. We could include additional conductance terms that depend on either stimuli or spike history, such as an after hyper-polarization current; this provides one direction for future work. For spatial stimuli, the model can include a set of spatially distinct rectified inputs (e.g., as employed in [9]). To complete the model, we must select a form for the conductance nonlinearities fe and fi. Although we could attempt to fit these functions (e.g., as in [9, 18]), we fixed them to be the soft-rectifying function: fe(·), fi(·) = log(1 + exp(·)). (20) Fixing these nonlinearities improved the speed and robustness of maximum likelihood parameter fitting. Moreover, we examined intracellularly recorded conductances and found that the nonlinear mapping from linearly projected stimuli to conductance was well described by this function (see Fig. 4). The model parameters we estimate are {ke, ki, be, bi, h, gl, El}. We set the remaining model parameters to biologically plausible values: VT = −70mV, VS = 4mV, Ee = 0mV, and Ei = −80mV . To limit the total number of parameters, we fit the linear filters ke and ki using a basis consisting of 12 raised cosine functions, and we used 10 raised cosine functions for the spike history filter [3]. The log-likelihood function for this model is not concave in the model parameters, which increases the importance to selecting a good initialization point. We initialized the parameters by fitting a simplified model which had only one conductance. We initialized the leak terms as El = −70mV and gl = 200. We assumed a single synaptic conductance with a linear stimulus dependence, glin(t) = klin⊤xt (note that this allows for negative conductance values). We initialized this filter 4 0 5 10 0 10 20 30 minutes of training data L2 error estimated filter errors 0 5 10 −5.33 −5.31 −5.29 −5.27x 104 minutes of training data log likelihood Actual fit to test data A B C 50 100 150 200 −0.8 −0.4 0 0.4 filter fits time (ms) weight Figure 2: Simulation results. (A) Estimates (solid traces) of excitatory (blue) and inhibitory (red) stimulus filters from 10 minutes of simulated data. (Dashed lines indicate true filters). (B) The L2 norm between the estimated input filters and the true filters (calculated in the low-dimensional basis) as a function of the amount of training data. (C) The log-likelihood of the fit CBSM on withheld test data converges to the log likelihood of the true model. the GLM fit, and then numerically maximized the likelihood for klin. We then initialized the parameters for the complete model using ke = cklin and ki = −cklin, where 0 < c ≤1, thereby exploiting the mapping between the GLM and the CBSM. Although this initialization presumes that excitation and inhibition have nearly opposite tuning, we found that standard optimization methods successfully converged to the true model parameters even when ke and ki had similar tuning (simulation results not shown). 5 Results: simulations To examine the estimation performance, we fit spike train data simulated from a CBSM with known parameters (see Fig. 2). The simulated data qualitatively mimicked experimental datasets, with input filters selected to reproduce the stimulus tuning of macaque ON parasol RGCs. The stimulus consisted of a one dimensional white noise signal, binned at a 0.1ms resolution, and filtered with a low pass filter with a 60Hz cutoff frequency. The simulated cell produced a firing rate of approximately 32spikes/s. We validated our maximum likelihood fitting procedure by examining error in the fitted parameters, and evaluating the log-likelihood on a held out five-minute test set. With increasing amounts of training data, the parameter estimates converged to the true parameters, despite the fact that the model does not have the concavity guarantees of the standard GLM. To explore the CBSM’s qualitative response properties, we performed simulated experiments using stimuli with varying statistics (see Fig. 3). We simulated spike responses from a CBSM with fixed parameters to stimuli with different standard deviations. We then separately fit responses from each simulation with a standard GLM. The fitted GLM filters exhibit shifts in both peak height and position for stimuli with different variance. This suggests that the CBSM can exhibit gain control effects that cannot be captured by a classic GLM with a spike history filter and exponential nonlinearity. 6 Results: neural data We fit the CBSM to spike trains recorded from 7 macaque ON parasol RGCs [12]. The spike trains were obtained by cell attached recordings in response to full-field, white noise stimuli (identical to the simulations above). Either 30 or 40 trials were recorded from each cell, using 10 unique 6 second stimuli. After the spike trains were recorded, voltage clamp recordings were used to measure the excitatory and inhibitory conductances to the same stimuli. We fit the model using the spike trains for 9 of the stimuli, and the remaining trials were used to test model fit. Thus, the models were effectively trained using 3 or 4 repeats of 54 seconds of full-field noise stimulus. We compared the intracellular recordings to the ge and gi estimated from the CBSM (Fig. 5). Additionally, we fit the measured conductances with the linear-nonlinear cascade model from the CBSM (the terms ge and 5 0 50 100 150 200 −0.01 0 0.01 0.02 0.03 time (ms) weight filters at different contrasts 0.25x contrast 0.5x 1x 2x experimental data (Chander & Chichilnisky, 2001) A B Figure 3: Qualitative illustration of model’s capacity to exhibit contrast adaptation (or gain control). (A) The GLM filters fit to a fixed CBSM simulated at various levels of stimulus variance. (B) Filters fit to two real retinal ganglion cells at two different levels of contrast (from [19]). inhibitory −30 0 30 −10 0 10 20 30 40 50 filter output measured conductance excitatory data mean −40 −20 0 20 40 −10 0 10 20 30 40 50 15 -15 Figure 4: Measured conductance vs. output of a fitted linear stimulus filter (gray points), for both the excitatory (left) and inhibitory (right) conductances. The green diamonds correspond to a non-parametric estimate of the conductance nonlinearity, given by the mean conductance for each bin of filter output. For both conductances, the function is is well described by a soft-rectifying function (black trace). gi in eq. 11) with a least-squares fit as an upper bound measure for the best possible conductance estimate given our model. The CBSM correctly determined the stimulus tuning for excitation and inhibition for these cells: inhibition is oppositely tuned and slightly delayed from excitation. For the side-by-side comparison shown in Fig. 5, we introduced a scaling factor in the estimated conductances in order to compare the conductances estimated from spike trains against recorded conductances. Real membrane voltage dynamics depend on the capacitance of the membrane, which we do not include because it introduces an arbitrary scaling factor that cannot be estimated by spike alone. Therefore, for comparisons we chose a scaling factor for each cell independently. However, we used a single scaling for the inhibitory and excitatory conductances. Additionally, we often had 2 or 3 repeated trials of the withheld stimulus, and we compared the model prediction to the average conductance recorded for the stimulus. The CBSM predicted the synaptic conductances with an average r2 = 0.54 for the excitatory and an r2 = 0.39 for the inhibitory input from spike trains, compared to an average r2 = 0.72 and r2 = 0.59 for the excitatory and inhibitory conductances respectively from the least-squares fit directly to the conductances (Fig. 6). To summarize, using only a few minutes of spiking data, the CBSM could account for 71% of the variance of the excitatory input and 62% of the inhibitory input that can possibly be explained using the LN cascade model of the conductances (eq. 11). One challenge we discovered when fitting the model to real spike trains was that one filter, typically ki, would often become much larger than the other filter. This resulted in one conductance becoming dominant, which the intracellular recordings indicated was not the case. This was likely due to the fact that we are data-limited when dealing with intracellular recordings: the spike train recordings include only 1 minute of unique stimulus. To alleviate this problem, we added a penalty term, φ, to 6 250ms 10nS 0 50 100 150 200 −0.3 −0.2 −0.1 0 0.1 0.2 time (ms) weight estimated filters 250ms 10nS 0 50 100 150 200 −0.2 −0.1 0 0.1 0.2 time (ms) weight estimated filters Example Cell 2 Example Cell 1 estimated conductances ge gi ge gi fit to conductance: fit to spikes: fit to conductance: fit to spikes: fit to conductance: fit to spikes: fit to conductance: fit to spikes: (spikes) (conductances) (spikes) (conductances) Figure 5: Two example ON parasol RGC responses to a full-field noise stimulus fit with the CBSM. The model parameters were fit to spike train data, and then used to predict excitatory and inhibitory synaptic currents recorded separately in response to novel stimuli. For comparison, we show predictions of an LN model fit directly to the conductance data. Left: Linear kernels for the excitatory (blue) and inhibitory (red) inputs estimated from the conductance-based model (light red, light blue) and estimated by fitting a linear-nonlinear model directly to the measured conductances (dark red, dark blue). The filters represent a combination of events that occur in the retinal circuitry in response to a visual stimulus, and are primarily shaped by the cone transduction process. Right: Conductances predicted by our model on a withheld test stimulus. Measured conductances (black) are compared to the predictions from the CBSM filters (fit to spiking data) and an LN model (fit to conductance data). the log likelihood on the difference of the L2 norms of ke and ki: φ(ke, ki) = λ ||ke||2 −||ki||22 (21) This differentiable penalty ensures that the model will not rely too strongly on one filter over the other, without imposing any prior on the shape of the filters (with λ = 0.05). We note that unlike the a typical situation with statistical models that contain more abstract parameters, the terms we wish to regularize can be measured with intracellular recordings. Future work with this model could include more informative, data-driven priors on ke and ki. Finally, we fit the CBSM and GLM to a population of nine extracellularly recorded macaque RGCs in response to a full-field binary noise stimulus [20]. We used a five minute segment for model fitting, and compared predicted spike rate using a 6s test stimulus for which we had repeated trials. 7 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 spike fit r2 fit−to−conductance r2 Excitation prediction 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 spike fit r2 fit−to−conductance r2 Inhibition prediction Figure 6: Summary of the CBSM fits to 7 ON parasol RGCs for which we had both spike train and conductance recordings. The axes show model’s ability to predict the excitatory (left) and inhibitory (right) inputs to a new stimulus in terms of r2. The CBSM fit is compared against predictions of an LN model fit directly to measured conductances. 250ms 50 spks/s GLM: CBSM: A B 0.4 0.6 0.8 1 0.4 0.5 0.6 0.7 0.8 0.9 1 Conductance Model Rate prediction performance off cell on cell GLM Figure 7: (A) Performance on spike rate (PSTH) prediction. The true rate (black) was estimated using 167 repeat trials. The GLM prediction is in blue and the CBSM is in red. The PSTHs were smoothed with a Gaussian kernel with a 1ms standard deviation. (B) Spike rate prediction performance for the population of 9 cells. The red circle indicates cell used in left plot. The CBSM achieved a 0.08 higher average r2 in PSTH prediction performance compared to the GLM. All nine cells showed an improved fit with the CBSM. 7 Discussion The classic GLM is a valuable tool for describing the relationship between stimuli and spike responses. However, the GLM describes this map as a mathematically convenient linear-nonlinear cascade, which does not take account of the biophysical properties of neural processing. Here we have shown that the GLM may be interpreted as a biophysically inspired, but highly constrained, synaptic conductance-based model. We proposed a more realistic model of the conductance, removing the artificial constraints present in the GLM interpretation, which results in a new, more accurate and more flexible conductance-based point process model for neural responses. Even without the benefit of a concave log-likelihood, numerical optimization methods provide accurate estimates of model parameters. Qualitatively, the CBSM has a stimulus-dependent time constant, which allows it change gain as a function of stimulus statistics (e.g., contrast), an effect that cannot be captured by a classic GLM. The model also allows the excitatory and inhibitory conductances to be distinct functions of the sensory stimulus, as is expected in real neurons. We demonstrate that the CBSM not only achieves improved performance as a phenomenological model of neural encoding compared to the GLM, the model accurately estimates the tuning of the excitatory and inhibitory synaptic inputs to RGCs purely from measured spike times. As we move towards more naturalistic stimulus conditions, we believe that the conductance-based approach will become a valuable tool for understanding the neural code in sensory systems. 8 References [1] K. Harris, J. Csicsvari, H. Hirase, G. Dragoi, and G. Buzsaki. Organization of cell assemblies in the hippocampus. Nature, 424:552–556, 2003. [2] W. Truccolo, U. T. Eden, M. R. Fellows, J. P. Donoghue, and E. N. Brown. A point process framework for relating neural spiking activity to spiking history, neural ensemble and extrinsic covariate effects. J. Neurophysiol, 93(2):1074–1089, 2005. [3] J. W. Pillow, J. Shlens, L. Paninski, A. Sher, A. M. Litke, E. J. Chichilnisky, and E. P. Simoncelli. Spatio-temporal correlations and visual signaling in a complete neuronal population. Nature, 454:995–999, 2008. [4] S. Gerwinn, J. H. Macke, and M. Bethge. Bayesian inference for generalized linear models for spiking neurons. Frontiers in Computational Neuroscience, 2010. [5] I. H. Stevenson, B. M. London, E. R. Oby, N. A. Sachs, J. Reimer, B. Englitz, S. V. David, S. A. Shamma, T. J. Blanche, K. Mizuseki, A. Zandvakili, N. G. Hatsopoulos, L. E. Miller, and K. P. Kording. Functional connectivity and tuning curves in populations of simultaneously recorded neurons. PLoS Comput Biol, 8(11):e1002775, 2012. [6] L. Paninski. Maximum likelihood estimation of cascade point-process neural encoding models. Network: Computation in Neural Systems, 15:243–262, 2004. [7] D. A. Butts, C. Weng, J. Jin, J.M. Alonso, and L. Paninski. Temporal precision in the visual pathway through the interplay of excitation and stimulus-driven suppression. J Neurosci, 31(31):11313–11327, Aug 2011. [8] B Vintch, A Zaharia, J A Movshon, and E P Simoncelli. Efficient and direct estimation of a neural subunit model for sensory coding. In Adv. Neural Information Processing Systems (NIPS*12), volume 25, Cambridge, MA, 2012. MIT Press. To be presented at Neural Information Processing Systems 25, Dec 2012. [9] J. M. McFarland, Y. Cui, and D. A. Butts. Inferring nonlinear neuronal computation based on physiologically plausible inputs. PLoS computational biology, 9(7):e1003143, January 2013. [10] Il M. Park, Evan W. Archer, Nicholas Priebe, and Jonathan W. Pillow. Spectral methods for neural characterization using generalized quadratic models. In Advances in Neural Information Processing Systems 26, pages 2454–2462, 2013. [11] L. Theis, A. M. Chagas, D. Arnstein, C. Schwarz, and M. Bethge. Beyond glms: A generative mixture modeling approach to neural system identification. PLoS Computational Biology, Nov 2013. in press. [12] P. K. Trong and F. Rieke. Origin of correlated activity between parasol retinal ganglion cells. Nature neuroscience, 11(11):1343–51, November 2008. [13] C. Poo and J. S. Isaacson. Odor representations in olfactory cortex: ”sparse” coding, global inhibition, and oscillations. Neuron, 62(6):850–61, June 2009. [14] H. E. Plesser and W. Gerstner. Noise in integrate-and-fire neurons: from stochastic input to escape rates. Neural Comput, 12(2):367–384, Feb 2000. [15] W. Gerstner. A framework for spiking neuron models: The spike response model. In F. Moss and S. Gielen, editors, The Handbook of Biological Physics, volume 4, pages 469–516, 2001. [16] L. Paninski, J. W. Pillow, and J. Lewi. Statistical models for neural encoding, decoding, and optimal stimulus design. Progress in brain research, 165:493–507, January 2007. [17] S. Mensi, R. Naud, and W. Gerstner. From stochastic nonlinear integrate-and-fire to generalized linear models. In NIPS, pages 1377–1385, 2011. [18] M. B. Ahrens, L. Paninski, and M. Sahani. Inferring input nonlinearities in neural encoding models. Network: Computation in Neural Systems, 19(1):35–67, January 2008. [19] D. Chander and E. J. Chichilnisky. Adaptation to Temporal Contrast in Primate and Salamander Retina. The Journal of Neuroscience, 21(24):9904–16, December 2001. [20] J. W. Pillow, L. Paninski, V. J. Uzzell, E. P. Simoncelli, and E. J. Chichilnisky. Prediction and decoding of retinal ganglion cell responses with a probabilistic spiking model. The Journal of neuroscience, 25(47):11003–11013, November 2005. 9
2014
354
5,463
Scalable Inference for Neuronal Connectivity from Calcium Imaging Alyson K. Fletcher Sundeep Rangan Abstract Fluorescent calcium imaging provides a potentially powerful tool for inferring connectivity in neural circuits with up to thousands of neurons. However, a key challenge in using calcium imaging for connectivity detection is that current systems often have a temporal response and frame rate that can be orders of magnitude slower than the underlying neural spiking process. Bayesian inference methods based on expectation-maximization (EM) have been proposed to overcome these limitations, but are often computationally demanding since the E-step in the EM procedure typically involves state estimation for a high-dimensional nonlinear dynamical system. In this work, we propose a computationally fast method for the state estimation based on a hybrid of loopy belief propagation and approximate message passing (AMP). The key insight is that a neural system as viewed through calcium imaging can be factorized into simple scalar dynamical systems for each neuron with linear interconnections between the neurons. Using the structure, the updates in the proposed hybrid AMP methodology can be computed by a set of one-dimensional state estimation procedures and linear transforms with the connectivity matrix. This yields a computationally scalable method for inferring connectivity of large neural circuits. Simulations of the method on realistic neural networks demonstrate good accuracy with computation times that are potentially significantly faster than current approaches based on Markov Chain Monte Carlo methods. 1 Introduction Determining connectivity in populations of neurons is fundamental to understanding neural computation and function. In recent years, calcium imaging has emerged as a promising technique for measuring synaptic activity and mapping neural micro-circuits [1–4]. Fluorescent calcium-sensitive dyes and genetically-encoded calcium indicators can be loaded into neurons, which can then be imaged for spiking activity either in vivo or in vitro. Current methods enable imaging populations of hundreds to thousands of neurons with very high spatial resolution. Using two-photon microscopy, imaging can also be localized to specific depths and cortical layers [5]. Calcium imaging also has the potential to be combined with optogenetic stimulation techniques such as in [6]. However, inferring neural connectivity from calcium imaging remains a mathematically and computationally challenging problem. Unlike anatomical methods, calcium imaging does not directly measure connections. Instead, connections must be inferred indirectly from statistical relationships between spike activities of different neurons. In addition, the measurements of the spikes from calcium imaging are indirect and noisy. Most importantly, the imaging introduces significant temporal blurring of the spike times: the typical time constants for the decay of the fluorescent calcium concentration, [Ca2+], can be on the order of a second – orders of magnitude slower than the spike rates and inter-neuron dynamics. Moreover, the calcium imaging frame rate remains relatively slow – often less than 100 Hz. Hence, determining connectivity typically requires super-resolution of spike times within the frame period. 1 To overcome these challenges, the recent work [7] proposed a Bayesian inference method to estimate functional connectivity from calcium imaging in a systematic manner. Unlike “model-free” approaches such as in [8], the method in [7] assumed a detailed functional model of the neural dynamics with unknown parameters including a connectivity weight matrix W. The model parameters including the connectivity matrix can then be estimated via a standard EM procedure [9]. While the method is general, one of the challenges in implementing it is the computational complexity. As we discuss below, the E-step in the EM procedure essentially requires estimating the distributions of hidden states in a nonlinear dynamical system whose state dimension grows linearly with the number of neurons. Since exact computation of these densities grows exponentially in the state dimension, [7] uses an approximate method based on blockwise Gibbs sampling where each block of variables consists of the hidden states associated with one neuron. Since the variables within a block are described as a low-dimensional dynamical system, the updates of the densities for the Gibbs sampling can be computed efficiently via a standard particle filter [10,11]. However, simulations of the method show that the mixing between blocks can still take considerable time to converge. This paper provides a novel method that can potentially significantly improve the computation time of the state estimation. The key insight is to recognize that a high-dimensional neural system can be “factorized” into simple, scalar dynamical systems for each neuron with linear interactions between the neurons. As described below, we assume a standard leaky integrate-and-fire model for each neuron [12] and a first-order AR process for the calcium imaging [13]. Under this model, the dynamics of N neurons can be described by 2N systems, each with a scalar (i.e. one-dimensional) state. The coupling between the systems will be linear as described by the connectivity matrix W. Using this factorization, approximate state estimation can then be efficiently performed via approximations of loopy belief propagation (BP) [14]. Specifically, we show that the loopy BP updates at each of the factor nodes associated with the integrate-and-fire and calcium imaging can be performed via a scalar standard forward–backward filter. For the updates associated with the linear transform W, we use recently-developed approximate message passing (AMP) methods. AMP was originally proposed in [15] for problems in compressed sensing. Similar to expectation propagation [16], AMP methods use Gaussian and quadratic approximations of loopy BP but with further simplifications that leverage the linear interactions. AMP was used for neural mapping from multi-neuron excitation and neural receptive field estimation in [17, 18]. Here, we use a so-called hybrid AMP technique proposed in [19] that combines AMP updates across the linear coupling terms with standard loopy BP updates on the remainder of the system. When applied to the neural system, we show that the estimation updates become remarkably simple: For a system with N neurons, each iteration involves running 2N forward–backward scalar state estimation algorithms, along with multiplications by W and WT at each time step. The practical complexity scales as O(NT) where T is the number of time steps. We demonstrate that the method can be significantly faster than the blockwise Gibbs sampling proposed in [7], with similar accuracy. 2 System Model We consider a recurrent network of N spontaneously firing neurons. All dynamics are approximated in discrete time with some time step ∆, with a typical value ∆= 1 ms. Importantly, this time step is typically smaller than the calcium imaging period, so the model captures the dynamics between observations. Time bins are indexed by k = 0, . . . , T −1, where T is the number of time bins so that T∆is the total observation time in seconds. Each neuron i generates a sequence of spikes (action potentials) indicated by random variables sk i taking values 0 or 1 to represent whether there was a spike in time bin k or not. It is assumed that the discretization step ∆is sufficiently small such that there is at most one action potential from a neuron in any one time bin. The spikes are generated via a standard leaky integrate-and-fire (LIF) model [12] where the (single compartment) membrane voltage vk i of each neuron i and its corresponding spike output sequence sk i evolve as ˜vk+1 i = (1 −αIF )vk i + qk i + dk vi, qk i = N X j=1 Wijsk−δ j + bIF,i, dk vi ∼N(0, τIF ), (1) and (vk+1 i , sk+1 i ) = (˜vk i , 0) if vk i < µ, (0, 1) if ˜vk i ≥µ, (2) 2 where αIF is a time constant for the integration leakage; µ is the threshold potential at which the neurons spikes; bIF,i is a constant bias term; qk i is the increase in the membrane potential from the pre-synaptic spikes from other neurons and dk vi is a noise term including both thermal noise and currents from other neurons that are outside the observation window. The voltage has been scaled so that the reset voltage is zero. The parameter δ is the integer delay (in units of the time step ∆) between the spike in one neuron and the increase in the membrane voltage in the post-synaptic neuron. An implicit assumption in this model is the post-synaptic current arrives in a single time bin with a fixed delay. To determine functional connectivity, the key parameter to estimate will be the matrix W of the weighting terms Wij in (1). Each parameter Wij represents the increase in the membrane voltage in neuron i due to the current triggered from a spike in neuron j. The connectivity weight Wij will be zero whenever neuron j has no connection to neuron i. Thus, determining W will determine which neurons are connected to one another and the strengths of those connections. For the calcium imaging, we use a standard model [7], where the concentration of fluorescent Calcium has a fast initial rise upon an action potential followed by a slow exponential decay. Specifically, we let zk i = [Ca2+]k be the concentration of fluorescent Calcium in neuron i in time bin k and assume it evolves as first-order auto-regressive AR(1) model, zk+1 i = (1 −αCA,i)zk i + sk i , (3) where αCA is the Calcium time constant. The observed net fluorescence level is then given by a noisy version of zk i , yk i = aCA,izk i + bCA,i + dk yi, dk yi ∼N(0, τy), (4) where aCA,i and bCA,i are constants and dyi is white Gaussian noise with variance τy. Nonlinearities such as saturation described in [13] can also be modeled. As mentioned in the Introduction, a key challenge in calcium imaging is the relatively slow frame rate which has the effect of subsampling of the fluorescence. To model the subsampling, we let IF denote the set of time indices k on which we observe F k i . We will assume that fluorescence values are observed once every TF time steps for some integer period TF so that IF = {0, TF , 2TF , . . . , KTF } where K is the number of Calcium image frames. 3 Parameter Estimation via Message Passing 3.1 Problem Formulation Let θ be set of all the unknown parameters, θ = {W, τIF , τCA, αIF , bIF,i, αCA, aCA,i, bCA,i, i = 1, . . . , N}, (5) which includes the connectivity matrix, time constants and various variances and bias terms. Estimating the parameter set θ will provide an estimate of the connectivity matrix W, which is our main goal. To estimate θ, we consider a regularized maximum likelihood (ML) estimate bθ = arg max θ L(y|θ) + φ(θ), L(y|θ) = −log p(y|θ), (6) where y is the set of observed values; L(y|θ) is the negative log likelihood of y given the parameters θ and φ(θ) is some regularization function. For the calcium imaging problem, the observations y are the observed fluorescence values across all the neurons, y = {y1, . . . , yN} , yi =  yk i , k ∈IF , (7) where yi is the set of fluorescence values from neuron i, and, as mentioned above, IF is the set of time indices k on which the fluorescence is sampled. The regularization function φ(θ) can be used to impose constraints or priors on the parameters. In this work, we will assume a simple regularizer that only constrains the connectivity matrix W, φ(θ) = λ∥W∥1, ∥W∥1 := X ij |Wij|, (8) 3 where λ is a positive constant. The ℓ1 regularizer is a standard convex function used to encourage sparsity [20], which we know in this case must be valid since most neurons are not connected to one another. 3.2 EM Estimation Exact computation of bθ in (6) is generally intractable, since the observed fluorescence values y depend on the unknown parameters θ through a large set of hidden variables. Similar to [7], we thus use a standard EM procedure [9]. To apply the EM procedure to the calcium imaging problem, let x be the set of hidden variables, x = {v, z, q, s} , (9) where v are the membrane voltages of the neurons, z the calcium concentrations, s the spike outputs and q the linearly combined spike inputs. For any of these variables, we will use the subscript i (e.g. vi) to denote the values of the variables of a particular neuron i across all time steps and superscript k (e.g. vk) to denote the values across all neurons at a particular time step k. Thus, for the membrane voltage v =  vk i , vk = vk 1, . . . , vk N  , vi = v0 i , . . . , vT−1 i  . The EM procedure alternately estimates distributions on the hidden variables x given the current parameter estimate for θ (the E-step); and then updates the estimates for parameter vector θ given the current distribution on the hidden variables x (the M-step). • E-Step: Given parameter estimates bθℓ, estimate P(x|y, bθℓ), (10) which is the posterior distribution of the hidden variables x given the observations y and current parameter estimate bθℓ. • M-step Update the parameter estimate via the minimization, bθℓ+1 = arg min θ E h L(x, y|θ)|bθℓi + φ(θ), (11) where L(x, y|θ) is the joint negative log likelihood, L(x, y|θ) = −log p(x, y|θ). (12) In (11) the expectation is with respect to the distribution found in (10) and φ(θ) is the parameter regularization function. The next two sections will describe how we approximately perform each of these steps. 3.3 E-Step estimation via Approximate Message Passing For the calcium imaging problem, the challenging step of the EM procedure is the E-step, since the hidden variables x to be estimated are the states and outputs of a high-dimensional nonlinear dynamical system. Under the model in Section 2, a system with N neurons will require N states for the membrane voltages vk i and N states for the bound Ca concentration levels zk i , resulting in a total state dimension of 2N. The E-step for this system is essentially a state estimation problem, and exact inference of the states of a general nonlinear dynamical system grows exponentially in the state dimension. Hence, exact computation of the posterior distribution (10) for the system will be intractable even for a moderately sized network. As described in the Introduction, we thus use an approximate messaging passing method that exploits the separable structure of the system. For the remainder of this section, we will assume the parameters θ in (5) are fixed to the current parameter estimate bθℓ. Then, under the assumptions of Section 2, the joint probability distribution function of the variables can be written in a factorized form, P(x, y) = P(q, v, s, z, y) = 1 Z T−1 Y k=0 1{qk=Wsk} N Y i=1 ψIF i (qi, vi, si)ψCA i (si, zi, yi), (13) 4 qi input currents ψIF i (qi, vi, si) Integrate-and-fire dynamics vi membrane voltage si spike outputs qk = Wsk Connectivity between neurons ψCA i (si, zi, yi) Ca imaging dynamics yi observed fluorescence zi Ca2+ concentration Neuron i, i = 1, . . . , N Time step k, k = 0, . . . , T −1 Figure 1: Factor graph plate representation of the system where the spike dynamics are described by the factor node ψIF i (qi, vi, si) and the calcium image dynamics are represented via the factor node ψCA i (si, zi, yi). The high-dimensional dynamical system is described as 2N scalar dynamical systems (2 for each neuron) with linear interconnections, qk = Wsk between the neurons. A computational efficient approximation of loopy BP [19] is applied to this graph for approximate Bayesian inference required in the E-step of the EM algorithm. where Z is a normalization constant; ψIF i (qi, vi, si) is the potential function relating the summed spike inputs qi to the membrane voltages vi and spike outputs si; ψCA i (si, zi, yi) relates the spike outputs si to the bound calcium concentrations zi and observed fluorescence values yi; and the term 1{qk=Wsk} indicates that the distribution is to be restricted to the set satisfying the linear constraints qk = Wsk across all time steps k. As in standard loopy BP [14], we represent the distribution (13) in a factor graph as shown in Fig. 1. Now, for the E-step, we need to compute the marginals of the posterior distribution p(x|y) from the joint distribution (13). Using the factor graph representation, loopy BP iteratively updates estimates of these marginal posterior distributions using a message passing procedure, where the estimates of the distributions (called beliefs) are passed between the variable and factor nodes in the graph. In general, the computationally challenging component of loopy BP is the updates on the belief messages at the factor nodes. However, using the factorized structure in Fig. 1 along with approximate message passing (AMP) simplifications as described in [19], these updates can be computed easily. Details are given in the full paper [21], but the basic procedure for the factor node updates and the reasons why these computations are simple can be summarized as follows. At a high level, the factor graph structure in Fig. 1 partitions the 2N-dimensional nonlinear dynamical system into N scalar systems associated with each membrane voltage vk i and an additional N scalar systems associated with each calcium concentration level zk i . The only coupling between these systems is through the linear relationships qk = Wsk. As shown in Appendix ??, on each of the scalar systems, the factor node updates required by loopy BP essentially reduces to a state estimation problem for this system. Since the state space of this system is scalar (i.e. one-dimensional), we can discretize the state space well with a small number of points – in the experiments below we use L = 20 points per dimension. Once discretized, the state estimation can be performed via a standard forward–backward algorithm. If there are T time steps, the algorithm will have a computational cost of O(TL2) per scalar system. Hence, all the factor node updates across all the 2N scalar systems has total complexity O(NTL2). For the factor nodes associated with the linear constraints qk = Wsk, we use the AMP approximations [19]. In this approximation, the messages for the transform outputs qk i are approximated as Gaussians which is, at least heuristically, justified since the they are outputs of a linear transform of a large number of variables, sk i . In the AMP algorithm, the belief updates for the variables qk and sk can then be computed simply by linear transformations of W and WT . Since W represents a connectivity matrix, it is generally sparse. If each row of W has d non-zero values, multiplication 5 by W and WT will be O(Nd). Performing the multiplications across all time steps results in a total complexity of O(NTd). Thus, the total complexity of the proposed E-step estimation method is O(NTL2 +NTd) per loopy BP iteration. We typically use a small number of loopy BP iterations per EM update (in fact, in the experiments below, we found reasonable performance with one loopy BP update per EM update). In summary, we see that while the overall neural system is high-dimensional, it has a linear + scalar structure. Under the assumption of the bounded connectivity d, this structure enables an approximate inference strategy that scales linearly with the number of neurons N and time steps T. Moreover, the updates in different scalar systems can be computed separately allowing a readily parallelizable implementation. 3.4 Approximate M-step Optimization The M-step (11) is computationally relatively simple. All the parameters in θ in (5) have a linear relationship between the components of the variables in the vector x in (9). For example, the parameters aCA,i and bCA,i appear in the fluorescence output equation (4). Since the noise dk yi in this equation is Gaussian, the negative log likelihood (12) is given by L(x, y|θ) = 1 2τyi X k∈IF (yk i −aCA,izk i −bCA,i)2 + T 2 log(τyi) + other terms, where “other terms” depend on parameters other than aCA,i and bCA,i. The expectation E(L(x, y|θ)|bθℓ) will then depend only on the mean and variance of the variables yk i and zk i , which are provided by the E-step estimation. Thus, the M-step optimization in (11) can be computed via a simple least-squares problem. Using the linear relation (1), a similar method can be used for αIF,i and bIF,i, and the linear relation (3) can be used to estimate the calcium time constant αCA. To estimate the connectivity matrix W, let rk = qk −Wsk so that the constraints in (13) is equivalent to the condition that rk = 0. Thus, the term containing W in the expectation of the negative log likelihood E(L(x, y|θ)|bθℓ) is given by the negative log probability density of rk evaluated at zero. In general, this density will be a complex function of W and difficult to minimize. So, we approximate the density as follows: Let bq and bs be the expectation of the variables q and s given by the E-step. Hence, the expectation of rk is bqk −Wbsk. As a simple approximation, we will then assume that the variables rk i are Gaussian, independent and having some constant variance σ2. Under this simplifying assumption, the M-step optimization of W with the ℓ1 regularizer (8) reduces to c W = arg min W 1 2 T−1 X k=0 ∥bqk −Wbsk∥2 + σ2λ∥W∥1, (14) For a given value of σ2λ, the optimization (14) is a standard LASSO optimization [22] which can be evaluated efficiently via a number of convex programming methods. In this work, in each M-step, we adjust the regularization parameter σ2λ to obtain a desired fixed sparsity level in the solution W. 3.5 Initial Estimation via Sparse Regression Since the EM algorithm cannot be guaranteed to converge a global maxima, it is important to pick the initial parameter estimates carefully. The time constants and noise levels for the calcium image can be extracted from the second-order statistics of fluorescence values and simple thresholding can provide a coarse estimate of the spike rate. The key challenge is to obtain a good estimate for the connectivity matrix W. For each neuron i, we first make an initial estimate of the spike probabilities P(sk i = 1|yi) from the observed fluorescence values yi, assuming some i.i.d. prior of the form P(st i) = λ∆, where λ is the estimated average spike rate per second. This estimation can be solved with the filtering method in [13] and is also equivalent to the method we use for the factor node updates. We can then threshold these probabilities to make a hard initial decision on each spike: sk i = 0 or 1. We then propose to estimate W from the spikes as follows. Fix a neuron i and let wi be the vector of weights Wij, j = 1, . . . , N. Under the assumption that the initial spike sequence sk i is exactly correct, it is shown in the full paper [21], that 6 Parameter Value Number of neurons, N 100 Connection sparsity 10% with random connections. All connections are excitatory with the non-zero weights Wij being exponentially distributed. Mean firing rate per neuron 10 Hz Simulation time step, ∆ 1 ms Total simulation time, T∆ 10 sec (10,000 time steps) Integration time constant, αIF 20 ms Conduction delay, δ 2 time steps = 2 ms Integration noise, dk vi Produced from two unobserved neurons. Ca time constant, αCA 500 ms Fluorescence noise, τCA Set to 20 dB SNR Ca frame rate , 1/TF 100 Hz Table 1: Parameters for the Ca image simulation. Figure 2: Typical network simulation trace. Top panel: Spike traces for the 100 neuron simulated network. Bottom panel: Calcium image fluorescence levels. Due to the random network topology, neurons often fire together, significantly complicating connectivity detection. Also, as seen in the lower panel, the slow decay of the fluorescent calcium blurs the spikes in the calcium image. a regularized maximum likelihood estimate of wi and bias term bIF,i is given by (bwi,bbIF,i) = arg min wi,bIF,i T−1 X k=0 Lik(uT k wi + cikbIF,i −µ, sk i ) + λ N X j=1 |Wij|, (15) where Lik is a probit loss function and the vector uk and scalar cik can be determined from the spike estimates. The optimization (15) is precisely a standard probit regression used in sparse linear classification [23]. This form arises due to the nature of the leaky integrate-and-fire model (1) and (2). Thus, assuming the initial spike sequences are estimated reasonably accurately, one can obtain good initial estimates for the weights Wij and bias terms bIF,i by solving a standard classification problem. 4 Numerical Example The method was tested using realistic network parameters, as shown in Table 1, similar to those found in neurons networks within a cortical column [24]. Similar parameters are used in [7]. The network consisted of 100 neurons with each neuron randomly connected to 10% of the other neurons. The non-zero weights Wij were drawn from an exponential distribution. As a simplification, all weights were positive (i.e. the neurons were excitatory – there were no inhibitory neurons in the simulation). A typical random matrix W generated in this manner would not in general result in a stable system. To stabilize the system, we followed the procedure in [8] where the system is simulated multiple times. After each simulation, the rows of the matrix W were adjusted up or down to increase or decrease the spike rate until all neurons spiked at a desired target rate. In this case, we assumed a desired average spike rate of 10 Hz. 7 Figure 3: Weight estimation accuracy. Left: Normalized mean-squared error as a function of the iteration number. Right: Scatter plot of the true and estimated weights. From the parameters in Table 1, we can immediately see the challenges in the estimation. Most importantly, the calcium imaging time constant αCA is set for 500 ms. Since the average neurons spike rate is assumed to be 10 Hz, several spikes will typically appear within a single time constant. Moreover, both the integration time constant and inter-neuron conduction time are much smaller than the A typical simulation of the network after the stabilization is shown in Fig. 2. Observe that due to the random connectivity, spiking in one neuron can rapidly cause the entire network to fire. This appears as the vertical bright stripes in the lower panel of Fig. 2. This synchronization makes the connectivity detection difficult to detect under temporal blurring of Ca imaging since it is hard to determine which neuron is causing which neuron to fire. Thus, the random matrix is a particularly challenging test case. The results of the estimation are shown in Fig. 3. The left panel shows the relative mean squared error defined as relative MSE = minα P ij |Wij −αc Wij|2 P ij |Wij|2 , (16) where c Wij is the estimate for the weight Wij. The minimization over all α is performed since the method can only estimate the weights up to a constant scaling. The relative MSE is plotted as a function of the EM iteration, where we have performed only a single loopy BP iteration for each EM iteration. We see that after only 30 iterations we obtain a relative MSE of 7% – a number at least comparable to earlier results in [7], but with significantly less computation. The right panel shows a scatter plot of the estimated weights c Wij against the true weights Wij. 5 Conclusions We have presented a scalable method for inferring connectivity in neural systems from calcium imaging. The method is based on factorizing the systems into scalar dynamical systems with linear connections. Once in this form, state estimation – the key computationally challenging component of the EM estimation – is tractable via approximating message passing methods. The key next step in the work is to test the methods on real data and also provide more comprehensive computational comparisons against current techniques such as [7]. References [1] R. Y. Tsien, “Fluorescent probes of cell signaling,” Ann. Rev. Neurosci., vol. 12, no. 1, pp. 227–253, 1989. [2] K. Ohki, S. Chung, Y. H. Ch’ng, P. Kara, and R. C. Reid, “Functional imaging with cellular resolution reveals precise micro-architecture in visual cortex,” Nature, vol. 433, no. 7026, pp. 597–603, 2005. [3] J. Soriano, M. R. Mart´ınez, T. Tlusty, and E. Moses, “Development of input connections in neural cultures,” Proc. Nat. Acad. Sci., vol. 105, no. 37, pp. 13 758–13 763, 2008. [4] C. Stosiek, O. Garaschuk, K. Holthoff, and A. Konnerth, “In vivo two-photon calcium imaging of neuronal networks,” Proc. Nat. Acad. Sci., vol. 100, no. 12, pp. 7319–7324, 2003. 8 [5] K. Svoboda and R. Yasuda, “Principles of two-photon excitation microscopy and its applications to neuroscience,” Neuron, vol. 50, no. 6, pp. 823–839, 2006. [6] O. Yizhar, L. E. Fenno, T. J. Davidson, M. Mogri, and K. Deisseroth, “Optogenetics in neural systems,” Neuron, vol. 71, no. 1, pp. 9–34, 2011. [7] Y. Mishchenko, J. T. Vogelstein, and L. Paninski, “A Bayesian approach for inferring neuronal connectivity from calcium fluorescent imaging data,” Ann. Appl. Stat., vol. 5, no. 2B, pp. 1229–1261, Feb. 2011. [8] O. Stetter, D. Battaglia, J. Soriano, and T. Geisel, “Model-free reconstruction of excitatory neuronal connectivity from calcium imaging signals,” PLoS Computational Biology, vol. 8, no. 8, p. e1002653, 2012. [9] A. Dempster, N. M. Laird, and D. B. Rubin, “Maximum-likelihood from incomplete data via the EM algorithm,” J. Roy. Statist. Soc., vol. 39, pp. 1–17, 1977. [10] A. Doucet, S. Godsill, and C. Andrieu, “On sequential Monte Carlo sampling methods for Bayesian filtering,” Statistics and Computing, vol. 10, no. 3, pp. 197–208, 2000. [11] A. Doucet and A. M. Johansen, “A tutorial on particle filtering and smoothing: Fifteen years later,” Handbook of Nonlinear Filtering, vol. 12, pp. 656–704, 2009. [12] P. Dayan and L. F. Abbott, Theoretical Neuroscience. Computational and Mathematical Modeling of Neural Systems. MIT Press, 2001. [13] J. T. Vogelstein, B. O. Watson, A. M. Packer, R. Yuste, B. Jedynak, and L. Paninski, “Spike inference from calcium imaging using sequential monte carlo methods,” Biophysical J., vol. 97, no. 2, pp. 636–655, 2009. [14] M. J. Wainwright and M. I. Jordan, “Graphical models, exponential families, and variational inference,” Found. Trends Mach. Learn., vol. 1, 2008. [15] D. L. Donoho, A. Maleki, and A. Montanari, “Message-passing algorithms for compressed sensing,” Proc. Nat. Acad. Sci., vol. 106, no. 45, pp. 18 914–18 919, Nov. 2009. [16] T. P. Minka, “A family of algorithms for approximate Bayesian inference,” Ph.D. dissertation, Massachusetts Institute of Technology, Cambridge, MA, 2001. [17] A. K. Fletcher, S. Rangan, L. Varshney, and A. Bhargava, “Neural reconstruction with approximate message passing (NeuRAMP),” in Proc. Neural Information Process. Syst., Granada, Spain, Dec. 2011. [18] U. S. Kamilov, S. Rangan, A. K. Fletcher, and M. Unser, “Approximate message passing with consistent parameter estimation and applications to sparse learning,” in Proc. NIPS, Lake Tahoe, NV, Dec. 2012. [19] S. Rangan, A. K. Fletcher, V. K. Goyal, and P. Schniter, “Hybrid generalized approximation message passing with applications to structured sparsity,” in Proc. IEEE Int. Symp. Inform. Theory, Cambridge, MA, Jul. 2012, pp. 1241–1245. [20] D. L. Donoho, “Compressed sensing,” IEEE Trans. Inform. Theory, vol. 52, no. 4, pp. 1289–1306, Apr. 2006. [21] A. K. Fletcher and S. Rangan, “Scalable inference for neuronal connectivity from calcium imaging,” arXiv:1409.0289, Sep. 2014. [22] R. Tibshirani, “Regression shrinkage and selection via the lasso,” J. Royal Stat. Soc., Ser. B, vol. 58, no. 1, pp. 267–288, 1996. [23] C. M. Bishop, Pattern Recognition and Machine Learning, ser. Information Science and Statistics. New York, NY: Springer, 2006. [24] R. Sayer, M. Friedlander, and S. Redman, “The time course and amplitude of EPSPs evoked at synapses between pairs of CA3/CA1 neurons in the hippocampal slice,” J. Neuroscience, vol. 10, no. 3, pp. 826– 836, 1990. 9
2014
355
5,464
Minimax-optimal Inference from Partial Rankings Bruce Hajek UIUC b-hajek@illinois.edu Sewoong Oh UIUC swoh@illinois.edu Jiaming Xu UIUC jxu18@illinois.edu Abstract This paper studies the problem of rank aggregation under the Plackett-Luce model. The goal is to infer a global ranking and related scores of the items, based on partial rankings provided by multiple users over multiple subsets of items. A question of particular interest is how to optimally assign items to users for ranking and how many item assignments are needed to achieve a target estimation error. Without any assumptions on how the items are assigned to users, we derive an oracle lower bound and the Cram´er-Rao lower bound of the estimation error. We prove an upper bound on the estimation error achieved by the maximum likelihood estimator, and show that both the upper bound and the Cram´er-Rao lower bound inversely depend on the spectral gap of the Laplacian of an appropriately defined comparison graph. Since random comparison graphs are known to have large spectral gaps, this suggests the use of random assignments when we have the control. Precisely, the matching oracle lower bound and the upper bound on the estimation error imply that the maximum likelihood estimator together with a random assignment is minimax-optimal up to a logarithmic factor. We further analyze a popular rankbreaking scheme that decompose partial rankings into pairwise comparisons. We show that even if one applies the mismatched maximum likelihood estimator that assumes independence (on pairwise comparisons that are now dependent due to rank-breaking), minimax optimal performance is still achieved up to a logarithmic factor. 1 Introduction Given a set of individual preferences from multiple decision makers or judges, we address the problem of computing a consensus ranking that best represents the preference of the population collectively. This problem, known as rank aggregation, has received much attention across various disciplines including statistics, psychology, sociology, and computer science, and has found numerous applications including elections, sports, information retrieval, transportation, and marketing [1, 2, 3, 4]. While consistency of various rank aggregation algorithms has been studied when a growing number of sampled partial preferences is observed over a fixed number of items [5, 6], little is known in the high-dimensional setting where the number of items and number of observed partial rankings scale simultaneously, which arises in many modern datasets. Inference becomes even more challenging when each individual provides limited information. For example, in the well known Netflix challenge dataset, 480,189 users submitted ratings on 17,770 movies, but on average a user rated only 209 movies. To pursue a rigorous study in the high-dimensional setting, we assume that users provide partial rankings over subsets of items generated according to the popular PlackettLuce (PL) model [7] from some hidden preference vector over all the items and are interested in estimating the preference vector (see Definition 1). Intuitively, inference becomes harder when few users are available, or each user is assigned few items to rank, meaning fewer observations. The first goal of this paper is to quantify the number of item assignments needed to achieve a target estimation error. Secondly, in many practical scenarios such as crowdsourcing, the systems have the control over the item assignment. For such systems, a 1 natural question of interest is how to optimally assign the items for a given budget on the total number of item assignments. Thirdly, a common approach in practice to deal with partial rankings is to break them into pairwise comparisons and apply the state-of-the-art rank aggregation methods specialized for pairwise comparisons [8, 9]. It is of both theoretical and practical interest to understand how much the performance degrades when rank breaking schemes are used. Notation. For any set S, let |S| denote its cardinality. Let sn 1 = {s1, . . . , sn} denote a set with n elements. For any positive integer N, let [N] = {1, . . . , N}. We use standard big O notations, e.g., for any sequences {an} and {bn}, an = Θ(bn) if there is an absolute constant C > 0 such that 1/C ≤an/bn ≤C. For a partial ranking σ over S, i.e., σ is a mapping from [|S|] to S, let σ−1 denote the inverse mapping. All logarithms are natural unless the base is explicitly specified. We say a sequence of events {An} holds with high probability if P[An] ≥1 −c1n−c2 for two positive constants c1, c2. 1.1 Problem setup We describe our model in the context of recommender systems, but it is applicable to other systems with partial rankings. Consider a recommender system with m users indexed by [m] and n items indexed by [n]. For each item i ∈[n], there is a hidden parameter θ∗ i measuring the underlying preference. Each user j, independent of everyone else, randomly generates a partial ranking σj over a subset of items Sj ⊆[n] according to the PL model with the underlying preference vector θ∗= (θ∗ 1, . . . , θ∗ n). Definition 1 (PL model). A partial ranking σ : [|S|] →S is generated from {θ∗ i , i ∈S} under the PL model in two steps: (1) independently assign each item i ∈S an unobserved value Xi, exponentially distributed with mean e−θ∗ i ; (2) select σ so that Xσ(1) ≤Xσ(2) ≤· · · ≤Xσ(|S|). The PL model can be equivalently described in the following sequential manner. To generate a partial ranking σ, first select σ(1) in S randomly from the distribution eθ∗ i / P i′∈S eθ∗ i′  ; secondly, select σ(2) in S \ {σ(1)} with the probability distribution eθ∗ i / P i′∈S\{σ(1)} eθ∗ i′  ; continue the process in the same fashion until all the items in S are assigned. The PL model is a special case of the following class of models. Definition 2 (Thurstone model, or random utility model (RUM) ). A partial ranking σ : [|S|] →S is generated from {θ∗ i , i ∈S} under the Thurstone model for a given CDF F in two steps: (1) independently assign each item i ∈S an unobserved utility Ui, with CDF F(c −θ∗ i ); (2) select σ so that Uσ(1) ≥Uσ(2) ≥· · · ≥Uσ(|S|). To recover the PL model from the Thurstone model, take F to be the CDF for the standard Gumbel distribution: F(c) = e−(e−c). Equivalently, take F to be the CDF of −log(X) such that X has the exponential distribution with mean one. For this choice of F, the utility Ui having CDF F(c −θ∗ i ), is equivalent to Ui = −log(Xi) such that Xi is exponentially distributed with mean e−θ∗ i . The corresponding partial permutation σ is such that Xσ(1) ≤Xσ(2) ≤· · · ≤Xσ(|S|), or equivalently, Uσ(1) ≥Uσ(2) ≥· · · ≥Uσ(|S|). (Note the opposite ordering of X’s and U’s.) Given the observation of all partial rankings {σj}j∈[m] over the subsets {Sj}j∈[m] of items, the task is to infer the underlying preference vector θ∗. For the PL model, and more generally for the Thurstone model, we see that θ∗and θ∗+ a1 for any a ∈R are statistically indistinguishable, where 1 is an all-ones vector. Indeed, under our model, the preference vector θ∗is the equivalence class [θ∗] = {θ : ∃a ∈R, θ = θ∗+ a1}. To get a unique representation of the equivalence class, we assume Pn i=1 θ∗ i = 0. Then the space of all possible preference vectors is given by Θ = {θ ∈Rn : Pn i=1 θi = 0}. Moreover, if θ∗ i −θ∗ i′ becomes arbitrarily large for all i′ ̸= i, then with high probability item i is ranked higher than any other item i′ and there is no way to estimate θi to any accuracy. Therefore, we further put the constraint that θ∗∈[−b, b]n for some b ∈R and define Θb = Θ ∩[−b, b]n. The parameter b characterizes the dynamic range of the underlying preference. In this paper, we assume b is a fixed constant. As observed in [10], if b were scaled with n, then it would be easy to rank items with high preference versus items with low preference and one can focus on ranking items with close preference. 2 We denote the number of items assigned to user j by kj := |Sj| and the average number of assigned items per use by k = 1 m Pm j=1 kj; parameter k may scale with n in this paper. We consider two scenarios for generating the subsets {Sj}m j=1: the random item assignment case where the Sj’s are chosen independently and uniformly at random from all possible subsets of [n] with sizes given by the kj’s, and the deterministic item assignment case where the Sj’s are chosen deterministically. Our main results depend on the structure of a weighted undirected graph G defined as follows. Definition 3 (Comparison graph G). Each item i ∈[n] corresponds to a vertex i ∈[n]. For any pair of vertices i, i′, there is a weighted edge between them if there exists a user who ranks both items i and i′; the weight equals P j:i,i′∈Sj 1 kj−1. Let A denote the weighted adjacency matrix of G. Let di = P j Aij, so di is the number of users who rank item i, and without loss of generality assume d1 ≤d2 ≤· · · ≤dn. Let D denote the n×n diagonal matrix formed by {di, i ∈[n]} and define the graph Laplacian L as L = D −A. Observe that L is positive semi-definite and the smallest eigenvalue of L is zero with the corresponding eigenvector given by the normalized all-one vector. Let 0 = λ1 ≤λ2 ≤· · · ≤λn denote the eigenvalues of L in ascending order. Summary of main results. Theorem 1 gives a lower bound for the estimation error that scales as Pn i=2 1 di . The lower bound is derived based on a genie-argument and holds for both the PL model and the more general Thurstone model. Theorem 2 shows that the Cram´er-Rao lower bound scales as Pn i=2 1 λi . Theorem 3 gives an upper bound for the squared error of the maximum likelihood (ML) estimator that scales as mk log n (λ2−√λn)2 . Under the full rank breaking scheme that decomposes a k-way comparison into k 2  pairwise comparisons, Theorem 4 gives an upper bound that scales as mk log n λ2 2 . If the comparison graph is an expander graph, i.e., λ2 ∼λn and mk = Ω(n log n), our lower and upper bounds match up to a log n factor. This follows from the fact that P i λi = P i di = mk, and for expanders mk = Θ(nλ2). Since the Erd˝os-R´enyi random graph is an expander graph with high probability for average degree larger than log n, when the system is allowed to choose the item assignment, we propose a random assignment scheme under which the items for each user are chosen independently and uniformly at random. It follows from Theorem 1 that mk = Ω(n) is necessary for any item assignment scheme to reliably infer the underlying preference vector, while our upper bounds imply that mk = Ω(n log n) is sufficient with the random assignment scheme and can be achieved by either the ML estimator or the full rank breaking or the independence-preserving breaking that decompose a k-way comparison into ⌊k/2⌋non-intersecting pairwise comparisons, proving that rank breaking schemes are also nearly optimal. 1.2 Related Work There is a vast literature on rank aggregation, and here we can only hope to cover a fraction of them we see most relevant. In this paper, we study a statistical learning approach, assuming the observed ranking data is generated from a probabilistic model. Various probabilistic models on permutations have been studied in the ranking literature (see, e.g., [11, 12]). A nonparametric approach to modeling distributions over rankings using sparse representations has been studied in [13]. Most of the parametric models fall into one of the following three categories: noisy comparison model, distance based model, and random utility model. The noisy comparison model assumes that there is an underlying true ranking over n items, and each user independently gives a pairwise comparison which agrees with the true ranking with probability p > 1/2. It is shown in [14] that O(n log n) pairwise comparisons, when chosen adaptively, are sufficient for accurately estimating the true ranking. The Mallows model is a distance-based model, which randomly generates a full ranking σ over n items from some underlying true ranking σ∗with probability proportional to e−βd(σ,σ∗), where β is a fixed spread parameter and d(·, ·) can be any permutation distance such as the Kemeny distance. It is shown in [14] that the true ranking σ∗can be estimated accurately given O(log n) independent full rankings generated under the Mallows model with the Kemeny distance. In this paper, we study a special case of random utility models (RUMs) known as the Plackett-Luce (PL) model. It is shown in [7] that the likelihood function under the PL model is concave and the ML estimator can be efficiently found using a minorization-maximization (MM) algorithm which is 3 a variation of the general EM algorithm. We give an upper bound on the error achieved by such an ML estimator, and prove that this is matched by a lower bound. The lower bound is derived by comparing to an oracle estimator which observes the random utilities of RUM directly. The BradleyTerry (BT) model is the special case of the PL model where we only observe pairwise comparisons. For the BT model, [10] proposes RankCentrality algorithm based on the stationary distribution of a random walk over a suitably defined comparison graph and shows Ω(npoly(log n)) randomly chosen pairwise comparisons are sufficient to accurately estimate the underlying parameters; one corollary of our result is a matching performance guarantee for the ML estimator under the BT model. More recently, [15] analyzed various algorithms including RankCentrality and the ML estimator under a general, not necessarily uniform, sampling scheme. In a PL model with priors, MAP inference becomes computationally challenging. Instead, an efficient message-passing algorithm is proposed in [16] to approximate the MAP estimate. For a more general family of random utility models, Soufiani et al. in [17, 18] give a sufficient condition under which the likelihood function is concave, and propose a Monte-Carlo EM algorithm to compute the ML estimator for general RUMs. More recently in [8, 9], the generalized method of moments together with the rank-breaking is applied to estimate the parameters of the PL model and the random utility model when the data consists of full rankings. 2 Main results In this section, we present our theoretical findings and numerical experiments. 2.1 Oracle lower bound In this section, we derive an oracle lower bound for any estimator of θ∗. The lower bound is constructed by considering an oracle who reveals all the hidden scores in the PL model as side information and holds for the general Thurstone models. Theorem 1. Suppose σm 1 are generated from the Thurstone model for some CDF F. For any estimator bθ, inf bθ sup θ∗∈Θb E[||bθ −θ∗||2 2] ≥ 1 2I(µ) + 2π2 b2(d1+d2) n X i=2 1 di ≥ 1 2I(µ) + 2π2 b2(d1+d2) (n −1)2 mk , where µ is the probability density function of F, i.e., µ = F ′ and I(µ) = R (µ′(x)) 2 µ(x) dx; the second inequality follows from the Jensen’s inequality. For the PL model, which is a special case of the Thurstone models with F being the standard Gumbel distribution, I(µ) = 1. Theorem 1 shows that the oracle lower bound scales as Pn i=2 1 di . We remark that the summation begins with 1/d2. This makes some sense, in view of the fact that the parameters θ∗ i need to sum to zero. For example, if d1 is a moderate value and all the other di’s are very large, then with the hidden scores as side information, we may be able to accurately estimate θ∗ i for i ̸= 1 and therefore accurately estimate θ∗ 1. The oracle lower bound also depends on the dynamic range b and is tight for b = 0, because a trivial estimator that always outputs the all-zero vector achieves the lower bound. Comparison to previous work Theorem 1 implies that mk = Ω(n) is necessary for any item assignment scheme to reliably infer θ∗, i.e., ensuring E[||bθ−θ∗||2 2] = o(n). It provides the first converse result on inferring the parameter vector under the general Thurstone models to our knowledge. For the Bradley-Terry model, which is a special case of the PL model where all the partial rankings reduce to the pairwise comparisons, i.e., k = 2, it is shown in [10] that m = Ω(n) is necessary for the random item assignment scheme to achieve the reliable inference based on the informationtheoretic argument. In contrast, our converse result is derived based on the Bayesian Cram´e-Rao lower bound [19], applies to the general models with any item assignment, and is considerably tighter if di’s are of different orders. 2.2 Cram´er-Rao lower bound In this section, we derive the Cram´er-Rao lower bound for any unbiased estimator of θ∗. 4 Theorem 2. Let kmax = maxj∈[m] kj and U denote the set of all unbiased estimators of θ∗, i.e., bθ ∈U if and only if E[bθ|θ∗= θ] = θ, ∀θ ∈Θb. If b > 0, then inf bθ∈U sup θ∗∈Θb E[∥bθ −θ∗∥2 2] ≥ 1 − 1 kmax kmax X ℓ=1 1 ℓ !−1 n X i=2 1 λi ≥ 1 − 1 kmax kmax X ℓ=1 1 ℓ !−1 (n −1)2 mk , where the second inequality follows from the Jensen’s inequality. The Cram´er-Rao lower bound scales as Pn i=2 1 λi . When G is disconnected, i.e., all the items can be partitioned into two groups such that no user ever compares an item in one group with an item in the other group, λ2 = 0 and the Cram´er-Rao lower bound is infinity, which is valid (and of course tight) because there is no basis for gauging any item in one connected component with respect to any item in the other connected component and the accurate inference is impossible for any estimator. Although the Cram´er-Rao lower bound only holds for any unbiased estimator, we suspect that a lower bound with the same scaling holds for any estimator, but we do not have a proof. 2.3 ML upper bound In this section, we study the ML estimator based on the partial rankings. The ML estimator of θ∗is defined as bθML ∈arg maxθ∈Θb L(θ), where L(θ) is the log likelihood function given by L(θ) = log Pθ[σm 1 ] = m X j=1 kj−1 X ℓ=1  θσj(ℓ) −log exp(θσj(ℓ)) + · · · + exp(θσj(kj))  . (1) As observed in [7], L(θ) is concave in θ and thus the ML estimator can be efficiently computed either via the gradient descent method or the EM type algorithms. The following theorem gives an upper bound on the error rates inversely dependent on λ2. Intuitively, by the well-known Cheeger’s inequality, if the spectral gap λ2 becomes larger, then there are more edges across any bi-partition of G, meaning more pairwise comparisons are available between any bi-partition of movies, and therefore θ∗can be estimated more accurately. Theorem 3. Assume λn ≥C log n for a sufficiently large constant C in the case with k > 2. Then with high probability, ∥bθML −θ∗∥2 ≤ ( 4(1 + e2b)2λ−1 2 √m log n If k = 2, 8e4b√2mk log n λ2−16e2b√λn log n If k > 2. We compare the above upper bound with the Cram´er-Rao lower bound given by Theorem 2. Notice that Pn i=1 λi = mk and λ1 = 0. Therefore, mk λ2 2 ≥Pn i=2 1 λi and the upper bound is always larger than the Cram´er-Rao lower bound. When the comparison graph G is an expander and mk = Ω(n log n), by the well-known Cheeger’s inequality, λ2 ∼λn = Ω(log n) , the upper bound is only larger than the Cram´er-Rao lower bound by a logarithmic factor. In particular, with the random item assignment scheme, we show that λ2, λn ∼mk n if mk ≥C log n and as a corollary of Theorem 3, mk = Ω(n log n) is sufficient to ensure ∥bθML−θ∗∥2 = o(√n), proving the random item assignment scheme with the ML estimation is minimax-optimal up to a log n factor. Corollary 1. Suppose Sm 1 are chosen independently and uniformly at random among all possible subsets of [n]. Then there exists a positive constant C > 0 such that if m ≥Cn log n when k = 2 and mk ≥Ce2b log n when k > 2, then with high probability ∥bθML −θ∗∥2 ≤    4(1 + e2b)2 q n2 log n m , if k = 2, 32e4b q 2n2 log n mk , if k > 2. Comparison to previous work Theorem 3 provides the first finite-sample error rates for inferring the parameter vector under the PL model to our knowledge. For the Bradley-Terry model, which is a special case of the PL model with k = 2, [10] derived the similar performance guarantee by analyzing the rank centrality algorithm and the ML estimator. More recently, [15] extended the results to the non-uniform sampling scheme of item pairs, but the performance guarantees obtained when specialized to the uniform sampling scheme require at least m = Ω(n4 log n) to ensure ∥bθ − θ∗∥2 = o(√n), while our results only require m = Ω(n log n). 5 2.4 Rank breaking upper bound In this section, we study two rank-breaking schemes which decompose partial rankings into pairwise comparisons. Definition 4. Given a partial ranking σ over the subset S ⊂[n] of size k, the independencepreserving breaking scheme (IB) breaks σ into ⌊k/2⌋non-intersecting pairwise comparisons of form {it, i′ t, yt}⌊k/2⌋ t=1 such that {is, i′ s} ∩{it, i′ t} = ∅for any s ̸= t and yt = 1 if σ−1(it) < σ−1(i′ t) and 0 otherwise. The random IB chooses {it, i′ t}⌊k/2⌋ t=1 uniformly at random among all possibilities. If σ is generated under the PL model, then the IB breaks σ into independent pairwise comparisons generated under the PL model. Hence, we can first break partial rankings σm 1 into independent pairwise comparisons using the random IB and then apply the ML estimator on the generated pairwise comparisons with the constraint that θ ∈Θb, denoted by bθIB. Under the random assignment scheme, as a corollary of Theorem 3, mk = Ω(n log n) is sufficient to ensure ∥bθIB −θ∗∥2 = o(√n), proving the random item assignment scheme with the random IB is minimax-optimal up to a log n factor in view of the oracle lower bound in Theorem 1. Corollary 2. Suppose Sm 1 are chosen independently and uniformly at random among all possible subsets of [n] with size k. There exists a positive constant C > 0 such that if mk ≥Cn log n, then with high probability, ∥bθIB −θ∗∥2 ≤4(1 + e2b)2 r 2n2 log n mk . Definition 5. Given a partial ranking σ over the subset S ⊂[n] of size k, the full breaking scheme (FB) breaks σ into all k 2  possible pairwise comparisons of form {it, i′ t, yt}( k 2) t=1 such that yt = 1 if σ−1(it) < σ−1(i′ t) and 0 otherwise. If σ is generated under the PL model, then the FB breaks σ into pairwise comparisons which are not independently generated under the PL model. We pretend the pairwise comparisons induced from the full breaking are all independent and maximize the weighted log likelihood function given by L(θ) = m X j=1 1 2(kj −1) X i,i′∈Sj  θiI{σ−1 j (i)<σ−1 j (i′)} + θi′I{σ−1 j (i)>σ−1 j (i′)} −log eθi + eθi′  (2) with the constraint that θ ∈Θb. Let bθFB denote the maximizer. Notice that we put the weight 1 kj−1 to adjust the contributions of the pairwise comparisons generated from the partial rankings over subsets with different sizes. Theorem 4. With high probability, ∥bθFB −θ∗∥2 ≤2(1+e2b)2 √mk log n λ2 . Furthermore, suppose Sm 1 are chosen independently and uniformly at random among all possible subsets of [n]. There exists a positive constant C > 0 such that if mk ≥Cn log n, then with high probability, ∥bθFB −θ∗∥2 ≤ 4(1 + e2b)2 q n2 log n mk . Theorem 4 shows that the error rates of bθFB inversely depend on λ2. When the comparison graph G is an expander, i.e., λ2 ∼λn, the upper bound is only larger than the Cram´er-Rao lower bound by a logarithmic factor. The similar observation holds for the ML estimator as shown in Theorem 3. With the random item assignment scheme, Theorem 4 imply that the FB only need mk = Ω(n log n) to achieve the reliable inference, which is optimal up to a log n factor in view of the oracle lower bound in Theorem 1. Comparison to previous work The rank breaking schemes considered in [8, 9] breaks the full rankings according to rank positions while our schemes break the partial rankings according to the item indices. The results in [8, 9] establish the consistency of the generalized method of moments under the rank breaking schemes when the data consists of full rankings. In contrast, Corollary 2 and Theorem 4 apply to the more general setting with partial rankings and provide the finite-sample error rates, proving the optimality of the random IB and FB with the random item assignment scheme. 6 2.5 Numerical experiments Suppose there are n = 1024 items and θ∗is uniformly distributed over [−b, b]. We first generate d full rankings over 1024 items according to the PL model with parameter θ∗. Then for each fixed k ∈{512, 256, . . . , 2}, we break every full ranking σ into n/k partial rankings over subsets of size k as follows: Let {Sj}n/k j=1 denote a partition of [n] generated uniformly at random such that Sj ∩Sj′ = ∅for j ̸= j′ and |Sj| = k for all j; generate {σj}n/k j=1 such that σj is the partial ranking over set Sj consistent with σ. In this way, in total we get m = dn/k k-way comparisons which are all independently generated from the PL model. We apply the minorization-maximization (MM) algorithm proposed in [7] to compute the ML estimator bθML based on the k-way comparisons and the estimator bθFB based on the pairwise comparisons induced by the FB. The estimation error is measured by the rescaled mean square error (MSE) defined by log2  mk n2 ∥bθ −θ∗∥2 2  . We run the simulation with b = 2 and d = 16, 64. The results are depicted in Fig. 1. We also plot the Cram´er-Rao (CR) limit given by log2  1 −1 k Pk l=1 1 l −1 as per Theorem 2. The oracle lower bound in Theorem 1 implies that the rescaled MSE is at least 0. We can see that the rescaled MSE of the ML estimator bθML is close to the CR limit and approaches the oracle lower bound as k becomes large, suggesting the ML estimator is minimax-optimal. Furthermore, the rescaled MSE of bθFB under FB is approximately twice larger than the CR limit, suggesting that the FB is minimax-optimal up to a constant factor. 1 2 3 4 5 6 7 8 9 10 0 0.5 1 1.5 2 2.5 3 log2(k) Rescaled MSE FB (d=16) FB (d=64) d=16 d=64 CR Limit Figure 1: The error rate based on nd/k k-way comparisons with and without full breaking. Finally, we point out that when d = 16 and log2(k) = 1, the MSE returned by the MM algorithm is infinity. Such singularity occurs for the following reason. Suppose we consider a directed comparison graph with nodes corresponding to items such that for each (i, j), there is a directed edge (i →j) if item i is ever ranked higher than j. If the graph is not strongly connected, i.e., if there exists a partition of the items into two groups A and B such that items in A are always ranked higher than items in B, then if all {θi : i ∈A} are increased by a positive constant a, and all {θi : i ∈B} are decreased by another positive constant a′ such that all {θi, i ∈[n]} still sum up to zero, the log likelihood (1) must increase; thus, the log likelihood has no maximizer over the parameter space Θ, and the MSE returned by the MM algorithm will diverge. Theoretically, if b is a constant and d exceeds the order of log n, the directed comparison graph will be strongly connected with high probability and so such singularity does not occur in our numerical experiments when d ≥64. In practice we can deal with this singularity issue in three ways: 1) find the strongly connected components and then run MM in each component to come up with an estimator of θ∗restricted to each component; 2) introduce a proper prior on the parameters and use Bayesian inference to come up with an estimator (see [16]); 3) add to the log likelihood objective function a regularization term based on ∥θ∥2 and solve the regularized ML using the gradient descent algorithms (see [10]). 7 3 Proofs We sketch the proof of our two upper bounds given by Theorem 3 and Theorem 4. The proofs of other results can be found in the supplementary file. We introduce some additional notations used in the proof. For a vector x, let ∥x∥2 denote the usual l2 norm. Let 1 denote the all-one vector and 0 denote the all-zero vector with the appropriate dimension. Let Sn denote the set of n × n symmetric matrices with real-valued entries. For X ∈Sn, let λ1(X) ≤λ2(X) ≤· · · ≤λn(X) denote its eigenvalues sorted in increasing order. Let Tr(X) = Pn i=1 λi(X) denote its trace and ∥X∥= max{−λ1(X), λn(X)} denote its spectral norm. For two matrices X, Y ∈Sn, we write X ≤Y if Y −X is positive semi-definite, i.e., λ1(Y −X) ≥0. Recall that L(θ) is the log likelihood function. Let ∇L(θ) denote its gradient and H(θ) ∈Sn denote its Hessian matrix. 3.1 Proof of Theorem 3 The main idea of the proof is inspired from the proof of [10, Theorem 4]. We first introduce several key auxiliary results used in the proof. Observe that Eθ∗[∇L(θ∗)] = 0. The following lemma upper bounds the deviation of ∇L(θ∗) from its mean. Lemma 1. With probability at least 1 −2e2 n , ∥∇L(θ∗)∥2 ≤ p 2mk log n (3) Observed that −H(θ) is positive semi-definite with the smallest eigenvalue equal to zero. The following lemma lower bounds its second smallest eigenvalue. Lemma 2. Fix any θ ∈Θb. Then λ2 (−H(θ)) ≥ ( e2b (1+e2b)2 λ2 If k = 2, 1 4e4b λ2 −16e2b√λn log n  If k > 2, (4) where the inequality holds with probability at least 1 −n−1 in the case with k > 2. Proof of Theorem 3. Define ∆= bθML −θ∗. It follows from the definition that ∆is orthogonal to the all-one vector. By the definition of the ML estimator, L(bθML) ≥L(θ∗) and thus L(ˆθML) −L(θ∗) −⟨∇L(θ∗), ∆⟩≥−⟨∇L(θ∗), ∆⟩≥−∥∇L(θ∗)∥2∥∆∥2, (5) where the last inequality holds due to the Cauchy-Schwartz inequality. By the Taylor expansion, there exists a θ = abθML + (1 −a)θ∗for some a ∈[0, 1] such that L(ˆθML) −L(θ∗) −⟨∇L(θ∗), ∆⟩= 1 2∆⊤H(θ)∆≤−1 2λ2(−H(θ))∥∆∥2 2, (6) where the last inequality holds because the Hessian matrix −H(θ) is positive semi-definite with H(θ)1 = 0 and ∆⊤1 = 0. Combining (5) and (6), ∥∆∥2 ≤2∥∇L(θ∗)∥2/λ2(−H(θ)). (7) Note that θ ∈Θb by definition. The theorem follows by Lemma 1 and Lemma 2. 3.2 Proof of Theorem 4 It follows from the definition of L(θ) given by (2) that ∇iL(θ∗) = X j:i∈Sj 1 kj −1 X i′∈Sj:i′̸=i  I{σ−1 j (i)<σ−1 j (i′)} − exp(θ∗ i ) exp(θ∗ i ) + exp(θ∗ i′)  , (8) which is a sum of di independent random variables with mean zero and bounded by 1. By Hoeffding’s inequality, |∇iL(θ∗)| ≤√di log n with probability at least 1 −2n−2. By union bound, ∥∇L(θ∗)∥2 ≤√mk log n with probability at least 1 −2n−1. The Hessian matrix is given by H(θ) = − m X j=1 1 2(kj −1) X i,i′∈Sj (ei −ei′)(ei −ei′)⊤ exp(θi + θi′) [exp(θi) + exp(θi′)]2 . If |θi| ≤b, ∀i ∈[n], exp(θi+θi′) [exp(θi)+exp(θi′)]2 ≥ e2b (1+e2b)2 . It follows that −H(θ) ≥ e2b (1+e2b)2 L for θ ∈Θb and the theorem follows from (7). 8 References [1] M. E. Ben-Akiva and S. R. Lerman, Discrete choice analysis: theory and application to travel demand. MIT press, 1985, vol. 9. [2] P. M. Guadagni and J. D. Little, “A logit model of brand choice calibrated on scanner data,” Marketing science, vol. 2, no. 3, pp. 203–238, 1983. [3] D. McFadden, “Econometric models for probabilistic choice among products,” Journal of Business, vol. 53, no. 3, pp. S13–S29, 1980. [4] P. Sham and D. Curtis, “An extended transmission/disequilibrium test (TDT) for multi-allele marker loci,” Annals of human genetics, vol. 59, no. 3, pp. 323–336, 1995. [5] G. Simons and Y. Yao, “Asymptotics when the number of parameters tends to infinity in the Bradley-Terry model for paired comparisons,” The Annals of Statistics, vol. 27, no. 3, pp. 1041–1060, 1999. [6] J. C. Duchi, L. Mackey, and M. I. Jordan, “On the consistency of ranking algorithms,” in Proceedings of the ICML Conference, Haifa, Israel, June 2010. [7] D. R. Hunter, “MM algorithms for generalized Bradley-Terry models,” The Annals of Statistics, vol. 32, no. 1, pp. 384–406, 02 2004. [8] H. A. Soufiani, W. Chen, D. C. Parkes, and L. Xia, “Generalized method-of-moments for rank aggregation,” in Advances in Neural Information Processing Systems 26, 2013, pp. 2706–2714. [9] H. Azari Soufiani, D. Parkes, and L. Xia, “Computing parametric ranking models via rankbreaking,” in Proceedings of the International Conference on Machine Learning, 2014. [10] S. Negahban, S. Oh, and D. Shah, “Rank centrality: Ranking from pair-wise comparisons,” arXiv:1209.1688, 2012. [11] T. Qin, X. Geng, and T. yan Liu, “A new probabilistic model for rank aggregation,” in Advances in Neural Information Processing Systems 23, 2010, pp. 1948–1956. [12] J. A. Lozano and E. Irurozki, “Probabilistic modeling on rankings,” Available at http://www. sc.ehu.es/ccwbayes/members/ekhine/tutorial ranking/info.html, 2012. [13] S. Jagabathula and D. Shah, “Inferring rankings under constrained sensing.” in NIPS, vol. 2008, 2008. [14] M. Braverman and E. Mossel, “Sorting from noisy information,” arXiv:0910.1191, 2009. [15] A. Rajkumar and S. Agarwal, “A statistical convergence perspective of algorithms for rank aggregation from pairwise data,” in Proceedings of the International Conference on Machine Learning, 2014. [16] J. Guiver and E. Snelson, “Bayesian inference for Plackett-Luce ranking models,” in Proceedings of the 26th Annual International Conference on Machine Learning, New York, NY, USA, 2009, pp. 377–384. [17] A. S. Hossein, D. C. Parkes, and L. Xia, “Random utility theory for social choice,” in Proceeedings of the 25th Annual Conference on Neural Information Processing Systems, 2012. [18] H. A. Soufiani, D. C. Parkes, and L. Xia, “Preference elicitation for general random utility models,” arXiv preprint arXiv:1309.6864, 2013. [19] R. D. Gill and B. Y. Levit, “Applications of the van Trees inequality: a Bayesian Cram´er-Rao bound,” Bernoulli, vol. 1, no. 1-2, pp. 59–79, 03 1995. 9
2014
356
5,465
Neurons as Monte Carlo Samplers: Bayesian Inference and Learning in Spiking Networks Yanping Huang University of Washington huangyp@cs.uw.edu Rajesh P.N. Rao University of Washington rao@cs.uw.edu Abstract We propose a spiking network model capable of performing both approximate inference and learning for any hidden Markov model. The lower layer sensory neurons detect noisy measurements of hidden world states. The higher layer neurons with recurrent connections infer a posterior distribution over world states from spike trains generated by sensory neurons. We show how such a neuronal network with synaptic plasticity can implement a form of Bayesian inference similar to Monte Carlo methods such as particle filtering. Each spike in the population of inference neurons represents a sample of a particular hidden world state. The spiking activity across the neural population approximates the posterior distribution of hidden state. The model provides a functional explanation for the Poissonlike noise commonly observed in cortical responses. Uncertainties in spike times provide the necessary variability for sampling during inference. Unlike previous models, the hidden world state is not observed by the sensory neurons, and the temporal dynamics of the hidden state is unknown. We demonstrate how such networks can sequentially learn hidden Markov models using a spike-timing dependent Hebbian learning rule and achieve power-law convergence rates. 1 Introduction Humans are able to routinely estimate unknown world states from ambiguous and noisy stimuli, and anticipate upcoming events by learning the temporal dynamics of relevant states of the world from incomplete knowledge of the environment. For example, when facing an approaching tennis ball, a player must not only estimate the current position of the ball, but also predict its trajectory by inferring the ball’s velocity and acceleration before deciding on the next stroke. Tasks such as these can be modeled using a hidden Markov model (HMM), where the relevant states of the world are latent variables X related to sensory observations Z via a likelihood model (determined by the emission probabilities). The latent states themselves evolve over time in a Markovian manner, the dynamics being governed by a transition probabilities. In these tasks, the optimal way of combining such noisy sensory information is to use Bayesian inference, where the level of uncertainty for each possible state is represented as a probability distribution [1]. Behavioral and neuropsychophysical experiments [2, 3, 4] have suggested that the brain may indeed maintain such a representation and employ Bayesian inference and learning in a great variety of tasks in perception, sensori-motor integration, and sensory adaptation. However, it remains an open question how the brain can sequentially infer the hidden state and learn the dynamics of the environment from the noisy sensory observations. Several models have been proposed based on populations of neurons to represent probability distribution [5, 6, 7, 8]. These models typically assume a static world state X. To get around this limitation, firing-rate models [9, 10] have been proposed to used responses in populations of neurons to represent the time-varying posterior distributions of arbitrary hidden Markov models with discrete states. For the continuous state space, similar models based on line attractor networks [11] 1 have been introduced for implementing the Kalman filter, which assumes all distributions are Gaussian and the dynamics is linear. Bobrowski et al. [12] proposed a spiking network model that can compute the optimal posterior distribution in continuous time. The limitation of these models is that model parameters (the emission and transition probabilities) are assumed to be known a priori. Deneve [13, 14] proposed a model for inference and learning based on the dynamics of a single neuron. However, the maximum number of world state in her model is limited to two. In this paper, we explore a neural implementation of HMMs in networks of spiking neurons that perform approximate Bayesian inference similar to the Monte Carlo method of particle filtering [15]. We show how the time-varying posterior distribution P(Xt|Z1:t) can be directly represented by mean spike counts in sub-populations of neurons. Each model neuron in the neuron population behaves as a coincidence detector, and each spike is viewed as a Monte Carlo sample of a particular world state. At each time step, the probability of a spike in one neuron is shown to approximate the posterior probability of the preferred state encoded by the neuron. Nearby neurons within the same sub-population (analogous to a cortical column) encode the same preferred state. The model thus provides a concrete neural implementation of sampling ideas previously suggested in [16, 17, 18, 19, 20]. In addition, we demonstrate how a spike-timing based Hebbian learning rule in our network can implement an online version of the Expectation-Maximization(EM) algorithm to learn the emission and transition matrices of HMMs. 2 Review of Hidden Markov Models For clarity of notation, we briefly review the equations behind a discrete-time “grid-based” Bayesian filter for a hidden Markov model. Let the hidden state be {Xk ∈X, k ∈N} with dynamics Xk+1 | (Xk = x′) ∼f(x|x′), where f(x|x′) is the transition probability density, X is a discrete state space of Xk, N is the set of time steps, and “∼” denotes distributed according to. We focus on estimating Xk by constructing its posterior distribution, based only on noisy measurements or observations {Zk} ∈Z where Z can be discrete or continuous. {Zk} are conditional independent given {Xk} and are governed by the emission probabilities Zk | (Xk = x) ∼g(z|x). The posterior probability P(Xk = i|Z1:k) = ωi k|k may be updated in two stages: a prediction stage (Eq 1) and a measurement update (or correction) stage (Eq 2): P(Xk+1 = i | Z1:k) = ωi k+1|k = PX j=1 ωj k|kf(xi|xj), (1) P(Xk+1 = i | Z1:k+1) = ωi k+1|k+1 = ωi k+1|kg(Zk+1|xi) PX j=1 ωj k+1|kg(Zk+1|xj). (2) This process is repeated for each time step. These two recursive equations above are the foundation for any exact or approximate solution to Bayesian filtering, including well-known examples such as Kalman filtering when the original continuous state space has been discretized into X bins. 3 Neural Network Model We now describe the two-layer spiking neural network model we use (depicted in the central panel of Figure 1(a)). The noisy observation Zk is not directly observed by the network, but sensed through an array of Z sensory neurons, The lower layer consists of an array of sensory neurons, each of which will be activated at time k if the observation Zk is in the receptive field. The higher layer consists of an array of inference neurons, whose activities can be defined as: s(k) = sgn(a(k) × b(k)) (3) where s(k) describes the binary response of an inference neuron at time k, the sign function sgn(x) = 1 only when x > 0. a(k) represents the sum of neuron’s recurrent inputs, which is determined by the recurrent weight matrix W among the inference neurons and the population responses sk−1 from the previous time step. b(k) represents the sum of feedforward inputs, which is determined by the feed-forward weight matrix M as well as the activities in sensory neurons. Note that Equation 3 defines the output of an abstract inference neuron which acts as a coincidence detector and fires if and only if both recurrent and sensory inputs are received. In the supplementary materials, we show that this abstract model neuron can be implemented using the standard leakyintegrate-and-fire (LIF) neurons used to model cortical neurons. 2 (a) (b) Figure 1: a. Spiking network model for sequential Monte Carlo Bayesian inference. b. Graphical representation of spike distribution propagation 3.1 Neural Representation of Probability Distributions Similar to the idea of grid-based filtering, we first divide the inference neurons into X subpopulations. s = {si l, i = 1, . . . X, l = 1, . . . , L}. We have si l(k) = 1 if there is a spike in the l-th neuron of the i-th sub-population at time step k. Each sub-population of L neurons share the same preferred world state, there being X such sub-populations representing each of X preferred states. One can, for example, view such a neuronal sub-population as a cortical column, within which neurons encode similar features [21]. Figure 1(a) illustrates how our neural network encodes a simple hidden Markov model with X = Z = 1, . . . , 100. Xk = 50 is a static state and P(Zk|Xk) is normally distributed. The network utilizes 10,000 neurons for the Monte Carlo approximation, with each state preferred by a subpopulation of 100 neurons. At time k, the network observe Zk and the corresponding sensory neuron whose receptive field contains Zk is activated and sends inputs to the inference neurons. Combining with recurrent inputs from the previous time step, the responses in the inference neurons are updated at each time step. As shown in the raster plot of Figure 1(a), the spikes across the entire inference layer population form a Monte-Carlo approximation to the current posterior distribution: ni k|k := L X l=1 si l(k) ∝ωi k|k (4) where ni k|k is the number of spiking neurons in the ith sub-population at time k, which can also be regarded as the instantaneous firing rate for sub-population i. Nk = PX i=1 ni k|k is the total spike count in the inference layer population. The set {ni k|k} represents the un-normalized conditional probabilities of Xk, so that ˆP(Xk = i|Z1:k) = ωi k|k = ni k|k/Nk. 3.2 Bayesian Inference with Stochastic Synaptic Transmission In this section, we assume the network is given the model parameters in a HMM and there is no learning in connection weights in the network. To implement the prediction Eq 1 in a spiking network, we initialize the recurrent connections between the inference neurons as the transition probabilities: Wij = f(xj|xi)/CW , where CW is a scaling constant. We will discuss how our network learns the HMM parameters from random initial synaptic weights in section 4. We define the recurrent weight Wij to be the synaptic release probability between the i-th neuron sub-population and the j-th neuron sub-population in the inference layer. Each neuron that spikes at time step k will randomly evoke, with probability Wij, one recurrent excitatory post-synaptic potential (EPSP) at time step k + 1, after some network delay. We define the number of recurrent EPSPs received by neuron l in the j-th sub-population as aj l . Thus, aj l is the sum of Nk independent (but not identically distributed) Bernoulli trials: aj l (k + 1) = X X i=1 L X l′=1 ϵi l′si l′(k), ∀l = 1 . . . L. (5) 3 where P(ϵi l = 1) = Wij and P(ϵi l = 0) = 1 −Wij. The sum aj l follows the so-called “Poisson binomial” distribution [22] and in the limit approaches the Poisson distribution: P(aj l (k + 1) ≥1) ≃ X i Wijni k|k = Nk CW ωj k+1|k (6) The detailed analysis of the distribution of ai l and the proof of equation 6 are provided in the supplementary materials. The definition of model neuron in Eq 3 indicates that recurrent inputs alone are not strong enough to make the inference neurons fire – these inputs leave the neurons partially activated. We can view these partially activated neurons as the proposed samples drawn from the prediction density P(Xk+1|Xk). Let nj k+1|k be the number of proposed samples in j-th sub-population, we have E[nj k+1|k|{ni k|k}] = L X X i=1 Wij ni k|k = L Nk CW ωj k+1|k ∝Var[nj k+1|k|{ni k|k}] (7) Thus, the prediction probability in equation 1 is represented by the expected number of neurons that receive recurrent inputs. When a new observation Zk+1 is received, the network will correct the prediction distribution based on the current observation. Similar to rejection sampling used in sequential Monte Carlo algorithms [15], these proposed samples are accepted with a probability proportional to the observation likelihood P(Zk+1|Xk+1). We assume for simplicity that receptive fields of sensory neurons do not overlap with each other (in the supplementary materials, we discuss the more general overlapping case). Again we define the feedforward weight Mij to be the synaptic release probability between sensory neuron i and inference neurons in the j-th sub-population. A spiking sensory neuron i causes an EPSP in a neuron in the j-th sub-population with probability Mij, which is initialized proportional to the likelihood: P(bi l(k + 1) ≥1) = g(Zk+1|xi)/CM (8) where CM is a scaling constant such that Mij = g(Zk+1 = zi | xj)/CM. Finally, an inference neuron fires a spike at time k + 1 if and only if it receives both recurrent and sensory inputs. The corresponding firing probability is then the product of the probabilities of the two inputs:P(si l(k + 1) = 1) = P(ai l(k + 1) ≥1)P(bi l(k + 1) ≥1) Let ni k+1|k+1 = PL l=1 si l(k + 1) be the number of spikes in i-th sub-population at time k + 1, we have E[ni k+1|k+1|{ni k|k}] = L Nk CW CM P(Zk+1|Z1:k)ωi k+1|k+1 (9) Var[ni k+1|k+1|{ni k|k}] ≃ L Nk CW CM g(Zk+1|xi)ωi k+1|k (10) Equation 9 ensures that the expected spike distribution at time k +1 is a Monte Carlo approximation to the updated posterior probability P(Xk+1|Z1:k+1). It also determines how many neurons are activated at time k + 1. To keep the number of spikes at different time steps relatively constant, the scaling constant CM, CW and the number of neurons L could be of the same order of magnitude: for example, CW = L = 10 ∗N1 and CM(k + 1) = 10 ∗Nk/N1, resulting in a form of divisive inhibition [23]. If the overall neural activity is weak at time k, then the global inhibition regulating M is decreased to allow more spikes at time k + 1. Moreover, approximations in equations 6 and 10 become exact when N 2 k C2 W →0. 3.3 Filtering Examples Figure 1(b) illustrates how the model network implements Bayesian inference with spike samples. The top three rows of circles in the left panel in Figure 1(b) represent the neural activities in the inference neurons, approximating respectively the prior, prediction, and posterior distributions in the right panel. At time k, spikes (shown as filled circles) in the posterior population represent the 4 (a) (b) (c) Figure 2: Filtering results for uni-modal (a) and bi-modal posterior distributions ((b) and (c) - see text for details). distribution P(Xk|Z1:k). With recurrent weights W ∝f(Xk+1|Xk), spiking neurons send EPSPs to their neighbors and make them partially activated (shown as half-filled circles in the second row). The distribution of partially activated neurons is a Monte-Carlo approximation to the prediction distribution P(Xk+1|Z1:k). When a new observation Zk+1 arrives, the sensory neuron (filled circles the bottom row) whose receptive field contains Zk+1 is activated, and sends feedforward EPSPs to the inference neurons using synaptic weights M = g(Z|X). The inference neurons at time k+1 fire only if they receive both recurrent and feedforward inputs. With the firing probability proportional to the product of prediction probability P(Xk+1|Z1:k) and observation likelihood g(Zk+1|Xk+1), the spike distribution at time k + 1 (filled circles in the third row) again represents the updated posterior P(Xk+1|Z1:k+1). We further tested the filtering results of the proposed neural network with two other example HMMs. The first example is the classic stochastic volatility model, where X = Z = R. The transition model of the hidden volatility variable f(Xk+1|Xk) = N(0.91Xk, 1.0), and the emission model of the observed price given volatility is g(Zk|Xk) = N(0, 0.25 exp(Xk)). The posterior distribution of this model is uni-modal. In simulation we divided X into 100 bins, and initial spikes N1 = 1000. We plotted the expected volatility with estimated standard deviation from the population posterior distribution in Figure 2(a). We found that the neural network does indeed produce a reasonable estimate of volatility and plausible confidence interval. The second example tests the network’s ability to approximate bi-modal posterior distributions by comparing the time varying population posterior distribution with the true one using heat maps (Figures 2(b) and 2(c)). The vertical axis represents the hidden state and the horizontal axis represents time steps. The magnitude of the probability is represented by the color. In this example, X = {1, . . . , 8} and there are 20 time steps. 3.4 Convergence Results and Poisson Variability In this section, we discuss some convergence results for Bayesian filtering using the proposed spiking network and show our population estimator of the posterior probability is a consistent one. Let ˆP i k = ni k|k Nk be the population estimator of the true posterior probability P(Xk = i|Z1:k) at time k. Suppose the true distribution is known only at initial time k = 1: ˆP i 1 = ωi 1|1. We would like to investigate how the mean and variance of ˆP i k vary over time. We derived the updating equations for mean and variance (see supplementary materials) and found two implications. First, the variance of neural response is roughly proportional to the mean. Thus, rather than representing noise, Poisson variability in the model occurs as a natural consequence of sampling and sparse coding. Second, the variance Var[ ˆP j k] ∝1/N1. Therefore Var[ ˆP j k] →0 as N1 →∞, showing that ˆP j k is a consistent estimator of ωj k|k. We tested the above two predictions using numerical experiments on arbitrary HMMs, where we choose X = {1, 2, . . . 20}, Zk ∼N(Xk, 5), the transition matrix f(xj|xi) first uniformly drawn from [0, 1], and then normalized to ensure P j f(xj|xi) = 1. In Figures 3(a-c), each data point represents Var[ ˆP j k] along the vertical axis and E[ ˆP j k] −E2[ ˆP j k] along the horizontal axis, calculated over 100 trials with the same random transition matrix f, and k = 1, . . . 10, j = 1, . . . 20. The solid lines represent a least squares power law fit to the data: Var[ ˆP j k] = CV ∗(E[ ˆP j k] −E2[ ˆP j k])CE. For 100 different random transition matrices f, the means 5 10 −5 10 −3 10 0 10 −1 10 −7 10 −5 10 −2 10 −4 10 −6 10 −3 E[pj k] − E2[pj k] Var[pj k] y = 0.028804 * x1.2863 (a) 10 0 10 −5 10 −3 10 −1 10 −5 10 −7 10 −3 E[pj k] − E2[pj k] Var[pj k] y = 0.00355627 * x1.13 (b) 10 −5 10 −4 10 −3 10 −2 10 −1 10 0 10 −9 10 −8 10 −7 10 −6 10 −5 10 −4 E[pj k] − E2[pj k] Var[pj k] y = 0.000303182 * x1.037 (c) (d) (e) (f) Figure 3: Variance versus Mean of estimator for different initial spike counts of the exponential term CE were 1.2863, 1.13, and 1.037, with standard deviations 0.13, 0.08, and 0.03 respectively, for N1 = 100 and X = 4, 20, and 100. The mean of CE continues to approach 1 when X is increased, as shown in figure 3(d). Since Var[ ˆP j k] ∝(E[ ˆP j k] −E2[ ˆP j k]) implies Var[nj k|k] ∝E[nj k|k] (see supplementary material for derivation), these results verify the Poisson variability prediction of our neural network. The term CV represents the scaling constant for the variance. Figure 3(e) shows that the mean of CV over 100 different transition matrices f (over 100 different trials with the same f) is inversely proportional to initial spike count N1, with power law fit CV = 1.77N −0.9245 1 . This indicates that the variance of ˆP j k converges to 0 if N1 →∞. The bias between estimated and true posterior probability can be calculated as: bias(f) = 1 XK X X i=1 K X k=1 (E[ˆPi k] −ωi k|k)2 The relationship between the mean of the bias (over 100 different f) versus initial count N1 is shown in figure 3(f). We also have an inverse proportionality between bias and N1. Therefore, as the figure shows, for arbitrary f, the estimator ˆP j k is a consistent estimator of ωj k|k. 4 On-line parameter learning In the previous section, we assumed that the model parameters, i.e., the transition probabilities f(Xk+1|Xk) and the emission probabilities g(Zk|Xk), are known. In this section, we describe how these parameters θ = {f, g} can be learned from noisy observations {Zk}. Traditional methods to estimate model parameters are based on the Expectation-Maximization (EM) algorithm, which maximizes the (log) likelihood of the unknown parameters log Pθ(Z1:k) given a set of observations collected previously. However, such an “off-line” approach is biologically implausible because (1) it requires animals to store all of the observations before learning, and (2) evolutionary pressures dictate that animals update their belief over θ sequentially any time a new measurement becomes available. We therefore propose an on-line estimation method where observations are used for updating parameters as they become available and then discarded. We would like to find the parameters θ that maximize the log likelihood: log Pθ(Z1:k) = Pk t=1 log Pθ(Zt|Zt−1). Our approach is based on recursively calculating the sufficient statistics of θ using stochastic approximation algorithms and the 6 Figure 4: Performance of the Hebbian Learning Rules. Monte Carlo method, and employs an online EM algorithm obtained by approximating the expected sufficient statistic ˆT(θk) using the stochastic approximation (or Robbins-Monoro) procedure. Based on the detailed derivations described in the supplementary materials, we obtain a Hebbian learning rule for updating the synaptic weights based on the pre-synaptic and post-synaptic activities: M k ij = γk nj k|k Nk × ˜ni(k) P i ˜ni(k) + (1 −γk nj k|k Nk ) × M k−1 ij when nj k|k > 0, (11) W k ij = γk ni k−1|k−1 Nk−1 × nj k|k Nk + (1 −γk ni k−1|k−1 Nk−1 ) × W k−1 ij when ni k−1|k−1 > 0, (12) where ˜ni(k) is the number of pre-synaptic spikes in the i-th sub-population of sensory neurons at time k, γk is the learning rate. Learning both emission and transition probability matrices at the same time using the online EM algorithm with stochastic approximation is in general very difficult because there are many local minima in the likelihood function. To verify the correctness of our learning algorithms individually, we first divide the learning process into two phases. The first phase involves learning the emission probability g when the hidden world state is stationary, i.e., Wij = fij = δij. This corresponds to learning the observation model of static objects at the center of gaze before learning the dynamics f of objects. After an observation model g is learned, we relax the stationarity constraint, and allow the spiking network to update the recurrent weights W to learn the arbitrary transition probability f. Figure 4 illustrates the performance of learning rules (11) and (12) for a discrete HMM with X = 4 and Z = 12. X and Z values are spaced equally apart: X ∈{1, . . . , 4} and Z ∈{ 2 3, 1, 4 3, . . . , 4 1 3}. The transition probability matrix f then involves 4×4 = 16 parameters and the emission probability matrix g involves 12 × 4 = 48 parameters. In Figure 4(a), we examine the performance of learning rule (11) for the feedforward weights M k, with fixed transition matrix. The true emission probability matrix has the form g.j =∼ N(xj, σ2 Z). The solid blue curve shows the mean square error (Frobenius norm) M k −g F = qP ij(M k ij −gij)2 between the learned feedforward weights M k and the true emission probability matrix g over trials with different g,. The dotted lines show ± 1 standard deviation for MSE based on 10 different trials. σZ varied from trial to trial and was drawn uniformly between 0.2 and 0.4, representing different levels of observation noises. The initial spike distribution was uniform ni 0|0 = nj 0|0, ∀i, j = 1 . . . , X and the initial estimate M 0 i,j = 1 Z . The learning rate was set to γk = 1 k, although a small constant learning rate such as γk = 10−5 also gives rise to similar learning results. A notable feature in Figure 4(a) is that the average MSE exhibits a fast powerlaw decrease. The red solid line in Figure 4(a) represents the power-law fit to the average MSE: MSE(k) ∝k−1.1. Furthermore, the standard deviation of MSE approaches zero as k grows large. 7 Figure 4(a) thus shows the asymptotic convergence of equation (11) irrespective of the σZ of the true emission matrix g. We next examined the performance of learning rule 12 for the recurrent weights W k, given the learned emission probability matrix g (the true transition probabilities f are unknown to the network). The initial estimator W 0 ij = 1 X . Similarly, Performance was evaluated by calculating the mean square error W k −f F = qP ij(W k ij −fij)2 between the learned recurrent weight W k and the true f. Different randomly chosen transition matrices f were tested. When σZ = 0.04, the observation noise is 0.04 1/3 = 12% of the separation between two observed states. Hidden state identification in this case is relatively easy. The red solid line in figure 4(b) represents the power-law fit to the average MSE: MSE(k) ∝k−0.36. Similar convergence results can still be obtained for higher σZ, e.g., σZ = 0.4 (figure 4(c)). In this case, hidden state identification is much more difficult as the observation noise is now 1.2 times the separation between two observed states. This difficulty is reflected in a slower asymptotic convergence rate, with a power-law fit MSE(k) ∝k−0.21, as indicated by the red solid line in figure 4(c). Finally, we show the results for learning both emission and transition matrices simultaneously in figure 4(d,e). In this experiment, the true emission and transition matrices are deterministic, the weight matrices are initialized as the sum of the true one and a uniformly random one: W 0 ij ∝ fij + ϵ and M 0 ij ∝gij + ϵ where ϵ is a uniform distributed noise between 0 and 1/NX. Although the asymptotic convergence rate for this case is much slower, it still exhibits desired power-law convergences in both MSEW (k) ∝k−0.02 and MSEM(k) ∝k−0.08 over 100 trials starting with different initial weight matrices. 5 Discussion Our model suggests that, contrary to the commonly held view, variability in spiking does not reflect “noise” in the nervous system but captures the animal’s uncertainty about the outside world. This suggestion is similar to some previous models [17, 19, 20], including models linking firing rate variability to probabilistic representations [16, 8] but differs in the emphasis on spike-based representations, time-varying inputs, and learning. In our model, a probability distribution over a finite sample space is represented by spike counts in neural sub-populations. Treating spikes as random samples requires that neurons in a pool of identical cells fire independently. This hypothesis is supported by a recent experimental findings [21] that nearby neurons with similar orientation tuning and common inputs show little or no correlation in activity. Our model offers a functional explanation for the existence of such decorrelated neuronal activity in the cortex. Unlike many previous models of cortical computation, our model treats synaptic transmission between neurons as a stochastic process rather than a deterministic event. This acknowledges the inherent stochastic nature of neurotransmitter release and binding. Synapses between neurons usually have only a small number of vesicles available and a limited number of post-synaptic receptors near the release sites. Recent physiological studies [24] have shown that only 3 NMDA receptors open on average per release during synaptic transmission. These observations lend support to the view espoused by the model that synapses should be treated as probabilistic computational units rather than as simple scalar parameters as assumed in traditional neural network models. The model for learning we have proposed builds on prior work on online learning [25, 26]. The online algorithm used in our model for estimating HMM parameters involves three levels of approximation. The first level involves performing a stochastic approximation to estimate the expected complete-data sufficient statistics over the joint distribution of all hidden states and observations. Cappe and Moulines [26] showed that under some mild conditions, such an approximation produces a consistent, asymptotically efficient estimator of the true parameters. The second approximation comes from the use of filtered rather than smoothed posterior distributions. Although the convergence reported in the methods section is encouraging, a rigorous proof of convergence remains to be shown. The asymptotic convergence rate using only the filtered distribution is about one third the convergence rate obtained for the algorithms in [25] and [26], where the smoothed distribution is used. The third approximation results from Monte-Carlo sampling of the posterior distribution. As discussed in the methods section, the Monte Carlo approximation converges in the limit of large numbers of particles (spikes). 8 References [1] R.S. Zemel, Q.J.M. Huys, R. Natarajan, and P. Dayan. Probabilistic computation in spiking populations. Advances in Neural Information Processing Systems, 17:1609–1616, 2005. [2] D. Knill and W. Richards. Perception as Bayesian inference. Cambridage University Press, 1996. [3] K. Kording and D. Wolpert. Bayesian integration in sensorimotor learning. Nature, 427:244–247, 2004. [4] K. Doya, S. Ishii, A. Pouget, and R. P. N. Rao. Bayesian Brain: Probabilistic Approaches to Neural Coding. Cambridge, MA: MIT Press, 2007. [5] K. Zhang, I. Ginzburg, B.L. McNaughton, and T.J.Sejnowski. Interpreting neuronal population activity by reconstruction: A unified framework with application to hippocampal place cells. Journal of Neuroscience, 16(22), 1998. [6] R. S. Zemel and P. Dayan. Distributional population codes and multiple motion models. Advances in neural information procession system, 11, 1999. [7] S. Wu, D. Chen, M. Niranjan, and S.I. Amari. Sequential Bayesian decoding within a population of neurons. Neural Computation, 15, 2003. [8] W.J. Ma, J.M. Beck, P.E. Latham, and A. Pouget. Bayesian inference with probabilistic population codes. Nature Neuroscience, 9(11):1432–1438, 2006. [9] R.P.N. Rao. Bayesian computation in recurrent neural circuits. Neural Computation, 16(1):1–38, 2004. [10] J.M. Beck and A. Pouget. Exact inferences in a neural implementation of a hidden Markov model. Neural Computation, 19(5):1344–1361, 2007. [11] R.C. Wilson and L.H. Finkel. A neural implmentation of the kalman filter. Advances in Neural Information Processing Systems, 22:2062–2070, 2009. [12] O. Bobrowski, R. Meir, and Y. Eldar. Bayesian filtering in spiking neural networks: noise adaptation and multisensory integration. Neural Computation, 21(5):1277–1320, 2009. [13] S. Deneve. Bayesian spiking neurons i: Inference. Neural Computation, 20:91–117, 2008. [14] S. Deneve. Bayesian spiking neurons ii: Learning. Neural Computation, 20:118–145, 2008. [15] A. Doucet, N. de Freitas, and N. Gordon. Sequential Monte Carlo methods in practice. Springer-Verlag, 2001. [16] P.O. Hoyer, A. Hyrinen, and A.H. Arinen. Interpreting neural response variability as Monte Carlo sampling of the posterior. Advances in Neural Information Processing Systems 15, 2002. [17] M G Paulin. Evolution of the cerebellum as a neuronal machine for Bayesian state estimation. J. Neural Eng., 2:S219–S234, 2005. [18] N.D. Daw and A.C. Courville. The pigeon as particle lter. Advances in Neural Information Processing Systems, 19, 2007. [19] L. Buesing, J. Bill, B. Nessler, and W. Maass. Neural dynamics as sampling: A model for stochastic computation in recurrent networks of spiking neurons. PLoS Comput Biol, 7(11), 2011. [20] P. Berkes, G. Orban, M. Lengye, and J. Fisher. Spontaneous cortical activity reveals hallmarks of an optimal internal model of the environment. Science, 331(6013), 2011. [21] A. S. Ecker, P. Berens, G.A. Kelirls, M. Bethge, N. K. Logothetis, and A. S. Tolias. Decorrelated neuronal firing in cortical microcircuits. Science, 327(5965):584–587, 2010. [22] Jr. Hodges, J. L. and Lucien Le Cam. The Poisson approximation to the Poisson binomial distribution. The Annals of Mathematical Statistics, 31(3):737–740, 1960. [23] Frances S. Chance and L. F. Abbott. Divisive inhibition in recurrent networks. Network, 11:119–129, 2000. [24] E.A. Nimchinsky, R. Yasuda, T.G. Oertner, and K. Svoboda. The number of glutamate receptors opened by synaptic stimulation in single hippocampal spines. J Neurosci, 24:2054–2064, 2004. [25] G. Mongillo and S. Deneve. Online learning with hidden Markov models. Neural Computation, 20:1706– 1716, 2008. [26] O. Cappe and E. Moulines. Online EM algorithm for latent data models, 2009. 9
2014
357
5,466
Simple MAP Inference via Low-Rank Relaxations Roy Frostig⇤, Sida I. Wang,⇤ Percy Liang, Christopher D. Manning Computer Science Department, Stanford University, Stanford, CA, 94305 {rf,sidaw,pliang}@cs.stanford.edu, manning@stanford.edu Abstract We focus on the problem of maximum a posteriori (MAP) inference in Markov random fields with binary variables and pairwise interactions. For this common subclass of inference tasks, we consider low-rank relaxations that interpolate between the discrete problem and its full-rank semidefinite relaxation. We develop new theoretical bounds studying the effect of rank, showing that as the rank grows, the relaxed objective increases but saturates, and that the fraction in objective value retained by the rounded discrete solution decreases. In practice, we show two algorithms for optimizing the low-rank objectives which are simple to implement, enjoy ties to the underlying theory, and outperform existing approaches on benchmark MAP inference tasks. 1 Introduction Maximum a posteriori (MAP) inference in Markov random fields (MRFs) is an important problem with abundant applications in computer vision [1], computational biology [2], natural language processing [3], and others. To find MAP solutions, stochastic hill-climbing and mean-field inference are widely used in practice due to their speed and simplicity, but they do not admit any formal guarantees of optimality. Message passing algorithms based on relaxations of the marginal polytope [4] can offer guarantees (with respect to the relaxed objective), but require more complex bookkeeping. In this paper, we study algorithms based on low-rank SDP relaxations which are both remarkably simple and capable of guaranteeing solution quality. Our focus is on MAP in a restricted but common class of models, namely those over binary variables coupled by pairwise interactions. Here, MAP can be cast as optimizing a quadratic function over the vertices of the n-dimensional hypercube: maxx2{−1,1}n xTAx. A standard optimization strategy is to relax this integer quadratic program (IQP) to a semidefinite program (SDP), and then round the relaxed solution to a discrete one achieving a constant factor approximation to the IQP optimum [5, 6, 7]. In practice, the SDP can be solved efficiently using low-rank relaxations [8] of the form maxX2Rn⇥k tr(X>AX). The first part of this paper is a theoretical study of the effect of the rank k on low-rank relaxations of the IQP. Previous work focused on either using SDPs to solve IQPs [5] or using low-rank relaxations to solve SDPs [8]. We instead consider the direct link between the low-rank problem and the IQP. We show that as k increases, the gap between the relaxed low-rank objective and the SDP shrinks, but vanishes as soon as k ≥rank(A); our bound adapts to the problem A and can thereby be considerably better than the typical data-independent bound of O(pn) [9, 10]. We also show that the rounded objective shrinks in ratio relative to the low-rank objective, but at a steady rate of ⇥(1/k) on average. This result relies on the connection we establish between IQP and low-rank relaxations. In the end, our analysis motivates the use of relatively small values of k, which is advantageous from both a solution quality and algorithmic efficiency standpoint. ⇤Authors contributed equally. 1 The second part of this paper explores the use of very low-rank relaxation and randomized rounding (R3) in practice. We use projected gradient and coordinate-wise ascent for solving the R3 relaxed problem (Section 4). We note that R3 interfaces with the underlying problem in an extremely simple way, much like Gibbs sampling and mean-field: only a black box implementation of x 7! Ax is required. This decoupling permits users to customize their implementation based on the structure of the weight matrix A: using GPUs for dense A, lists for sparse A, or much faster specialized algorithms for A that are Gaussian filters [11]. In contrast, belief propagation and marginal polytope relaxations [2] need to track messages for each edge or higher-order clique, thereby requiring more memory and a finer-grained interface to the MRF that inhibits flexibility and performance. Finally, we introduce a comparison framework for algorithms via the x 7! Ax interface, and use it to compare R3 with annealed Gibbs sampling and mean-field on a range of different MAP inference tasks (Section 5). We found that R3 often achieves the best-scoring results, and we provide some intuition for our advantage in Section 4.1. 2 Setup and background Notation We write Sn for the set of symmetric n ⇥n real matrices and Sk for the unit sphere {x 2 Rk : kxk2 = 1}. All vectors are columns unless stated otherwise. If X is a matrix, then Xi 2 R1⇥k is its i’th row. This section reviews how MAP inference on binary graphical models with pairwise interactions can be cast as integer quadratic programs (IQPs) and approximately solved via semidefinite relaxations and randomized rounding. Let us begin with the definition of an IQP: Definition 2.1. Let A 2 Sn be a symmetric n ⇥n matrix. An (indefinite) integer quadratic program (IQP) is the following optimization problem: max x2{−1,1}n IQP(x) def = xTAx (1) Solving (1) is NP-complete in general: the MAX-CUT problem immediately reduces to it [5]. With an eye towards tractability, consider a first candidate relaxation: maxx2[−1,1]n xTAx. This relaxation is always tight in that the maxima of the relaxed objective and original objective (1) are equal.1 Therefore it is just as hard to solve. Let us then replace each scalar xi 2 [−1, 1] with a unit vector Xi 2 Rk and define the following low-rank problem (LRP): Definition 2.2. Let k 2 {1, . . . , n} and A 2 Sn. Define the low-rank problem LRPk by: max X2Rn⇥k LRPk(X) def = tr(XTAX) subject to kXik2 = 1, i = 1, . . . , n. (2) Note that setting Xi = [xi, 0, . . . , 0] 2 Rk recovers (1). More generally, we have a sequence of successively looser relaxations as k increases. What we get in return is tractability. The LRPk objective generally yields a non-convex problem, but if we take k = n, the objective can be rewritten as tr(X>AX) = tr(AXX>) = tr(AS), where S is a positive semidefinite matrix with ones on the diagonal. The result is the classic SDP relaxation, which is convex: max S2Sn SDP(S) def = tr(AS) subject to S ⌫0, diag(S) = 1 (3) Although convexity begets easy optimization in a theoretical sense, the number of variables in the SDP is quadratic in n. Thus for large SDPs, we actually return to the low-rank parameterization (2). Solving LRPk via simple gradient methods works extremely well in practice and is partially justified by theoretical analyses in [8, 12]. 1Proof. WLOG, A ⌫0 because adding to its diagonal merely adds a constant term to the IQP objective. The objective is a convex function, as we can factor A = LLT and write xTLLTx = kLTxk2 2, so it must be maximized over its convex polytope domain at a vertex point. 2 To complete the picture, we need to convert the relaxed solutions X 2 Rn⇥k into integral solutions x 2 {−1, 1}n of the original IQP (1). This can be done as follows: draw a vector g 2 Rk on the unit sphere uniformly at random, project each Xi onto g, and take the sign. Formally, we write x = rrd(X) to mean xi = sign(Xi · g) for i = 1, . . . , n. This randomized rounding procedure was pioneered by [5] to give the celebrated 0.878-approximation of MAX-CUT. 3 Understanding the relaxation-rounding tradeoff The overall IQP strategy is to first relax the integer problem domain, then round back in to it. The optimal objective increases in relaxation, but decreases in randomized rounding. How do these effects compound? To guide our choice of relaxation, we analyze the effect that the rank k in (2) has on the approximation ratio of rounded versus optimal IQP solutions. More formally, let x?, X?, and S? denote global optima of IQP, of LRPk, and of SDP, respectively. We can decompose the approximation ratio as follows: 1 ≥ E[IQP(rrd(X?))] IQP(x?) | {z } approximation ratio = SDP(S?) IQP(x?) | {z } constant ≥1 ⇥ LRPk(X?) SDP(S?) | {z } tightening ratio T (k) ⇥E[IQP(rrd(X?))] LRPk(X?) | {z } rounding ratio R(k) (4) As k increases from 1, the tightening ratio T(k) increases towards 1 and the rounding ratio R(k) decreases from 1. In this section, we lower bound T and R each in turn, thus lower-bounding the approximation ratio as a function of k. Specifically, we show that T(k) reaches 1 at small k and that R(k) falls as 2 ⇡+ ⇥( 1 k). In practice, one cannot find X? for general k with guaranteed efficiency (if we could, we would simply use LRP1 to directly solve the original IQP). However, Section 5 shows empirically that simple procedures solve LRPk well for even small k. 3.1 The tightening ratio T(k) increases We now show that, under the assumption of A ⌫0, the tightening ratio T(k) plateaus early and that it approaches this plateau steadily. Hence, provided k is beyond this saturation point, and large enough so that an LRPk solver is practically capable of providing near-optimal solutions, there is no advantage in taking k larger. First, T(k) is steadily bounded below. The following is a result of [13] (that also gives insight into the theoretical worst-case hardness of optimizing LRPk): Theorem 3.1 ([13]). Fix A ⌫0 and let S? be an optimal SDP solution. There is a randomized algorithm that, given S?, outputs ˜X feasible for LRPk such that E ˜ X[LRPk( ˜X)] ≥γ(k) · SDP(S?), where γ(k) def = 2 k ✓Γ((k + 1)/2) Γ(k/2) ◆2 = 1 −1 2k + o ✓1 k ◆ (5) For example, γ(1) = 2 ⇡= 0.6366, γ(2) = 0.7854, γ(3) = 0.8488, γ(4) = 0.8836, γ(5) = 0.9054.2 By optimality of X?, LRPk(X?) ≥E ˜ X[LRPk( ˜X)] under any probability distribution, so the existence of the algorithm in Theorem 3.1 implies that T(k) ≥γ(k). Moreover, T(k) achieves its maximum of 1 at small k, and hence must strictly exceed the γ(k) lower bound early on. We can arrive at this fact by bounding the rank of the SDP-optimal solution S?. This is because S? factors into S? = XXT, where X is in Rn⇥rank S? and must be optimal since LRPrank S?(X) = SDP(S?). Without consideration of A, the following theorem uniformly bounds this rank at well below n. The theorem was established independently by [9] and [10]: Theorem 3.2 ([9, 10]). Fix a weight matrix A. There exists an optimal solution S? to SDP (3) such that rank S?  p 2n. 2The function γ(k) generalizes the constant approximation factor 2/⇡= γ(1) with regards to the implications of the unique games conjecture: the authors show that no polynomial time algorithm can, in general, approximate LRPk to a factor greater than γ(k) assuming P 6= NP and the UGC. 3 1 2 3 4 5 6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 k rounding ratio R(k) lower bound (a) R(k) (blue) is close to it 2/(⇡γ(k)) lower bound (red) across the small k. 1 2 3 4 5 6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 k objective γ(k) T(k)=LRPk/SDP (b) ˜T (k) (blue), the empirical tightening ratio, clears its lower bound γ(k) (red) and hits its ceiling of 1 at k = 4. 1 2 3 4 5 6 1100 1200 1300 1400 1500 1600 1700 1800 k objective SDP Max Mean Mean+Std Mean−Std (c) Rounded objective values vs. k: optimal SDP (cyan), best IQP rounding (green), and mean IQP rounding ±σ (black). Figure 1: Plots of quantities analyzed in Section 3, under A 2 R100⇥100 whose entries are sampled independently from a unit Gaussian. For this instance, the empirical post-rounding objectives are shown at the right for completeness. Hence we know already that the tightening ratio T(k) equals 1 by the time k reaches p 2n. Taking A into consideration, we can identify a class of problem instances for which T(k) actually saturates at even smaller k. This result is especially useful when the rank of the weight matrix A is known, or even under one’s control, while modeling the underlying optimization task: Theorem 3.3. If A is symmetric, there is an optimal SDP solution S? such that rank S? rank A. A complete proof is in Appendix A.1. Because adding to the diagonal of A is equivalent to merely adding a constant to the objective of all problems considered, Theorem 3.3 can be strengthened: Corollary 3.4. For any symmetric weight matrix A, there exists an optimal SDP solution S? such that rank S? minu2Rn rank(A + diag(u)). That is, changes to the diagonal of A that reduce its rank may be applied to improve the bound. In summary, T(k) grows at least as fast as γ(k), from T(k) = 0.6366 at k = 1 to T(k) = 1 at k = min{ p 2n, minu2Rn rank(A + diag(u))}. This is validated empirically in Figure 1b. 3.2 The rounding ratio R(k) decreases As the dimension k grows for row vectors Xi in the LRPk problem, the rounding procedure incurs a larger expected drop in objective value. Fortunately, we can bound this drop. Even more fortunately, the bound grows no faster than γ(k), exactly the steady lower bound for T(k). We obtain this result with an argument based on the analysis of [13]: Theorem 3.5. Fix a weight matrix A ⌫0 and any LRPk-feasible X 2 Rn⇥k. The rounding ratio for X is bounded below as E[IQP(rrd(X))] LRPk(X) ≥ 2 ⇡γ(k) = 2 ⇡ ✓ 1 + 1 2k + o ✓1 k ◆◆ (6) Note that X in the theorem need not be optimal – the bound applies to whatever solution an LRPk solver might provide. The proof, given in Appendix section A.1, uses Lemma 1 from [13], which is based on the theory of positive definite functions on spheres [14]. A decrease in R(k) that tracks the lower bound is observed empirically in Figure 1a. In summary, considering only the steady bounds (Theorems 3.1 and 3.5), T will always rise opposite to R at least at the same rate. Then, the added fact that T plateaus early (Theorem 3.2 and Corollary 3.4) means that T in fact rises even faster. In practice, we would like to take k beyond 1 as we find that the first few relaxations give the optimizer an increasing advantage in arriving at a good LRPk solution, close to X? in objective. The rapid rise of T relative to R just shown then justifies not taking k much larger if at all. 4 4 Pairwise MRFs, optimization, and inference alternatives Having understood theoretically how IQP relates to low-rank relaxations, we now turn to MAP inference and empirical evaluation. We will show that the LRPk objective can be optimized via a simple interface to the underlying MRF. This interface then becomes the basis for (a) a MAP inference algorithm based on very low-rank relaxations, and (b) a comparison to two other basic algorithms for MAP: Gibbs sampling and mean-field variational inference. A binary pairwise Markov random field (MRF) models a function h over x 2 {0, 1}n given by h(x) = P i i(xi) + P i<j ✓i,j(xi, xj), where the i and ✓i,j are real-valued functions. The MAP inference problem asks for the variable assignment x? that maximizes the function h. An MRF being binary-valued and pairwise allows the arbitrary factor tables i and ✓i,j to be transformed with straightforward algebra into weights A 2 Sn for the IQP. For the complete reduction, see Appendix A.2. We make Section 3 actionable by defining the randomized relaxation and rounding (R3) algorithm for MAP via low-rank relaxations. The first step of this algorithm involves optimizing LRPk (2) whose weight matrix encodes the MRF. In practice, MRFs usually have special structure, e.g., edge sparsity, factor templates, and Gaussian filters [11]. To develop R3 as a general tool, we provide two interfaces between the solver and MRF representation, both of which allow users to exploit special structure. Left-multiplication (x 7! Ax) Assume a function F that implements left matrix multiplication by the MRF matrix A. This suffices to compute the gradient of the relaxed objective: rXLRPk(X) = 2AX. We can optimize the relaxation using projected gradient ascent (PGA): alternate between taking gradient steps and projecting back onto the feasible set (unit-normalizing the rows Xi if the norm exceeds 1); see Algorithm 1. A user supplying a left-multiplication routine can parallelize its implementation on a GPU, use sparse linear algebra, or efficiently implement a dense filter. Row-product ((i, x) 7! Aix) If the function F further provides left multiplication by any row of A, we can optimize LRPk with coordinate-wise ascent (BCA). Fixing all but the i’th row of X gives a function linear in Xi whose optimum is AiX normalized to have unit norm. Left-multiplication is suitable when one expects to parallelize multiplication, or exploit common dense structure as with filters. Row product is suitable when one already expects to compute Ax serially. BCA also eliminates the need for the step size scheme in PGA, thus reducing the number of calls to the left-multiplication interface if this step size is chosen by line search. X random initialization in Rk⇥n for t 1 to T do if parallel then X ⇧Sk(X + 2⌘tAX) // Parallel update else for i 1 to n do Xi ⇧Sk(hAi, Xi) // Sweep update for j 1 to M do x(j) sign(Xg), where g is a random vector from unit sphere Sk (normalized Gaussian) Output the x(j) for which the objective (x(j))TAx(j) is largest. Algorithm 1: The full randomized relax-and-round (R3) procedure, given a weight matrix A; ⇧Sk(·) is row normalization and ⌘t is the step size in the t’th iteration. 4.1 Comparison to Gibbs sampling and mean-field The R3 algorithm affords a tidy comparison to two other basic MAP algorithms. First, it is iterative and maintains a constant amount of state per MRF variable (a length k row vector). Using the row-product interface, R3 under BCA sequentially sweeps through and updates each variable’s state (row Xi) while holding all others fixed. This interface bears a striking resemblance to (annealed) Gibbs sampling and mean-field iterative updates [4, 15], which are popular due to their simplicity. Table 1 shows how both can be implemented via the row-product interface. 5 Algorithm Domain Sweep update Parallel update Gibbs x 2 {−1, 1}n xi ⇠⇧Z(exp(Aix)) x ⇠⇧Z(exp(Ax)) Mean-field x 2 [−1, 1]n xi tanh(Aix) x tanh(Ax) R3 X 2 (Sk)n Xi ⇧Sk(AiX) X ⇧Sk(X + 2⌘tAX) Table 1: Iterative updates for MAP algorithms that use constant state per MRF variable. ⇧Sk denotes `2 unit-normalization of rows and ⇧Z denotes scaling rows so that they sum to 1. The R3 sweep update is not a gradient step, but rather the analytic maximum for the i’th row fixing the rest. x1 1(x1) = x1 x2 2(x2) = x2 10x1x2 A = 1 2 "0 1 1 1 0 10 1 10 0 # Figure 2: Consider the two variable MRF on the left (with x1, x2 2 {−1, 1} for the factor expressions) and its corresponding matrix A. Note x0 is clamped to 1 as per the reduction (A.2). The optimum is x = [1, 1, 1]T with a value of xTAx = 12. If Gibbs or LRP1 is initialized at x = [1, −1, −1]T, then either one will be unlikely to transition away from its suboptimal objective value of 8 (as flipping only one of x1 or x2 decreases the objective to −10). Meanwhile, LRP2 succeeds with probability 1 over random initializations. Suppose X = [1, 0; X1; X2] with X1 = X2. Then the gradient update is X1 = ⇧S2(A1X) = ⇧S2(([1, 0] + 10X1)/2), which always points towards X? 1 = X? 2 = [1, 0] except in the 0-probability event that X1 = X2 = [−1, 0] (corresponding to the poor initialization of [1, −1, −1]T above). The gradient with respect to X1 at points along the unit circle is shown on the right. The thick arrow represents an X1 ⇡[−0.95, 0.3], and the gradient field shows that it will iteratively update towards the optimum. Using left-multiplication, R3 updates the state of all variables in parallel. Superficially, both Gibbs and the iterative mean-field update can be parallelized in this way as well (Table 1), but doing so incorrectly alters the their convergence properties. Nonetheless, [11] showed that a simple modification works well in practice for mean-field, so we consider these algorithms for a complete comparison.3 While Gibbs, mean-field, and R3 are similar in form, they differ in their per-variable state: Gibbs maintains a number in {−1, 1} whereas R3 stores an entire vector in Rk. We can see by example that the extra state can help R3 avoid local optima that ensnarls Gibbs. A single coupling edge in a two-node MRF, described in Figure 2, gives intuition for the advantage of optimizing relaxations over stochastic hill-climbing. Another widely-studied family of MAP inference techniques are based on belief propagation or relaxations of the marginal polytope [4]. For belief propagation, and even for the most basic of the LP relaxations (relaxing to the local consistency polytope), one needs to store state for every edge in addition to every variable. This demands a more complex interface to the MRF, introduces substantial added bookkeeping for dense graphs, and is not amenable to techniques such as the filter of [11]. 5 Experiments We compare the algorithms from Table 1 on three benchmark MRFs and an additional artificial MRF. We also show the effect of the relaxation k on the benchmarks in Figure 3. Rounding in practice The theory of Section 3 provides safeguard guarantees by considering the average-case rounding. In practice, we do far better than average since we take several roundings and output the best. Similarly, Gibbs’ output is taken as the best along its chain. Budgets Our goal is to see how efficiently each method utilizes the same fixed budget of queries to the function, so we fix the number queries to the left-multiplication function F of Section 4. A budget jointly limits the relaxation updates and the number of random roundings taken in R3. We charge 3Later, in [16], the authors derive the parallel mean-field update as being that of a concave approximation to the cross-entropy term in the true mean-field objective. 6 algo. dataset [name (# of instances)] seg (50) dbn (108) grid40 (8) chain (300) low budget sweep Gibbs 8.35 (23) 1.39 (30) 14.5 (7) .473 (37) MF 8.36 (23) 1.3 (7) 13.6 (1) .463 (39) R3 8.39 (15) 1.42 (71) 13.7 (0) .538 (296) parallel Gibbs 7.4 (19) .826 (3) .843 (0) .124 (3) MF 7.4 (26) 1.16 (6) 11.3 (3) .35 (50) R3 7.4 (17) 1.29 (99) 11.3 (5) .418 (282) high budget sweep Gibbs 7.07 (33) 1.26 (42) 12.5 (7) .367 (85) MF 7.03 (9) 1.16 (4) 11.7 (1) .33 (39) R3 7.09 (23) 1.28 (62) 11.9 (0) .398 (300) parallel Gibbs 6.78 (31) .814 (2) 1.85 (0) .132 (11) MF 6.75 (12) 1.1 (2) 10.9 (2) .259 (47) R3 6.8 (25) 1.25 (104) 11 (6) .321 (296) Table 2: Benchmark performance of algorithms in each comparison regime, in which the benchmarks are held to different computational budgets that cap their access to the left-multiplication routine. The score shown is an average relative gain in objective over the uniform-random baseline. Parenthesized is the win count (including ties), and bold text highlights qualitatively notable successes. 1 2 3 4 5 6 460 480 500 520 540 560 580 k objective seg LRP Max Mean Mean+Std Mean−Std 1 2 3 4 5 6 0.95 1 1.05 1.1 1.15 1.2 1.25 1.3 x 10 4 k objective dbn LRP Max Mean Mean+Std Mean−Std 1 2 3 4 5 6 1.1 1.15 1.2 1.25 1.3 1.35 1.4 x 10 4 k objective grid LRP Max Mean Mean+Std Mean−Std Figure 3: Relaxed and rounded objectives vs. the rank k in an instance of seg, dbn, and grid40. Blue: max of roundings. Red: value of LRPk. Black: mean of roundings (±σ). The relaxation objective increases with k, suggesting that increasingly good solutions are obtained by increasing k, in spite of non-convexity (here we are using parallel updates, i.e. using R3 with PGA). The maximum rounding also improves considerably with k, especially at first when increasing beyond k = 1. R3 k-fold per use of F when updating, as it queries F with a k-row argument.4 Sweep methods are charged once per pass through all variables. We experiment with separate budgets for the sweep and parallel setup, as sweeps typically converge more quickly. The benchmark is run under separate low and high budget regimes – the latter more than double the former to allow for longer-run effects to set in. In Table 2, the sweep algorithms’ low budget is 84 queries; the high budget is 200. The parallel low budget is 180; the high budget is 400. We set R3 to take 20 roundings under low budgets and 80 under high ones, and the remaining budget goes towards LRPk updates. Datasets Each dataset comprises a family of binary pairwise MRFs. The sets seg, dbn, and grid40 are from the PASCAL 2011 Probabilistic Inference Challenge5 — seg are small segmentation models (50 instances, average 230 variables, 622 edges), dbn are deep belief networks (108 instances, average 920 variables, 54160 edges), and grid40 are 40x40 grids (8 instances, 1600 variables, 6240 or 6400 edges) whose edge weights outweigh their unaries by an order of magnitude. The chain set comprises 300 randomly generated 20-node chain MRFs with no unary potentials and random unit-Gaussian edge weights – it is principally an extension of the coupling two-node example (Figure 2), and serves as a structural obverse to grid40 in that it lacks cycles entirely. Among these, the dbn set comprises the largest and most edge-dense instances. 4 This conservatively disfavors R3, as it ignores the possible speedups of treating length-k vectors as a unit. 5http://www.cs.huji.ac.il/project/PASCAL/ 7 Evaluation To aggregate across instances of a dataset, we measure the average improvement over a simple baseline that, subject to the budget constraint, draws uniformly random vectors in {−1, 1}n and selects the highest-scoring among them. Improvement over the baseline is relative: if z is the solution objective and z0 is that of the baseline, (z −z0)/z0 is recorded for the average. We also count wins (including ties), the number of times a method obtains the best objective among the competition. Baseline performance varies with budget so scores are incomparable across sweep and parallel experiments. In all experiments, we use LRP4, i.e. the width-4 relaxation. The R3 gradient step size scheme is ⌘t = 1/ p t. In the parallel setting, mean-field updates are prone to large oscillations, so we smooth the update with the current point: x (1 −⌘)x + ⌘tanh(Ax). Our experiments set ⌘= 0.5. Gibbs is annealed from an initial temperature of 10 down to 0.1. These settings were tuned towards the benchmarks using a few arbitrary instances from each dataset. Results are summarized in Table 2. All methods fare well on the seg dataset and find solutions very near the apparent global optimum. This shows that the rounding scheme of R3, though elementary, is nonetheless capable of recovering an actual MAP point. On grid40, R3 is competitive but not outstanding, and on chain it is a clear winner. Both datasets have edge potentials that dominate the unaries, but the cycles in the grid help break local frustrations that occur in chain where they prevents Gibbs from transitioning. On dbn – the more difficult task grounded in a real model – R3 outperforms the others by a large margin. Figure 3 demonstrates that relaxation beyond the quadratic program maxx2[−1,1]xTAx (i.e. k = 1) is crucial, both for optimizing LRPk and for obtaining a good maximum among roundings. Figure 4 in the appendix visualizes the distribution of rounded objective values across different instances and relaxations, illustrating that the difficulty of the problem can be apparent in the rounding distribution. 6 Related work and concluding remarks In this paper, we studied MAP inference problems that can be cast as an integer quadratic program over hypercube vertices (IQP). Relaxing the IQP to an SDP (3) and rounding back with rrd(·) was introduced by Goemans and Williamson in the 1990s for MAX-CUT. It was generalized to positive semidefinite weights shortly thereafter by Nesterov [6]. Separately, in the early 2000s, there was interest in scalably solving SDPs, though not with the specific goal of solving the IQP. The low-rank reparameterization of an SDP, as in (2), was developed by [8] and [12]. Recent work has taken this approach to large-scale SDP formulations of clustering, embedding, matrix completion, and matrix norm optimization for regularization [17, 18]. Upper bounds on SDP solutions in terms of problem size n, which help justify using a low rank relaxation, have been known since the 1990s [9, 10]. The natural joint use of these ideas (IQP relaxed to SDP and SDP solved by low-rank relaxation) is somewhat known. It was applied in a clustering experiment in [19], but no theoretical analysis was given and no attention paid to rounding directly from a low-rank solution. The benefit of rounding from low-rank was noticed in coarse MAP experiments in [20], but no theoretical backing was given and no attention paid to coordinate-wise ascent or budgeted queries to the underlying model. Other relaxation hierarchies have been studied in the MRF MAP context, namely linear program (LP) relaxations given by hierarchies of outer bounds on the marginal polytope [21, 2]. They differ from this paper’s setting in that they maintain state for every MRF clique configuration – an approach that extends beyond pairwise MRFs but that scales with the number of factors (unwieldy versus a large, dense binary pairwise MRF) and requires fine-grained access to the MRF. Sequences of LP and SDP relaxations form the Sherali-Adams and Lasserre hierarchies, respectively, whose relationship is discussed in [4] (Section 9). The LRPk hierarchy sits at a lower level: between the IQP (1) and the first step of the Lasserre hierarchy (the SDP (3)). From a practical point of view, we have presented an algorithm very similar in form to Gibbs sampling and mean-field. This provides a down-to-earth perspective on relaxations within the realm of scalable and simple inference routines. It would be interesting to see if the low-rank relaxation ideas from this paper can be adapted to other settings (e.g., for marginal inference). Conversely, the rich literature on the Lasserre hierarchy may offer guidance in extending the low-rank semidefinite approach (e.g., beyond the binary pairwise setting). 8 References [1] S. Geman and D. Geman. Stochastic relaxation, Gibbs distributions, and the Bayesian restoration of images. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 6:721–741, 1984. [2] D. Sontag, T. Meltzer, A. Globerson, Y. Weiss, and T. Jaakkola. Tightening LP relaxations for MAP using message-passing. In Uncertainty in Artificial Intelligence (UAI), pages 503–510, 2008. [3] A. Rush, D. Sontag, M. Collins, and T. Jaakkola. On dual decomposition and linear programming relaxations for natural language processing. In Empirical Methods in Natural Language Processing (EMNLP), pages 1–11, 2010. [4] M. Wainwright and M. I. Jordan. Graphical models, exponential families, and variational inference. Foundations and Trends in Machine Learning, 1:1–307, 2008. [5] M. Goemans and D. Williamson. Improved approximation algorithms for maximum cut and satisfiability problems using semidefinite programming. Journal of the ACM (JACM), 42(6):1115–1145, 1995. [6] Y. Nesterov. Semidefinite relaxation and nonconvex quadratic optimization. Optimization methods and software, 9:141–160, 1998. [7] N. Alon and A. Naor. Approximating the cut-norm via Grothendieck’s inequality. SIAM Journal on Computing, 35(4):787–803, 2006. [8] S. Burer and R. Monteiro. A nonlinear programming algorithm for solving semidefinite programs via low-rank factorization. Mathematical Programming, 95(2):329–357, 2001. [9] A. I. Barvinok. Problems of distance geometry and convex properties of quadratic maps. Discrete & Computational Geometry, 13:189–202, 1995. [10] G. Pataki. On the rank of extreme matrices in semidefinite programs and the multiplicity of optimal eigenvalues. Mathematics of Operations Research, 23(2):339–358, 1998. [11] P. Kr¨ahenb¨uhl and V. Koltun. Efficient inference in fully connected CRFs with Gaussian edge potentials. In Advances in Neural Information Processing Systems (NIPS), 2011. [12] S. Burer and R. Monteiro. Local minima and convergence in low-rank semidefinite programming. Mathematical Programming, 103(3):427–444, 2005. [13] J. Bri¨et, F. M. d. O. Filho, and F. Vallentin. The positive semidefinite Grothendieck problem with rank constraint. In Automata, Languages and Programming, pages 31–42, 2010. [14] I. J. Schoenberg. Positive definite functions on spheres. Duke Mathematical Journal, 9:96–108, 1942. [15] M. I. Jordan, Z. Ghahramani, T. S. Jaakkola, and L. K. Saul. An introduction to variational methods for graphical models. Machine Learning, 37:183–233, 1999. [16] P. Kr¨ahenb¨uhl and V. Koltun. Parameter learning and convergent inference for dense random fields. In International Conference on Machine Learning (ICML), pages 513–521, 2013. [17] B. Kulis, A. C. Surendran, and J. C. Platt. Fast low-rank semidefinite programming for embedding and clustering. In Artificial Intelligence and Statistics (AISTATS), pages 235–242, 2007. [18] B. Recht and C. R´e. Parallel stochastic gradient algorithms for large-scale matrix completion. Mathematical Programming Computation, 5:1–26, 2013. [19] J. Lee, B. Recht, N. Srebro, J. Tropp, and R. Salakhutdinov. Practical large-scale optimization for maxnorm regularization. In Advances in Neural Information Processing Systems (NIPS), pages 1297–1305, 2010. [20] S. Wang, R. Frostig, P. Liang, and C. Manning. Relaxations for inference in restricted Boltzmann machines. In International Conference on Learning Representations (ICLR), 2014. [21] D. Sontag and T. Jaakkola. New outer bounds on the marginal polytope. In Advances in Neural Information Processing Systems (NIPS), pages 1393–1400, 2008. 9
2014
358
5,467
Fast Prediction for Large-Scale Kernel Machines Cho-Jui Hsieh, Si Si, and Inderjit S. Dhillon Department of Computer Science University of Texas at Austin Austin, TX 78712 USA {cjhsieh,ssi,inderjit}@cs.utexas.edu Abstract Kernel machines such as kernel SVM and kernel ridge regression usually construct high quality models; however, their use in real-world applications remains limited due to the high prediction cost. In this paper, we present two novel insights for improving the prediction efficiency of kernel machines. First, we show that by adding “pseudo landmark points” to the classical Nystr¨om kernel approximation in an elegant way, we can significantly reduce the prediction error without much additional prediction cost. Second, we provide a new theoretical analysis on bounding the error of the solution computed by using Nystr¨om kernel approximation method, and show that the error is related to the weighted kmeans objective function where the weights are given by the model computed from the original kernel. This theoretical insight suggests a new landmark point selection technique for the situation where we have knowledge of the original model. Based on these two insights, we provide a divide-and-conquer framework for improving the prediction speed. First, we divide the whole problem into smaller local subproblems to reduce the problem size. In the second phase, we develop a kernel approximation based fast prediction approach within each subproblem. We apply our algorithm to real world large-scale classification and regression datasets, and show that the proposed algorithm is consistently and significantly better than other competitors. For example, on the Covertype classification problem, in terms of prediction time, our algorithm achieves more than 10000 times speedup over the full kernel SVM, and a two-fold speedup over the state-of-the-art LDKL approach , while obtaining much higher prediction accuracy than LDKL (95.2% vs. 89.53%). 1 Introduction Kernel machines have become widely used in many machine learning problems, including classification, regression, and clustering. By mapping samples to a high-dimensional feature space, kernel machines are able to capture the nonlinear properties and usually achieve better performance compared to linear models. However, computing the decision function for the new test samples is typically expensive which limits the applicability of kernel methods to real-world applications. Therefore speeding up the prediction time of kernel methods has become an important research topic. For example, recently [2, 10] proposed various heuristics to speed up kernel SVM prediction, and kernel approximation based methods [27, 5, 21, 16] can also be applied to speed up the prediction for general kernel machines. Among them, LDKL attracts much attention recently as it performs much better than state-of-the-art kernel approximation and reduced set based methods for fast prediction. Experimental results show that LDKL can reduce the prediction costs by more than three orders of magnitude with little degradation of accuracy as compared with the original kernel SVM. In this paper, we propose a novel fast prediction technique for large-scale kernel machines. Our method is built on the Nystr¨om approximation, but with the following innovations: 1. We show that by adding “pseudo landmark points” to the Nystr¨om approximation, the kernel approximation error can be reduced without too much additional prediction cost. 1 2. We provide a theoretical analysis of the model approximation error ∥¯α −α∗∥, where ¯α is the model (solution) computed by Nystr¨om approximation, and α∗is the solution computed from the original kernel. Instead of bounding the error ∥¯α −α∗∥by kernel approximation error on the entire kernel matrix, we refine the bound by taking the α∗weights into consideration, which indicates that we only need to focus on approximating the columns in the kernel matrix with large α∗values (e.g., support vectors in kernel SVM problem). We further show that the error bound is connected to the α∗-weighted kmeans objective function, which suggests selecting landmark points based on α∗values in Nystr¨om approximation. 3. We consider the above two innovations under a divide-and-conquer framework for fast prediction. The divide-and-conquer framework partitions the problem using kmeans clustering to reduce the problem size, and for each subproblem we apply the above two techniques to develop a kernel approximation scheme for fast prediction. Based on the above three innovations, we develop a fast prediction scheme for kernel methods, DCPred++, and apply it to speed up the prediction for kernel SVM and kernel ridge regression. The experimental results show that our method outperforms state-of-the-art methods in terms of prediction time and accuracy. For example, on the Covertype classification problem, our algorithm achieves a two-fold speedup in terms of prediction time, and yields a higher prediction accuracy (95.2% vs 89.53%) compared to the state-of-the-art fast prediction approach LDKL. Perhaps surprisingly, our training time is usually faster or at least competitive with state-of-the-art solvers. We begin by presenting related work in Section 2, while the background material is given in Section 3. In Section 4, we introduce the concept of pseudo landmark points in kernel approximation. In Section 5, we present the divide-and-conquer framework, and theoretically analyze using the weighted kmeans to select the landmark points. The experimental results on real-world data are presented in Section 6. 2 Related Work There has been substantial works on speeding up the prediction time of kernel SVMs, and most of the approaches can be applied to other kernel methods such as kernel ridge regression. Most of the previous works can be categorized into the following three types: Preprocessing. Reducing the size of the training set usually yields fewer support vectors in the model, and thus results in faster prediction speed. [20] proposed a “squashing” approach to reduce the size of training set by clustering and grouping nearby points. [19] proposed to select the extreme points in the training set to train kernel SVM. Nystr¨om method [27, 4, 29] and Random Kitchen Sinks (RKS) [21] form low-rank kernel approximations to improve both training and prediction speed. Although RKS usually requires a larger rank than Nystr¨om method, it can be further sped up by using fast Hadamard transform [16]. Other kernel approximation methods [12, 18, 1] are also proposed for different types of kernels. Post-processing. Post-processing approaches are designed to reduce the number of support vectors in the testing phase. A comprehensive comparison of these reduced-set methods has been conducted in [11], and results show that the incremental greedy method [22] implemented in STRtool achieves the best performance. Another randomized algorithm to refine the solution of the kernel SVM has been recently proposed in [2]. Modified Training Process. Another line of research aims to reduce the number of support vectors by modifying the training step. [13] proposed a greedy basis selection approach; [24] proposed a Core Vector Machine (CVM) solver to solve the L2-SVM. [9] applied a cutting plane subspace pursuit algorithm to solve the kernel SVM. The Reduced SVM (RSVM) [17] selected a subset of features in the original data, and solved the primal problem of kernel SVM. Locally Linear SVM (LLSVM) [15] represented each sample as a linear combination of its neighbors to yield efficient prediction speed. Instead of considering the original kernel SVM problem, [10] developed a new tree-based local kernel learning model (LDKL), where the decision value of each sample is computed by a series of inner products when traversing the tree. 3 Background Kernel Machines. In this paper, we focus on two kernel machines – kernel SVM and kernel ridge regressions. Given a set of instance-label pairs {xi, yi}n i=1, xi ∈Rd, the training process of kernel SVM and kernel ridge regression generates α∗∈Rn by solving the following optimization problems: 2 Kernel SVM: α∗←argmin α 1 2αT Qα −eT α s.t. 0 ≤α ≤C, (1) Kernel Ridge Regression: α∗←argmin α αT Gα + λαT α −2αT y, (2) where G ∈Rn×n is the kernel matrix with Gij = K(xi, xj); Q is an n by n matrix with Qij = yiyjGij, and C, λ are regularization parameters. In the prediction phase, the decision value of a testing data x is computed as Pn i=1 α∗ i K(xi, x), which in general requires O(¯nd) where ¯n is the number of nonzero elements in α∗. Note that for kernel SVM problem, we may think α∗ i is weighted by yi when computing decision value for x. In comparison, linear models only require O(d) prediction time, but usually generate lower prediction accuracy. Nystr¨om Approximation. Kernel machines usually do not scale to large-scale applications due to the O(n2d) operations to compute the kernel matrix and O(n2) space to store it in memory. As shown in [14], low-rank approximation of kernel matrix using the Nystr¨om method provides an efficient way to scale up kernel machines to millions of instances. Given m ≪n landmark points {uj}m j=1, the Nystr¨om method first forms two matrices C ∈Rn×m and W ∈Rm×m based on the kernel function, where Cij = K(xi, uj) and Wij = K(ui, uj), and then approximates the kernel matrix as G ≈¯G := CW †CT , (3) where W † denotes the pseudo-inverse of W. By approximating G via Nystr¨om method, the kernel machines are usually transformed to linear machines, which can be solved efficiently. Given the model α, in the testing phase, the decision value of x is evaluated as c(W †CT α) = cβ, where c = [K(x, u1), . . . , K(x, um)], and β = W †CT α can be precomputed and stored. To obtain the prediction on one test sample, Nystr¨om approximation only needs O(md) flops to compute c, and O(m) flops to compute the decision value cβ, so it becomes an effective ways to improve the prediction speed. However, Nystr¨om approximation usually needs more than 100 landmark points to achieve reasonable good accuracy, which is still expensive for large-scale applications. 4 Pseudo Landmark Points for Speeding up Prediction Time In Nystr¨om approximation, there is a trade-off in selecting the number of landmark points m. A smaller m means faster prediction speed, but also yields higher kernel approximation error, which results in a lower prediction accuracy. Therefore we want to tackle the following problem – can we add landmark points without increasing the prediction time? Our solution is to construct extra “pseudo landmark points” for the kernel approximation. Recall that originally we have m landmark points {uj}m j=1, and now we add p pseudo landmark points {vt}p t=1 to this set. In this paper, we consider pseudo landmark points are sampled from the training dataset, while in general each pseudo landmark point can be any d-dimensional vector. The only difference between pseudo landmark points and landmark points is that the kernel values K(x, vt) are computed in a fast but approximate manner in order to speed up the prediction time. We use a regression-based method to approximate {K(x, vt)}p t=1. Assume for each pseudo landmark point vt, there exists a function ft : Rm →R, where the input to each ft is the computed kernel values {K(x, uj)}m j=1, and the output is an estimator of K(x, vt). We can either design the function for specific kernels, for example, in Section 4.1 we design ft for stationary kernels, or learn ft by regression for general kernels (Section 4.2). Before introducing the design or learning process for {ft}p t=1, we first describe how to use them to form the Nyst¨om approximation.With p pseudo landmark points and {ft}p t=1 given, we can form the following a n × (m + p) matrix ¯C, by adding the p extra columns to C: ¯C = [C, C′], where C′ it = ft({K(xi, uj)}m j=1) ∀i = 1, . . . , n and ∀t = 1, . . . , p. (4) Then the kernel matrix G can be approximated by G ≈¯G = ¯C ¯W ¯CT , with ¯W = ¯C†G( ¯C†)T , (5) where ¯C† is the pseudo inverse of ¯C; ¯W is the optimal solution to minimize ∥G −¯G∥F if ¯G is restricted to the range space of ¯C, which is also used in [26]. Note that in our case ¯W cannot be 3 obtained by inverting an m + p by m + p matrix as in the original Nystr¨om approach in (3), because the kernel values between x and pseudo landmark points are the approximate kernel values. As a result the time to form the Nystr¨om approximation in (5) is slower than forming (3) since the whole kernel matrix G has to be computed. If the number of samples n is too large to compute G, we can estimate the matrix ¯W by minimizing the approximation error on a submatrix of G. More specifically, we randomly select a submatrix Gsub from G with row/and column indexes I. If we focus on approximating Gsub, the optimal ¯W is ¯W = ( ¯CI,:)†Gsub(( ¯CI,:)†)T , which only requires computation of O(|I|2) kernel elements. Based on the approximate kernel ¯G, we can train a model ¯α and store the vector ¯β = ¯W ¯CT ¯α in memory. For a testing sample x, we first compute the kernel values between x and landmarks points c = [K(x, u1), . . . , K(x, um)], which usually requires O(md) flops, and then expand c to an (m + p)-dimensional vector ¯c = [c, f1(c), . . . , fp(c)] based on the p pseudo landmark points and the functions {ft}p t=1. Assume each ft(c) function can be evaluated with O(s) time, then we can easily compute ¯c and the decision value ¯c¯β taking O(md + ps) time, where s is much smaller than d. Overall, our algorithm can be summarized in Algorithm 1. Algorithm 1: Kernel Approximation with Pseudo Landmark Points Kernel Approximation Steps: Select m landmark points {uj}m j=1. Compute n × m matrix C where Cij = K(xi, uj). Select p pseudo landmark points {vt}p t=1. Construct p functions {ft}p t=1 by methods in Section 4.1 or Section 4.2. Expand C to ¯C as ¯C = [C, C′] by (4), and compute ¯W by (5). Training: Compute ¯α based on ¯G and precompute ¯β = ¯W ¯CT ¯α. Prediction for a test point x: Compute m dimensional vector c = [K(x, u1), . . . , K(x, um)]. Compute m + p dimensional vector ¯c = [c, f1(c), . . . , fp(c)]. Decision value: ¯c¯β. 4.1 Design the functions for stationary kernels Next we discuss various ways to design/learn the functions {ft}p t=1. First we consider the stationary kernels K(x, vt) = κ(∥x −vt∥), where the kernel approximation problem can be reduced to estimate ∥x−vt∥with low cost. Suppose we choose p pseudo landmark points {vt}p t=1 by randomly sampling p points in the dataset. By the triangle inequality, max j (|∥x −uj∥−∥vt −uj∥|) ≤∥x −vt∥≤min j (∥x −uj∥+ ∥vt −uj∥) . (6) Since ∥x −uj∥has already been evaluated for all uj (to compute K(x, uj)) and ∥vt −uj∥can be precomputed, we can use either left hand side or right hand side of (6) to estimate K(x, vt). We can see that approximating K(x, vt) using (6) only requires O(m) flops and is more efficient than computing K(x, vt) from scratch when m ≪d (d is the dimensionality of data). 4.2 Learning the functions for general kernels Next we consider learning the function ft for general kernels by solving a regression problem. Assume each ft is a degree-D polynomial function (in the paper we only use D = 2). Let Z denote the basis functions: Z = {(i1, . . . , im) | i1 + · · · + im = d}, and for each element z(q) ∈Z we denote the corresponding polynomial function as Z(q)(c) = c z(q) 1 1 c z(q) 2 2 . . . cz(q) m m . Each ft can then be written as ft(c) = P q at qZ(q)(c). A naive way to apply the pseudo-landmark technique using polynomial functions is: to learn the optimal coefficients {at q}|Z| q=1 for each t, and then compute ¯C, ¯W based on (4) and (5). However, this two-step procedure requires a huge amount of training time, and the prediction time cannot be improved if |Z| is large. Therefore, we consider implicitly applying the pseudo-landmark point technique. We expand C by ˆC = [C, C′′], where C′′ iq = Z(q)(ci). (7) 4 (a) USPS,prediction cost vs approx. error. (b) Protein,prediction cost vs approx. error. (c) MNIST,prediction cost vs approx. error. Figure 1: Comparison of different pseudo landmark points strategy. The relative approximation error is ∥G−¯G∥F /∥G∥F where G and ¯G is the real and approximate kernel respectively. We observe that both Nys-triangle (using the triangular inequality to approximate kernel values) and Nys-dp (using the polynomial expansion with the degree D = 2) can dramatically reduce the approximation error under the same prediction cost. where ci = [K(xi, u1), . . . , K(xi, um)] and each Z(q)(·) is the q-th degree-D polynomial basis with q = 1, . . . , |Z|. After forming ˆC, we can then compute ˆW = ˆC†G( ˆC†)T and approximate the kernel by ˆC ˆW ˆCT . This procedure is much more efficient than the previous two-step procedure where we need to learn {at q}|Z| q=1, and more importantly, in the following lemma we show that this approach gives better approximation to the previous two-step procedure. Lemma 1. If {ft(·)}p t=1 are degree-D polynomial functions, ¯C, ¯W are computed by (4), (5) and ˆC, ˆW are computed by (7), (5), then ∥G −¯C ¯W ¯CT ∥≥∥G −ˆC ˆW ˆCT ∥. The proof is in Appendix 7.3. In practice we do not need to form all the low degree polynomial basis – just sample some of the basis from Z is enough. Figure 1 compares using Nystr¨om method with or without pseudo landmark points for approximating Gaussian kernels. For each dataset, we choose a few number of landmark points (2-30), and add pseudo landmark points according the triangular inequality (6) or according to the polynomial function (7). We observe that the kernel approximation error is dramatically reduced under the same prediction cost. Note that we can also apply this pseudo-landmark points approach as a building block in other kernel approximation frameworks, e.g., the Memory Efficient Kernel Approximation (MEKA) proposed in [23]. 5 Weighted Kmeans Sampling with a Divide-and-Conquer Framework In all the related work, Nystr¨om approximation is considered as a preprocessing step, which does not incorporate the information from the model itself. In this section, we consider the case that the model α∗for kernel SVM or kernel ridge regression is given, and derive a better approach to select landmark points. The approach can be used in conjunction with divide-and-conquer SVM [8] where an approximate solution to α∗can be computed efficiently. Let α∗be the optimal solution of the kernel machines computed with the original kernel matrix G, and ¯α be the approximate solution by using approximate kernel matrix ¯G. We derive the following upper bound of ∥¯α −α∗∥for both kernel SVM and kernel ridge regression: Theorem 1. Let α∗be the optimal solution for kernel ridge regression with kernel matrix G, and ¯α is the solution for kernel ridge regression with kernel ¯G obtained by Nystr¨om approximation (3), then ∥¯α −α∗∥≤∆/λ with ∆= n X i=1 |α∗ i |∥¯G·,i −G·,i∥, where λ is the regularization parameter in kernel ridge regression, and ¯G·,i and G·,i are the i-th column of ¯G and G respectively. Theorem 2. Let α∗be the optimal solution for kernel SVM with kernel G, and ¯α be the solution of kernel SVM with kernel ¯G obtained by Nystr¨om approximation (3), then ∥¯α −α∗∥≤θ2∥W∥2(1 + ρ)∆, (8) where ρ is the largest eigenvalue of ¯G, and θ is a positive constant independent on α∗, ¯α. 5 The proof is in Appendix 7.4 and 7.5. Here we show that ∥¯α −¯α∗∥can be upper bounded by a weighted kernel approximation error. This result looks natural but has a significant consequence – to get a good approximate model, we do not need to minimize the kernel approximation error on all the n2 elements of G; instead, the quality of solution is mostly affected by a small portion of columns of G with larger |α∗ i |. For example, in the kernel SVM problem, α∗is a sparse vector containing many zero elements, and the above bound indicates that we just need to approximate the columns in G with corresponding α∗ i ̸= 0 accurately. Based on the error bounds, we want to select landmark points for Nystr¨om approximation that minimize ∆. We focus on the kernel functions that satisfy (K(a, b) −K(c, d))2 ≤CK(∥a −c∥2 + ∥b −d∥2), ∀a, b, c, d, (9) where CK is a kernel-dependent constant. It has been shown in [29] that all the stationary kernels (K(xi, xj) = κ(∥xi −xj∥)) satisfy (9). Next we show that the weighted kernel approximation error ∆is upper bounded by the weighted kmeans objective. Theorem 3. If the kernel function satisfies condition (9), and let u1, . . . , um be the landmark points for constructing the Nystr¨om approximation ( ¯G = CW †CT ), then ∆≤(n + n∥W †∥ p kγmax) p Ck q D2 α∗ {uj}m j=1  , where γmax is the upper bound of kernel function, D2 α {ui}m i=1  := n X i=1 α2 i ∥xi −uπ(i)∥2, (10) and π(i) = argmins ∥us −xi∥2 is the landmark point closest to xi. The proof is in Appendix 7.6. Note that D2 α∗({ui}m i=1) is the weighted kmeans objective function with {(α∗ i )2}n i=1 as the weights. Combining Theorems 1, 2, and 3, we conclude that for both kernel SVM and ridge regression, the approximation error ∥¯α −α∗∥can be upper bounded by the weighted kmeans objective function. As a consequence, if α∗is given, we can use weighted kmeans with weights {(α∗ i )2}n i=1 to find the landmark points u1, . . . , um, which tends to minimize the approximation error. In Figure 4 (in the Appendix) we show that for the kernel SVM problem, selecting landmark points by weighted kmeans is a very effective strategy for fast and accurate prediction in real-world datasets. In practice we do not know α∗before training the kernel machines, and exactly computing α∗is very expensive for large-scale datasets. However, using weighted kmeans to select landmark points can be combined with any approximate solvers – we can use an approximate solver to quickly approximate α∗, and then use it as the weights for the weighted kmeans. Next we show how to combine this approach with the divide-and-conquer framework recently proposed in [8, 7]. Divide and Conquer Approach. The divide-and-conquer SVM (DC-SVM) was proposed in [8] to solve the kernel SVM problem. The main idea is to divide the whole problem into several smaller subproblems, where each subproblem can be solved independently and efficiently. [8] proposed to partition the data points by kernel clustering, but this approach is expensive in terms of prediction efficiency. Therefore we use kmeans clustering in the input space to build the hierarchical clustering. Assume we have k clusters as the leaf nodes, the DC-SVM algorithm computes the solutions {(α(i))∗}k i=1 for each cluster independently. For a testing sample, they use an “early prediction” scheme, where the testing sample is first assigned to the nearest cluster and then the local model in that cluster is used for prediction. This approach can reduce the prediction time because it only computes the kernel values between the testing sample and all the support vectors in one cluster. However, the model in each cluster may still contain many support vectors, so we propose to approximate the kernel in each cluster by Nystr¨om based kernel approximation as mentioned in Section 4 to further reduce the prediction time. In the prediction step we first go through the hierarchical tree to identify the nearest cluster, and then compute the kernel values between the testing sample and the landmark points in that cluster. Finally, we can compute the decision value based on the kernel values and the prediction model. The same idea can be applied to kernel ridge regression. Our overall algorithm – DC-Pred++ is presented in Algorithm 2. 6 Experimental Results In this section, we compare our proposed algorithm with other fast prediction algorithms for kernel SVM and kernel ridge regression problems. All the experiments are conducted on a machine with 6 Algorithm 2: DC-Pred++: our proposed divide-and-conquer approach for fast Prediction. Input : Training samples {xi}n i=1, kernel function K. Output: A fast prediction model. Training: Construct a hierarchical clustering tree with k leaf nodes by kmeans. Compute local models {(α(i))∗}k i=1 for each cluster. For each cluster, use weighted kmeans centroids as landmark points. For each cluster, run the proposed kernel approximation with pseudo landmark points (Algorithm 1) and use the approximate kernel to train a local prediction model. Prediction on x: Identify the nearest cluster. Run the prediction phase of Algorithm 1 using local prediction models. Table 1: Comparison of kernel SVM prediction on real datasets. Note that the actual prediction time is normalized by the linear prediction time. For example, 12.8x means the actual prediction time = 12.8× (time for linear SVM prediction time). Dataset Metric DC-Pred++ LDKL kmeans Nystr¨om AESVM STPRtool Fastfood Letter Prediction Time 12.8x 29x 140x 1542x 50x 50x ntrain = 12, 000, Accuracy 95.90% 95.78% 87.58% 80.97% 85.9% 89.9% ntest = 6, 000, d = 16 Training Time 1.2s 243s 3.8s 55.2s 47.7s 15s CovType Prediction Time 18.8x 35x 200x 3157x 50x 60x ntrain = 522, 910, Accuracy 95.19% 89.53% 73.63% 75.81% 82.14% 66.8% ntest = 58, 102, d = 54 Training Time 372s 4095s 1442s 204s 77400s 256s Usps Prediction Time 14.4x 12.01x 200x 5787x 50x 80x ntrain = 7291, Accuracy 95.56% 95.96% 92.53% 85.97% 93.6% 94.39% ntest = 2007, d = 256 Training Time 2s 19s 4.8s 55.3s 34.5s 12s Webspam Prediction Time 20.5x 23x 200x 4375x 50x 80x ntrain = 280, 000, Accuracy 98.4% 95.15% 95.01% 98.4% 91.6% 96.7% ntest = 70, 000, d = 254 Training Time 239s 2158s 181s 909s 32571s 1621s Kddcup Prediction Time 11.8x 26x 200x 604x 50x 80x ntrain = 4, 898, 431, Accuracy 92.3% 92.2% 87% 92.1% 89.8% 91.1% ntest = 311, 029, d = 134 Training Time 154s 997s 1481s 2717s 4925s 970s a9a Prediction Time 12.5x 32x 50x 4859x 50x 80 ntrain = 32, 561, Accuracy 83.9% 81.95% 83.9% 81.9% 82.32% 61.9% ntest = 16, 281, d = 123 Training Time 6.3s 490s 1.28s 33.17s 69.1s 59.9s an Intel 2.83GHz CPU with 32G RAM. Note that the prediction cost is shown as actual prediction time dividing by the linear model’s prediction time. This measurement is more robust to the actual hardware configuration and provides a comparison with the linear methods. 6.1 Kernel SVM We use six public datasets (shown in Table 1) for the comparison of kernel SVM prediction time. The parameters γ, C are selected by cross validation, and the detailed description of parameters for other competitors are shown in Appendix 7.1. We compare with the following methods: 1. DC-Pred++: Our proposed framework, which involves Divide-and-Conquer strategy and applies weighted kmeans to select landmark points and then uses these landmark points to generate pseudo-landmark points in Nystr¨om approximation for fast prediction. 2. LDKL: The Local Deep Kernel Learning method proposed in [10]. They learn a tree-based primal feature embedding to achieve faster prediction speed. 3. Kmeans Nystr¨om: The Nystr¨om approximation using kmeans centroids as landmark points [29]. The resulting linear SVM problem is solved by LIBLINEAR [6]. 4. AESVM: Approximate Extreme points SVM solver proposed in [19]. It uses a preprocessing step to filter out unimportant points to get a smaller model. 5. Fastfood: Random Hadamard features for kernel approximation [16]. 6. STPRtool: The kernel computation toolbox that implemented the reduced-set post processing approach using the greedy iterative solver proposed in [22]. Note that [10] reported that LDKL achieves much faster prediction speed compared with Locally Linear SVM [15], and reduced set methods [9, 3, 13], so we omit their comparisons here. The results presented in Table 1 show that DC-Pred++ achieves the best prediction efficiency and accuracy in 5 of the 6 datasets. In general, DC-Pred++ takes less than half of the prediction time and 7 (a) Letter (b) Covtype (c) Kddcup Figure 2: Comparison between our proposed method and LDKL for fast prediction in kernel SVM problem.x-axis is the prediction cost and y-axis shows the prediction accuracy. For results on more datasets, please see Figure 5 in the Appendix. (a) Cadata (b) YearPredictionMSD (c) mnist2M Figure 3: Kernel ridge regression results for various datasets. x-axis is the prediction cost and y-axis shows the Test RMSE. All the results are averaged over five independent runs. For results on more datasets, please see Figure 7 in the Appendix. can still achieve better accuracy than LDKL. Interestingly, in terms of the training time, DC-Pred++ is almost 10 times faster than LDKL on most of the datasets. Since LDKL is the most competitive method, we further show the comparison with LDKL by varying the prediction cost in Figure 2. The results show that on 5 datasets DC-Pred++ achieves better prediction accuracy using the same prediction time. Note that our approach is an improvement over the divide-and-conquer SVM (DC-SVM) proposed in [8], therefore we further compare DC-Pred++ with DC-SVM in Appendix 7.8. The results clearly demonstrate that DC-Pred++ achieves faster prediction speed, and the main reason is due to the two innovations presented in this paper – adding pseudo landmark points and weighted kmeans to select landmark points to improve Nystr¨om approximation. Finally, we also present the trade-off of two parameters in our algorithm, number of clusters and number of landmark points, in Appendix 7.9. Table 2: Dataset statistics dataset Cpusmall Cadata Census YearPredictionMSD mnist2M ntrain 6,553 16,521 18,277 463,715 1,500,000 ntest 1,639 4,128 4,557 51,630 500,000 d 12 137 8 90 800 6.2 Kernel Ridge Regression We further demonstrate the benefits of DC-Pred++ for fast prediction in kernel ridge regression problem on five public datasets listed in Table 2. Note that for mnist2M, we perform regression on two digits and set the target variables to be 0 and 1. We compare DC-Pred++ with other four state-of-the-art kernel approximation methods for kernel ridge regression including the standard Nystrom(Nys)[5], Kmeans Nystrom(KNys)[28], Random Kitchen Sinks(RKS)[21], and Fastfood [16]. All experimental results are based on Gaussian kernel. It is unclear how to generalize LDKL for kernel ridge regression, so we do not compare with LDKL here. The parameters used are chosen by five fold cross-validation (see Appendix 7.1). Figure 3 presents the Test RMSE(root mean squared error on the test data) by varying the prediction cost. To control the prediction cost, for Nys, KNys, and DC-Pred++, we vary the number of landmark points, and for RKS and fastfood, we vary the number of random features. In Figure 3, we can observe that with the same prediction cost, DC-Pred++ always yields lower Test RMSE than other methods. Acknowledgements This research was supported by NSF grants CCF-1320746 and CCF-1117055. C.-J.H also acknowledges support from an IBM PhD fellowship. 8 References [1] Y.-W. Chang, C.-J. Hsieh, K.-W. Chang, M. Ringgaard, and C.-J. Lin. Training and testing low-degree polynomial data mappings via linear SVM. JMLR, 11:1471–1490, 2010. [2] M. Cossalter, R. Yan, and L. Zheng. Adaptive kernel approximation for large-scale non-linear svm prediction. In ICML, 2011. [3] A. Cotter, S. Shalev-Shwartz, and N. Srebro. Learning optimally sparse support vector machines. In ICML, 2013. [4] P. Drineas, R. Kannan, and M. W. Mahoney. Fast monte carlo algorithms for matrices iii: Computing a compressed approximate matrix decomposition. SIAM J. Comput., 36(1):184–206, 2006. [5] P. Drineas and M. W. Mahoney. On the Nystr¨om method for approximating a Gram matrix for improved kernel-based learning. JMLR, 6:2153–2175, 2005. [6] R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin. LIBLINEAR: A library for large linear classification. JMLR, 9:1871–1874, 2008. [7] C.-J. Hsieh, I. S. Dhillon, P. Ravikumar, and A. Banerjee. A divide-and-conquer method for sparse inverse covariance estimation. In NIPS, 2012. [8] C.-J. Hsieh, S. Si, and I. S. Dhillon. A divide-and-conquer solver for kernel support vector machines. In ICML, 2014. [9] T. Joachims and C.-N. Yu. Sparse kernel svms via cutting-plane training. Machine Learning, 76(2):179– 193, 2009. [10] C. Jose, P. Goyal, P. Aggrwal, and M. Varma. Local deep kernel learning for efficient non-linear svm prediction. In ICML, 2013. [11] H. G. Jung and G. Kim. Support vector number reduction: Survey and experimental evaluations. IEEE Transactions on Intelligent Transportation Systems, 2014. [12] P. Kar and H. Karnick. Random feature maps for dot product kernels. In AISTATS, 2012. [13] S. S. Keerthi, O. Chapelle, and D. DeCoste. Building support vector machines with reduced classifier complexity. JMLR, 7:1493–1515, 2006. [14] S. Kumar, M. Mohri, and A. Talwalkar. Ensemble Nystr¨om methods. In NIPS, 2009. [15] L. Ladicky and P. H. S. Torr. Locally linear support vector machines. In ICML, 2011. [16] Q. V. Le, T. Sarlos, and A. J. Smola. Fastfood – approximating kernel expansions in loglinear time. In ICML, 2013. [17] Y.-J. Lee and O. L. Mangasarian. RSVM: Reduced support vector machines. In SDM, 2001. [18] S. Maji, A. C. Berg, and J. Malik. Efficient classification for additive kernel svms. IEEE PAMI, 35(1), 2013. [19] M. Nandan, P. R. Khargonekar, and S. S. Talathi. Fast svm training using approximate extreme points. JMLR, 15:59–98, 2014. [20] D. Pavlov, D. Chudova, and P. Smyth. Towards scalable support vector machines using squashing. In KDD, pages 295–299, 2000. [21] A. Rahimi and B. Recht. Random features for large-scale kernel machines. In NIPS, pages 1177–1184, 2007. [22] B. Sch¨olkopf, P. Knirsch, A. J. Smola, and C. J. C. Burges. Fast approximation of support vector kernel expansions, and an interpretation of clustering as approximation in feature spaces. In Mustererkennung 1998—20. DAGM-Symposium, Informatik aktuell, pages 124–132, Berlin, 1998. Springer. [23] S. Si, C.-J. Hsieh, and I. S. Dhillon. Memory efficient kernel approximation. In ICML, 2014. [24] I. Tsang, J. Kwok, and P. Cheung. Core vector machines: Fast SVM training on very large data sets. JMLR, 6:363–392, 2005. [25] P.-W. Wang and C.-J. Lin. Iteration complexity of feasible descent methods for convex optimization. JMLR, 15:1523–1548, 2014. [26] S. Wang and Z. Zhang. Improving cur matrix decomposition and the nystr¨om approximation via adaptive sampling. JMLR, 14:2729–2769, 2013. [27] C. K. I. Williams and M. Seeger. Using the Nystr¨om method to speed up kernel machines. In T. Leen, T. Dietterich, and V. Tresp, editors, NIPS, 2001. [28] K. Zhang and J. T. Kwok. Clustered Nystr¨om method for large scale manifold learning and dimension reduction. Trans. Neur. Netw., 21(10):1576–1587, 2010. [29] K. Zhang, I. W. Tsang, and J. T. Kwok. Improved Nystr¨om low rank approximation and error analysis. In ICML, 2008. 9
2014
359
5,468
A Safe Screening Rule for Sparse Logistic Regression Jie Wang Arizona State University Tempe, AZ 85287 jie.wang.ustc@asu.edu Jiayu Zhou Arizona State University Tempe, AZ 85287 jiayu.zhou@asu.edu Jun Liu SAS Institute Inc. Cary, NC 27513 jun.liu@sas.com Peter Wonka Arizona State University Tempe, AZ 85287 peter.wonka@asu.edu Jieping Ye Arizona State University Tempe, AZ 85287 jieping.ye@asu.edu Abstract The ℓ1-regularized logistic regression (or sparse logistic regression) is a widely used method for simultaneous classification and feature selection. Although many recent efforts have been devoted to its efficient implementation, its application to high dimensional data still poses significant challenges. In this paper, we present a fast and effective sparse logistic regression screening rule (Slores) to identify the “0” components in the solution vector, which may lead to a substantial reduction in the number of features to be entered to the optimization. An appealing feature of Slores is that the data set needs to be scanned only once to run the screening and its computational cost is negligible compared to that of solving the sparse logistic regression problem. Moreover, Slores is independent of solvers for sparse logistic regression, thus Slores can be integrated with any existing solver to improve the efficiency. We have evaluated Slores using high-dimensional data sets from different applications. Experiments demonstrate that Slores outperforms the existing state-of-the-art screening rules and the efficiency of solving sparse logistic regression can be improved by one magnitude. 1 Introduction Logistic regression (LR) is a popular and well established classification method that has been widely used in many domains such as machine learning [4, 7], text mining [3, 8], image processing [9, 15], bioinformatics [1, 13, 19, 27, 28], medical and social sciences [2, 17] etc. When the number of feature variables is large compared to the number of training samples, logistic regression is prone to over-fitting. To reduce over-fitting, regularization has been shown to be a promising approach. Typical examples include ℓ2 and ℓ1 regularization. Although ℓ1 regularized LR is more challenging to solve compared to ℓ2 regularized LR, it has received much attention in the last few years and the interest in it is growing [20, 25, 28] due to the increasing prevalence of high-dimensional data. The most appealing property of ℓ1 regularized LR is the sparsity of the resulting models, which is equivalent to feature selection. In the past few years, many algorithms have been proposed to efficiently solve the ℓ1 regularized LR [5, 12, 11, 18]. However, for large-scale problems, solving the ℓ1 regularized LR with higher accuracy remains challenging. One promising solution is by “screening”, that is, we first identify the “inactive” features, which have 0 coefficients in the solution and then discard them from the optimization. This would result in a reduced feature matrix and substantial savings in computational cost and memory size. In [6], El Ghaoui et al. proposed novel screening rules, called “SAFE”, to accelerate the optimization for a class of ℓ1 regularized problems, including LASSO [21], ℓ1 1 regularized LR and ℓ1 regularized support vector machines. Inspired by SAFE, Tibshirani et al. [22] proposed “strong rules” for a large class of ℓ1 regularized problems, including LASSO, elastic net, ℓ1 regularized LR and more general convex problems. In [26], Xiang et al. proposed “DOME” rules to further improve SAFE rules for LASSO based on the observation that SAFE rules can be understood as a special case of the general “sphere test”. Although both strong rules and the sphere tests are more effective in discarding features than SAFE for solving LASSO, it is worthwhile to mention that strong rules may mistakenly discard features that have non-zero coefficients in the solution and the sphere tests are not easy to be generalized to handle the ℓ1 regularized LR. To the best of our knowledge, the SAFE rule is the only screening test for the ℓ1 regularized LR that is “safe”, that is, it only discards features that are guaranteed to be absent from the resulting models. Figure 1: Comparison of Slores, strong rule and SAFE on the prostate cancer data set. In this paper, we develop novel screening rules, called “Slores”, for the ℓ1 regularized LR. The proposed screening tests detect inactive features by estimating an upper bound of the inner product between each feature vector and the “dual optimal solution” of the ℓ1 regularized LR, which is unknown. The more accurate the estimation is, the more inactive features can be detected. An accurate estimation of such an upper bound turns out to be quite challenging. Indeed most of the key ideas/insights behind existing “safe” screening rules for LASSO heavily rely on the least square loss, which are not applicable for the ℓ1 regularized LR case due to the presence of the logistic loss. To this end, we propose a novel framework to accurately estimate an upper bound. Our key technical contribution is to formulate the estimation of an upper bound of the inner product as a constrained convex optimization problem and show that it admits a closed form solution. Therefore, the estimation of the inner product can be computed efficiently. Our extensive experiments have shown that Slores discards far more features than SAFE yet requires much less computational efforts. In contrast with strong rules, Slores is “safe”, i.e., it never discards features which have non-zero coefficients in the solution. To illustrate the effectiveness of Slores, we compare Slores, strong rule and SAFE on a data set of prostate cancer along a sequence of 86 parameters equally spaced on the λ/λmax scale from 0.1 to 0.95, where λ is the parameter for the ℓ1 penalty and λmax is the smallest tuning parameter [10] such that the solution of the ℓ1 regularized LR is 0 [please refer to Eq. (1)]. The data matrix contains 132 patients with 15154 features. To measure the performance of different screening rules, we compute the rejection ratio which is the ratio between the number of features discarded by screening rules and the number of features with 0 coefficients in the solution. Therefore, the larger the rejection ratio is, the more effective the screening rule is. The results are shown in Fig. 1. We can see that Slores discards far more features than SAFE especially when λ/λmax is large while the strong rule is not applicable when λ/λmax ≤0.5. We present more results and discussions to demonstrate the effectiveness of Slores in Section 6. For proofs of the lemmas, corollaries, and theorems, please refer to the long version of this paper [24]. 2 Basics and Motivations In this section, we briefly review the basics of the ℓ1 regularized LR and then motivate the general screening rules via the KKT conditions. Suppose we are given a set of training samples {xi}m i=1 and the associate labels b ∈ℜm, where xi ∈ℜp and bi ∈{1, −1} for all i ∈{1, . . . , m}. The ℓ1 regularized logistic regression is: min β,c 1 m m X i=1 log(1 + exp(−⟨β, ¯xi⟩−bic)) + λ∥β∥1, (LRPλ) where β ∈ℜp and c ∈ℜare the model parameters to be estimated, ¯xi = bixi, and λ > 0 is the tuning parameter. We denote by X ∈ℜm×p the data matrix with the ith row being ¯xi and the jth column being ¯xj. 2 Let C = {θ ∈ℜm : θi ∈(0, 1), i = 1, . . . , m} and f(y) = y log(y) + (1 −y) log(1 −y) for y ∈(0, 1). The dual problem of (LRPλ) [24] is given by min θ ( g(θ) = 1 m m X i=1 f(θi) : ∥¯XT θ∥∞≤mλ, ⟨θ, b⟩= 0, θ ∈C ) . (LRDλ) To simplify notations, we denote the feasible set of problem (LRDλ) as Fλ, and let (β∗ λ, c∗ λ) and θ∗ λ be the optimal solutions of problems (LRPλ) and (LRDλ) respectively. In [10], the authors have shown that for some special choice of the tuning parameter λ, both of (LRPλ) and (LRDλ) have closed form solutions. In fact, let P = {i : bi = 1}, N = {i : bi = −1}, and m+ and m−be the cardinalities of P and N respectively. We define λmax = 1 m∥¯XT θ∗ λmax∥∞, (1) where [θ∗ λmax]i = ( m− m , if i ∈P, m+ m , if i ∈N, i = 1, . . . , m. (2) ([·]i denotes the ith component of a vector.) Then, it is known [10] that β∗ λ = 0 and θ∗ λ = θ∗ λmax whenever λ ≥λmax. When λ ∈(0, λmax], it is known that (LRDλ) has a unique optimal solution [24]. We can now write the KKT conditions of problems (LRPλ) and (LRDλ) as ⟨θ∗ λ, ¯xj⟩∈    mλ, if [β∗ λ]j > 0, −mλ, if [β∗ λ]j < 0, [−mλ, mλ], if [β∗ λ]j = 0. j = 1, . . . , p. (3) In view of Eq. (3), we can see that |⟨θ∗ λ, ¯xj⟩| < mλ ⇒[β∗ λ]j = 0. (R1) In other words, if |⟨θ∗ λ, ¯xj⟩< mλ, then the KKT conditions imply that the coefficient of ¯xj in the solution β∗ λ is 0 and thus the jth feature can be safely removed from the optimization of (LRPλ). However, for the general case in which λ < λmax, (R1) is not applicable since it assumes the knowledge of θ∗ λ. Although it is unknown, we can still estimate a region Aλ which contains θ∗ λ. As a result, if maxθ∈Aλ |⟨θ, ¯xj⟩| < mλ, we can also conclude that [β∗ λ]j = 0 by (R1). In other words, (R1) can be relaxed as T(θ∗ λ, ¯xj) := max θ∈Aλ |⟨θ, ¯xj⟩| < mλ ⇒[β∗ λ]j = 0. (R1′) In this paper, (R1′) serves as the foundation for constructing our screening rules, Slores. From (R1′), it is easy to see that screening rules with smaller T(θ∗ λ, ¯xj) are more aggressive in discarding features. To give a tight estimation of T(θ∗ λ, ¯xj), we need to restrict the region Aλ which includes θ∗ λ as small as possible. In Section 3, we show that the estimation of the upper bound T(θ∗ λ, ¯xj) can be obtained via solving a convex optimization problem. We show in Section 4 that the convex optimization problem admits a closed form solution and derive Slores in Section 5 based on (R1′). 3 Estimating the Upper Bound via Solving a Convex Optimization Problem In this section, we present a novel framework to estimate an upper bound T(θ∗ λ, ¯xj) of |⟨θ∗ λ, ¯xj⟩|. In the subsequent development, we assume a parameter λ0 and the corresponding dual optimal θ∗ λ0 are given. In our Slores rule to be presented in Section 5, we set λ0 and θ∗ λ0 to be λmax and θ∗ λmax given in Eqs. (1) and (2). We formulate the estimation of T(θ∗ λ, ¯xj) as a constrained convex optimization problem in this section, which will be shown to admit a closed form solution in Section 4. For the dual function g(θ), it follows that [∇g(θ)]i = 1 m log( θi 1−θi ), [∇2g(θ)]i,i = 1 m 1 θi(1−θi) ≥4 m. Since ∇2g(θ) is a diagonal matrix, it follows that ∇2g(θ) ⪰ 4 mI, where I is the identity matrix. Thus, g(θ) is strongly convex with modulus µ = 4 m [16]. Rigorously, we have the following lemma. Lemma 1. Let λ > 0 and θ1, θ2 ∈Fλ, then a). g(θ2) −g(θ1) ≥⟨∇g(θ1), θ2 −θ1⟩+ 2 m∥θ2 −θ1∥2 2. (4) b). If θ1 ̸= θ2, the inequality in (4) becomes a strict inequality, i.e., “≥” becomes “>”. 3 Given λ ∈(0, λ0], it is easy to see that both of θ∗ λ and θ∗ λ0 belong to Fλ0. Therefore, Lemma 1 can be a useful tool to bound θ∗ λ with the knowledge of θ∗ λ0. In fact, we have the following theorem. Theorem 2. Let λmax ≥λ0 > λ > 0, then the following holds: a). ∥θ∗ λ −θ∗ λ0∥2 2 ≤m 2 h g  λ λ0 θ∗ λ0  −g(θ∗ λ0) +  1 −λ λ0  ⟨∇g(θ∗ λ0), θ∗ λ0⟩ i (5) b). If θ∗ λ ̸= θ∗ λ0, the inequality in (5) becomes a strict inequality, i.e., “≤” becomes “<”. Theorem 2 implies that θ∗ λ is inside a ball centred at θ∗ λ0 with radius r = r m 2 h g  λ λ0 θ∗ λ0  −g(θ∗ λ0) + (1 −λ λ0 )⟨∇g(θ∗ λ0), θ∗ λ0⟩ i . (6) Recall that to make our screening rules more aggressive in discarding features, we need to get a tight upper bound T(θ∗ λ, ¯xj) of |⟨θ∗ λ, ¯xj⟩| [please see (R1′)]. Thus, it is desirable to further restrict the possible region Aλ of θ∗ λ. Clearly, we can see that ⟨θ∗ λ, b⟩= 0 (7) since θ∗ λ is feasible for problem (LRDλ). On the other hand, we call the set Iλ0 = {j : ⟨θ∗ λ0, ¯xj⟩= |mλ0|, j = 1, . . . , p} the “active set” of θ∗ λ0. We have the following lemma for the active set. Lemma 3. Given the optimal solution θ∗ λ of problem (LRDλ), the active set Iλ = {j : |⟨θ∗ λ, ¯xj⟩| = mλ, j = 1, . . . , p} is not empty if λ ∈(0, λmax]. Since λ0 ∈(0, λmax], we can see that Iλ0 is not empty by Lemma 3. We pick j0 ∈Iλ0 and set ¯x∗= sign(⟨θ∗ λ0, ¯xj0⟩)¯xj0. (8) It follows that ⟨¯x∗, θ∗ λ0⟩= mλ0. Due to the feasibility of θ∗ λ for problem (LRDλ), θ∗ λ satisfies ⟨θ∗ λ, ¯x∗⟩≤mλ. (9) As a result, Theorem 2, Eq. (7) and (9) imply that θ∗ λ is contained in the following set: Aλ λ0 := {θ : ∥θ −θ∗ λ0∥2 2 ≤r2, ⟨θ, b⟩= 0, ⟨θ, ¯x∗⟩≤mλ}. Since θ∗ λ ∈Aλ λ0, we can see that |⟨θ∗ λ, ¯xj⟩| ≤maxθ∈Aλ λ0 |⟨θ, ¯xj⟩|. Therefore, (R1′) implies that if T(θ∗ λ, ¯xj; θ∗ λ0) := max θ∈Aλ λ0 |⟨θ, ¯xj⟩| (UBP) is smaller than mλ, we can conclude that [β∗ λ]j = 0 and ¯xj can be discarded from the optimization of (LRPλ). Notice that, we replace the notations Aλ and T(θ∗ λ, ¯xj) with T(θ∗ λ, ¯xj; θ∗ λ0) and Aλ λ0 to emphasize their dependence on θ∗ λ0. Clearly, as long as we can solve for T(θ∗ λ, ¯xj; θ∗ λ0), (R1′) would be an applicable screening rule to discard features which have 0 coefficients in β∗ λ. We give a closed form solution of problem (UBP) in the next section. 4 Solving the Convex Optimization Problem (UBP) In this section, we show how to solve the convex optimization problem (UBP) based on the standard Lagrangian multiplier method. We first transform problem (UBP) into a pair of convex minimization problem (UBP′) via Eq. (11) and then show that the strong duality holds for (UBP′) in Lemma 6. The strong duality guarantees the applicability of the Lagrangian multiplier method. We then give the closed form solution of (UBP′) in Theorem 8. After we solve problem (UBP′), it is straightforward to compute the solution of problem (UBP) via Eq. (11). Before we solve (UBP) for the general case, it is worthwhile to mention a special case in which P¯xj = ¯xj −⟨¯xj,b⟩ ∥b∥2 2 b = 0. Clearly, P is the projection operator which projects a vector onto the orthogonal complement of the space spanned by b. In fact, we have the following theorem. Theorem 4. Let λmax ≥λ0 > λ > 0, and assume θ∗ λ0 is known. For j ∈{1, . . . , p}, if P¯xj = 0, then T(θ∗ λ, ¯xj; θ∗ λ0) = 0. 4 Because of (R1′), we immediately have the following corollary. Corollary 5. Let λ ∈(0, λmax) and j ∈{1, . . . , p}. If P¯xj = 0, then [β∗ λ]j = 0. For the general case in which P¯xj ̸= 0, let T+(θ∗ λ, ¯xj; θ∗ λ0) := max θ∈Aλ λ0 ⟨θ, +¯xj⟩, T−(θ∗ λ, ¯xj; θ∗ λ0) := max θ∈Aλ λ0 ⟨θ, −¯xj⟩. (10) Clearly, we have T(θ∗ λ, ¯xj; θ∗ λ0) = max{T+(θ∗ λ, ¯xj; θ∗ λ0), T−(θ∗ λ, ¯xj; θ∗ λ0)}. (11) Therefore, we can solve problem (UBP) by solving the two sub-problems in (10). Let ξ ∈{+1, −1}. Then problems in (10) can be written uniformly as Tξ(θ∗ λ, ¯xj; θ∗ λ0) = max θ∈Aλ λ0 ⟨θ, ξ¯xj⟩. (UBPs) To make use of the standard Lagrangian multiplier method, we transform problem (UBPs) to the following minimization problem: −Tξ(θ∗ λ, ¯xj; θ∗ λ0) = min θ∈Aλ λ0 ⟨θ, −ξ¯xj⟩ (UBP′) by noting that maxθ∈Aλ λ0 ⟨θ, ξ¯xj⟩= −minθ∈Aλ λ0 ⟨θ, −ξ¯xj⟩. Lemma 6. Let λmax ≥λ0 > λ > 0 and assume θ∗ λ0 is known. The strong duality holds for problem (UBP′). Moreover, problem (UBP′) admits an optimal solution in Aλ λ0. Because the strong duality holds for problem (UBP′) by Lemma 6, the Lagrangian multiplier method is applicable for (UBP′). In general, we need to first solve the dual problem and then recover the optimal solution of the primal problem via KKT conditions. Recall that r and ¯x∗are defined by Eq. (6) and (8) respectively. Lemma 7 derives the dual problems of (UBP′) for different cases. Lemma 7. Let λmax ≥λ0 > λ > 0 and assume θ∗ λ0 is known. For j ∈{1, . . . , p} and P¯xj ̸= 0, let ¯x = −ξ¯xj. Denote U1 = {(u1, u2) : u1 > 0, u2 ≥0} and U2 = n (u1, u2) : u1 = 0, u2 = −⟨P¯x,P¯x∗⟩ ∥P¯x∗∥2 2 o . a). If ⟨P¯x,P¯x∗⟩ ∥P¯x∥2∥P¯x∗∥2 ∈(−1, 1], the dual problem of (UBP′) is equivalent to: max (u1,u2)∈U1 ¯g(u1, u2) = −1 2u1 ∥P¯x + u2P¯x∗∥2 2 + u2m(λ0 −λ) + ⟨θ∗ λ0, ¯x⟩−1 2u1r2. (UBD′) Moreover, ¯g(u1, u2) attains its maximum in U1. b). If ⟨P¯x,P¯x∗⟩ ∥P¯x∥2∥P¯x∗∥2 = −1, the dual problem of (UBP′) is equivalent to: max (u1,u2)∈U1∪U2 ¯¯g(u1, u2) = ( ¯g(u1, u2), if (u1, u2) ∈U1, −∥P¯x∥2 ∥P¯x∗∥2 mλ, if (u1, u2) ∈U2. (UBD′′) We can now solve problem (UBP′) in the following theorem. Theorem 8. Let λmax ≥λ0 > λ > 0, d = m(λ0−λ) r∥P¯x∗∥2 and assume θ∗ λ0 is known. For j ∈{1, . . . , p} and P¯xj ̸= 0, let ¯x = −ξ¯xj. a). If ⟨P¯x,P¯x∗⟩ ∥P¯x∥2∥P¯x∗∥2 ≥d, then Tξ(θ∗ λ, ¯xj; θ∗ λ0) = r∥P¯x∥2 −⟨θ∗ λ0, ¯x⟩; (12) 5 b). If ⟨P¯x,P¯x∗⟩ ∥P¯x∥2∥P¯x∗∥2 < d, then Tξ(θ∗ λ, ¯xj; θ∗ λ0) = r∥P¯x + u∗ 2P¯x∗∥2 −u∗ 2m(λ0 −λ) −⟨θ∗ λ0, ¯x⟩, (13) where u∗ 2 = −a1+ √ ∆ 2a2 , a2 = ∥P¯x∗∥4 2(1 −d2), a1 = 2⟨P¯x, P¯x∗⟩∥P¯x∗∥2 2(1 −d2), a0 = ⟨P¯x, P¯x∗⟩2 −d2∥P¯x∥2 2∥P¯x∗∥2 2, ∆= a2 1 −4a2a0 = 4d2(1 −d2)∥P¯x∗∥4 2(∥P¯x∥2 2∥P¯x∗∥2 2 −⟨P¯x, P¯x∗⟩2). (14) Notice that, although the dual problems of (UBP′) in Lemma 7 are different, the resulting upper bound Tξ(θ∗ λ, ¯xj; θ∗ λ0) can be given by Theorem 8 in a uniform way. The tricky part is how to deal with the extremal cases in which ⟨P¯x,P¯x∗⟩ ∥P¯x∥2∥P¯x∗∥2 ∈{−1, +1}. 5 The proposed Slores Rule for ℓ1 Regularized Logistic Regression Using (R1′), we are now ready to construct the screening rules for the ℓ1 Regularized Logistic Regression. By Corollary 5, we can see that the orthogonality between the jth feature and the response vector b implies the absence of ¯xj from the resulting model. For the general case in which P¯xj ̸= 0, (R1′) implies that if T(θ∗ λ, ¯xj; θ∗ λ0) = max{T+(θ∗ λ, ¯xj; θ∗ λ0), T−(θ∗ λ, ¯xj; θ∗ λ0)} < mλ, then the jth feature can be discarded from the optimization of (LRPλ). Notice that, letting ξ = ±1, T+(θ∗ λ, ¯xj; θ∗ λ0) and T−(θ∗ λ, ¯xj; θ∗ λ0) have been solved by Theorem 8. Rigorously, we have the following theorem. Theorem 9 (Slores). Let λ0 > λ > 0 and assume θ∗ λ0 is known. 1. If λ ≥λmax, then β∗ λ = 0; 2. If λmax ≥λ0 > λ > 0 and either of the following holds: (a) P¯xj = 0, (b) max{Tξ(θ∗ λ, ¯xj; θ∗ λ0) : ξ = ±1} < mλ, then [β∗ λ]j = 0. Based on Theorem 9, we construct the Slores rule as summarized below in Algorithm 1. Algorithm 1 R = Slores(X, b, λ, λ0, θ∗ λ0) Initialize R := {1, . . . , p}; if λ ≥λmax then set R = ∅; else for j = 1 to p do if P¯xj = 0 then remove j from R; else if max{Tξ(θ∗ λ, ¯xj; θ∗ λ0) : ξ = ±1} < mλ then remove j from R; end if end for end if Return: R Notice that, the output R of Slores is the indices of the features that need to be entered to the optimization. As a result, suppose the output of Algorithm 1 is R = {j1, . . . , jk}, we can substitute the full matrix X in problem (LRPλ) with the sub-matrix XR = (¯xj1, . . . , ¯xjk) and just solve for [β∗ λ]R and c∗ λ. On the other hand, Algorithm 1 implies that Slores needs five inputs. Since X and b come with the data and λ is chosen by the user, we only need to specify θ∗ λ0 and λ0. In other words, we need to provide Slores with a dual optimal solution of problem (LRDλ) for an arbitrary parameter. A natural choice is by setting λ0 = λmax and θ∗ λ0 = θ∗ λmax given by Eq. (1) and Eq. (2) in closed form. 6 Experiments We evaluate our screening rules using the newgroup data set [10] and Yahoo web pages data sets [23]. The newgroup data set is cultured from the data by Koh et al. [10]. The Yahoo data sets include 11 top-level categories, each of which is further divided into a set of subcategories. In 6 our experiment we construct five balanced binary classification datasets from the topics of Computers, Education, Health, Recreation, and Science. For each topic, we choose samples from one subcategory as the positive class and randomly sample an equal number of samples from the rest of subcategories as the negative class. The statistics of the data sets are given in Table 1. Table 1: Statistics of the test data sets. Data set m p no. nonzeros newsgroup 11269 61188 1467345 Computers 216 25259 23181 Education 254 20782 28287 Health 228 18430 40145 Recreation 370 25095 49986 Science 222 24002 37227 Table 2: Running time (in seconds) of Slores, strong rule, SAFE and the solver. Slores Strong Rule SAFE Solver 0.37 0.33 1128.65 10.56 We compare the performance of Slores and the strong rule which achieves state-of-the-art performance for ℓ1 regularized LR. We do not include SAFE because it is less effective in discarding features than strong rules and requires much higher computational time [22]. Fig. 1 has shown the performance of Slores, strong rule and SAFE. We compare the efficiency of the three screening rules on the same prostate cancer data set in Table 2. All of the screening rules are tested along a sequence of 86 parameter values equally spaced on the λ/λmax scale from 0.1 to 0.95. We repeat the procedure 100 times and during each time we undersample 80% of the data. We report the total running time of the three screening rules over the 86 values of λ/λmax in Table 2. For reference, we also report the total running time of the solver1. We observe that the running time of Slores and strong rule is negligible compared to that of the solver. However, SAFE takes much longer time even than the solver. In Section 6.1, we evaluate the performance of Slores and strong rule. Recall that we use the rejection ratio, i.e., the ratio between the number of features discarded by the screening rules and the number of features with 0 coefficients in the solution, to measure the performance of screening rules. Note that, because no features with non-zero coefficients in the solution would be mistakenly discarded by Slores, its rejection ratio is no larger than one. We then compare the efficiency of Slores and strong rule in Section 6.2. The experiment settings are as follows. For each data set, we undersample 80% of the date and run Slores and strong rules along a sequence of 86 parameter values equally spaced on the λ/λmax scale from 0.1 to 0.95. We repeat the procedure 100 times and report the average performance and running time at each of the 86 values of λ/λmax. Slores, strong rules and SAFE are all implemented in Matlab. All of the experiments are carried out on a Intel(R) (i7-2600) 3.4Ghz processor. 6.1 Comparison of Performance In this experiment, we evaluate the performance of the Slores and the strong rule via the rejection ratio. Fig. 2 shows the rejection ratio of Slores and strong rule on six real data sets. When λ/λmax > 0.5, we can see that both Slores and strong rule are able to identify almost 100% of the inactive features, i.e., features with 0 coefficients in the solution vector. However, when λ/λmax ≤0.5, strong rule can not detect the inactive features. In contrast, we observe that Slores exhibits much stronger capability in discarding inactive features for small λ, even when λ/λmax is close to 0.1. Taking the data point at which λ/λmax = 0.1 for example, Slores discards about 99% inactive features for the newsgroup data set. For the other data sets, more than 80% inactive features are identified by Slores. Thus, in terms of rejection ratio, Slores significantly outperforms the strong rule. Moreover, the discarded features by Slores are guaranteed to have 0 coefficients in the solution. But strong rule may mistakenly discard features which have non-zero coefficients in the solution. 6.2 Comparison of Efficiency We compare efficiency of Slores and the strong rule in this experiment. The data sets for evaluating the rules are the same as Section 6.1. The running time of the screening rules reported in Fig. 3 includes the computational cost of the rules themselves and that of the solver after screening. We plot the running time of the screening rules against that of the solver without screening. As indicated by Fig. 2, when λ/λmax > 0.5, Slores and strong rule discards almost 100% of the inactive features. 1In this paper, the ground truth is computed by SLEP [14]. 7 (a) newsgroup (b) Computers (c) Education (d) Health (e) Recreation (f) Science Figure 2: Comparison of the performance of Slores and strong rules on six real data sets. (a) newsgroup (b) Computers (c) Education (d) Health (e) Recreation (f) Science Figure 3: Comparison of the efficiency of Slores and strong rule on six real data sets. As a result, the size of the feature matrix involved in the optimization of problem (LRPλ) is greatly reduced. From Fig. 3, we can observe that the efficiency is improved by about one magnitude on average compared to that of the solver without screening. However, when λ/λmax < 0.5, strong rule can not identify any inactive features and thus the running time is almost the same as that of the solver without screening. In contrast, Slores is still able to identify more than 80% of the inactive features for the data sets cultured from the Yahoo web pages data sets and thus the efficiency is improved by roughly 5 times. For the newgroup data set, about 99% inactive features are identified by Slores which leads to about 10 times savings in running time. These results demonstrate the power of the proposed Slores rule in improving the efficiency of solving the ℓ1 regularized LR. 7 Conclusions In this paper, we propose novel screening rules to effectively discard features for ℓ1 regularized LR. Extensive numerical experiments on real data demonstrate that Slores outperforms the existing state-of-the-art screening rules. We plan to extend the framework of Slores to more general sparse formulations, including convex ones, like group Lasso, fused Lasso, ℓ1 regularized SVM, and nonconvex ones, like ℓp regularized problems where 0 < p < 1. 8 References [1] M. Asgary, S. Jahandideh, P. Abdolmaleki, and A. Kazemnejad. Analysis and identification of β-turn types using multinomial logistic regression and artificial neural network. Bioinformatics, 23(23):3125– 3130, 2007. [2] C. Boyd, M. Tolson, and W. Copes. Evaluating trauma care: The TRISS method, trauma score and the injury severity score. Journal of Trauma, 27:370–378, 1987. [3] J. R. Brzezinski and G. J. Knafl. Logistic regression modeling for context-based classification. In DEXA Workshop, pages 755–759, 1999. [4] K. Chaudhuri and C. Monteleoni. Privacy-preserving logistic regression. In NIPS, 2008. [5] B. Efron, T. Hastie, I. Johnstone, and R. Tibshirani. Least angle regression. Ann. Statist., 32:407–499, 2004. [6] L. El Ghaoui, V. Viallon, and T. Rabbani. Safe feature elimination for the lasso and sparse supervised learning problems. arXiv:1009.4219v2. [7] J. Friedman, T. Hastie, and R. Tibshirani. Additive logistic regression: a statistical view of boosting. The Annals of Statistics, 38(2), 2000. [8] A. Genkin, D. Lewis, and D. Madigan. Large-scale bayesian logistic regression for text categorization. Technometrics, 49:291–304(14), 2007. [9] S. Gould, J. Rodgers, D. Cohen, G. Elidan, and D. Koller. Multi-class segmentation with relative location prior. International Journal of Computer Vision, 80(3):300–316, 2008. [10] K. Koh, S. J. Kim, and S. Boyd. An interior-point method for large scale ℓ1-regularized logistic regression. J. Mach. Learn. Res., 8:1519–1555, 2007. [11] B. Krishnapuram, L. Carin, M. Figueiredo, and A. Hartemink. Sparse multinomial logistic regression: Fast algorithms and generalization bounds. IEEE Trans. Pattern Anal. Mach. Intell., 27:957–968, 2005. [12] S. Lee, H. Lee, P. Abbeel, and A. Ng. Efficient l1 regularized logistic regression. In In AAAI-06, 2006. [13] J. Liao and K. Chin. Logistic regression for disease classification using microarray data: model selection in a large p and small n case. Bioinformatics, 23(15):1945–1951, 2007. [14] J. Liu, S. Ji, and J. Ye. SLEP: Sparse Learning with Efficient Projections. Arizona State University, 2009. [15] S. Martins, L. Sousa, and J. Martins. Additive logistic regression applied to retina modelling. In ICIP (3), pages 309–312. IEEE, 2007. [16] Y. Nesterov. Introductory Lectures on Convex Optimization: A Basic Course. Springer, 2004. [17] S. Palei and S. Das. Logistic regression model for prediction of roof fall risks in bord and pillar workings in coal mines: An approach. Safety Science, 47:88–96, 2009. [18] M. Park and T. Hastie. ℓ1 regularized path algorithm for generalized linear models. J. R. Statist. Soc. B, 69:659–677, 2007. [19] M. Sartor, G. Leikauf, and M. Medvedovic. LRpath: a logistic regression approach for identifying enriched biological groups in gene expression data. Bioinformatics, 25(2):211–217, 2009. [20] D. Sun, T. Erp, P. Thompson, C. Bearden, M. Daley, L. Kushan, M. Hardt, K. Nuechterlein, A. Toga, and T. Cannon. Elucidating a magnetic resonance imaging-based neuroanatomic biomarker for psychosis: classification analysis using probabilistic brain atlas and machine learning algorithms. Biological Psychiatry, 66:1055–1–60, 2009. [21] R. Tibshirani. Regression shringkage and selection via the lasso. J. R. Statist. Soc. B, 58:267–288, 1996. [22] R. Tibshirani, J. Bien, J. Friedman, T. Hastie, N. Simon, J. Taylor, and R. Tibshirani. Strong rules for discarding predictors in lasso-type problems. J. R. Statist. Soc. B, 74:245–266, 2012. [23] N. Ueda and K. Saito. Parametric mixture models for multi-labeled text. Advances in neural information processing systems, 15:721–728, 2002. [24] J. Wang, J. Zhou, J. Liu, P. Wonka, and J. Ye. A safe screening rule for sparse logistic regression. arXiv:1307.4145v2, 2013. [25] T. T. Wu, Y. F. Chen, T. Hastie, E. Sobel, and K. Lange. Genome-wide association analysis by lasso penalized logistic regression. Bioinformatics, 25:714–721, 2009. [26] Z. J. Xiang and P. J. Ramadge. Fast lasso screening tests based on correlations. In IEEE ICASSP, 2012. [27] J. Zhu and T. Hastie. Kernel logistic regression and the import vector machine. In T. G. Dietterich, S. Becker, and Z. Ghahramani, editors, NIPS, pages 1081–1088. MIT Press, 2001. [28] J. Zhu and T. Hastie. Classification of gene microarrays by penalized logistic regression. Biostatistics, 5:427–443, 2004. 9
2014
36
5,469
Median Selection Subset Aggregation for Parallel Inference Xiangyu Wang Dept. of Statistical Science Duke University xw56@stat.duke.edu Peichao Peng Statistics Department University of Pennsylvania ppeichao@yahoo.com David B. Dunson Dept. of Statistical Science Duke University dunson@stat.duke.edu Abstract For massive data sets, efficient computation commonly relies on distributed algorithms that store and process subsets of the data on different machines, minimizing communication costs. Our focus is on regression and classification problems involving many features. A variety of distributed algorithms have been proposed in this context, but challenges arise in defining an algorithm with low communication, theoretical guarantees and excellent practical performance in general settings. We propose a MEdian Selection Subset AGgregation Estimator (message) algorithm, which attempts to solve these problems. The algorithm applies feature selection in parallel for each subset using Lasso or another method, calculates the ‘median’ feature inclusion index, estimates coefficients for the selected features in parallel for each subset, and then averages these estimates. The algorithm is simple, involves very minimal communication, scales efficiently in both sample and feature size, and has theoretical guarantees. In particular, we show model selection consistency and coefficient estimation efficiency. Extensive experiments show excellent performance in variable selection, estimation, prediction, and computation time relative to usual competitors. 1 Introduction The explosion in both size and velocity of data has brought new challenges to the design of statistical algorithms. Parallel inference is a promising approach for solving large scale problems. The typical procedure for parallelization partitions the full data into multiple subsets, stores subsets on different machines, and then processes subsets simultaneously. Processing on subsets in parallel can lead to two types of computational gains. The first reduces time for calculations within each iteration of optimization or sampling algorithms via faster operations; for example, in conducting linear algebra involved in calculating likelihoods or gradients [1–7]. Although such approaches can lead to substantial reductions in computational bottlenecks for big data, the amount of gain is limited by the need to communicate across computers at each iteration. It is well known that communication costs are a major factor driving the efficiency of distributed algorithms, so that it is of critical importance to limit communication. This motivates the second type of approach, which conducts computations completely independently on the different subsets, and then combines the results to obtain the final output. This limits communication to the final combining step, and may lead to simpler and much faster algorithms. However, a major issue is how to design algorithms that are close to communication free, which can preserve or even improve the statistical accuracy relative to (much slower) algorithms applied to the entire data set simultaneously. We focus on addressing this challenge in this article. There is a recent flurry of research in both Bayesian and frequentist settings focusing on the second approach [8–14]. Particularly relevant to our approach is the literature on methods for combining point estimators obtained in parallel for different subsets [8, 9, 13]. Mann et al. [9] suggest using 1 averaging for combining subset estimators, and Zhang et al. [8] prove that such estimators will achieve the same error rate as the ones obtained from the full set if the number of subsets m is well chosen. Minsker [13] utilizes the geometric median to combine the estimators, showing robustness and sharp concentration inequalities. These methods function well in certain scenarios, but might not be broadly useful. In practice, inference for regression and classification typically contains two important components: One is variable or feature selection and the other is parameter estimation. Current combining methods are not designed to produce good results for both tasks. To obtain a simple and computationally efficient parallel algorithm for feature selection and coefficient estimation, we propose a new combining method, referred to as message. The detailed algorithm will be fully described in the next section. There are related methods, which were proposed with the very different goal of combining results from different imputed data sets in missing data contexts [15]. However, these methods are primarily motivated for imputation aggregation, do not improve computational time, and lack theoretical guarantees. Another related approach is the bootstrap Lasso (Bolasso) [16], which runs Lasso independently for multiple bootstrap samples, and then intersects the results to obtain the final model. Asymptotic properties are provided under fixed number of features (p fixed) and the computational burden is not improved over applying Lasso to the full data set. Our message algorithm has strong justification in leading to excellent convergence properties in both feature selection and prediction, while being simple to implement and computationally highly efficient. The article is organized as follows. In section 2, we describe message in detail. In section 3, we provide theoretical justifications and show that message can produce better results than full data inferences under certain scenarios. Section 4 evaluates the performance of message via extensive numerical experiments. Section 5 contains a discussion of possible generalizations of the new method to broader families of models and online learning. All proofs are provided in the supplementary materials. 2 Parallelized framework Consider the linear model which has n observations and p features, Y = Xβ + ǫ, where Y is an n × 1 response vector, X is an n × p matrix of features and ǫ is the observation error, which is assumed to have mean zero and variance σ2. The fundamental idea for communication efficient parallel inference is to partition the data set into m subsets, each of which contains a small portion of the data n/m. Separate analysis on each subset will then be carried out and the result will be aggregated to produce the final output. As mentioned in the previous section, regression problems usually consist of two stages: feature selection and parameter estimation. For linear models, there is a rich literature on feature selection and we only consider two approaches. The risk inflation criterion (RIC), or more generally, the generalized information criterion (GIC) is an l0-based feature selection technique for high dimensional data [17–20]. GIC attempts to solve the following optimization problem, ˆ Mλ = arg min M⊂{1,2,··· ,p} ∥Y −XMβM∥2 2 + λ|M|σ2 (1) for some well chosen λ. For λ = 2(log p + log log p) it corresponds to RIC [18], for λ = (2 log p + log n) it corresponds to extended BIC [19] and λ = log n reduces to the usual BIC. Konishi and Kitagawa [18] prove the consistency of GIC for high dimensional data under some regularity conditions. Lasso [21] is an l1 based feature selection technique, which solves the following problem ˆβ = arg min β 1 n∥Y −Xβ∥2 2 + λ∥β∥1 (2) for some well chosen λ. Lasso transfers the original NP hard l0-based optimization to a problem that can be solved in polynomial time. Zhao and Yu [22] prove the selection consistency of Lasso under the Irrepresentable condition. Based on the model selected by either GIC or Lasso, we could then apply the ordinary least square (OLS) estimator to find the coefficients. 2 As briefly discussed in the introduction, averaging and median aggregation approaches possess different advantages but also suffer from certain drawbacks. To carefully adapt these features to regression and classification, we propose the median selection subset aggregation (message) algorithm, which is motivated as follows. Averaging of sparse regression models leads to an inflated number of features having non-zero coefficients, and hence is not appropriate for model aggregation when feature selection is of interest. When conducting Bayesian variable selection, the median probability model has been recommended as selecting the single model that produces the best approximation to model-averaged predictions under some simplifying assumptions [23]. The median probability model includes those features having inclusion probabilities greater than 1/2. We can apply this notion to subset-based inference by including features that are included in a majority of the subset-specific analyses, leading to selecting the ‘median model’. Let γ(i) = (γ(i) 1 , · · · , γ(i) p ) denote a vector of feature inclusion indicators for the ith subset, with γ(i) j = 1 if feature j is included so that the coefficient βj on this feature is non-zero, with γ(i) j = 0 otherwise. The inclusion indicator vector for the median model Mγ can be obtained by γ = arg min γ∈{0,1}p m X i=1 ∥γ −γ(i)∥1, or equivalently, γj = median{γ(i) j , i = 1, 2, · · · , m} for j = 1, 2, · · · , p. If we apply Lasso or GIC to the full data set, in the presence of heavy-tailed observation errors, the estimated feature inclusion indicator vector will converge to the true inclusion vector at a polynomial rate. It is shown in the next section that the convergence rate of the inclusion vector for the median model can be improved to be exponential, leading to substantial gains in not only computational time but also feature selection performance. The intuition for this gain is that in the heavy-tailed case, a proportion of the subsets will contain outliers having a sizable influence on feature selection. By taking the median, we obtain a central model that is not so influenced by these outliers, and hence can concentrate more rapidly. As large data sets typically contain outliers and data contamination, this is a substantial practical advantage in terms of performance even putting aside the computational gain. After feature selection, we obtain estimates of the coefficients for each selected feature by averaging the coefficient estimates from each subset, following the spirit of [8]. The message algorithm (described in Algorithm 1) only requires each machine to pass the feature indicators to a central computer, which (essentially instantaneously) calculates the median model, passes back the corresponding indicator vector to the individual computers, which then pass back coefficient estimates for averaging. The communication costs are negligible. 3 Theory In this section, we provide theoretical justification for the message algorithm in the linear model case. The theory is easily generalized to a much wider range of models and estimation techniques, as will be discussed in the last section. Throughout the paper we will assume X = (x1, · · · , xp) is an n × p feature matrix, s = |S| is the number of non-zero coefficients and λ(A) is the eigenvalue for matrix A. Before we proceed to the theorems, we enumerate several conditions that are required for establishing the theory. We assume there exist constants V1, V2 > 0 such that A.1 Consistency condition for estimation. • 1 nxT i xi ≤V1 for i = 1, 2, · · · , p • λmin( 1 nXT S XS) ≥V2 A.2 Conditions on ǫ, |S| and β • E(ǫ2k) < ∞for some k > 0 • s = |S| ≤c1nι for some 0 ≤ι < 1 3 Algorithm 1 Message algorithm Initialization: 1: Input (Y, X), n, p, and m 2: # n is the sample size, p is the number of features and m is the number of subsets 3: Randomly partition (Y, X) into m subsets (Y (i), X(i)) and distribute them on m machines. Iteration: 4: for i = 1 to m do 5: γ(i) = minMγ loss(Y (i), X(i)) # γ(i) is the estimated model via Lasso or GIC 6: # Gather all subset models γ(i) to obtain the median model Mγ 7: for j = 1 to p do 8: γj = median{γ(i) j , i = 1, 2, · · · , m} 9: # Redistribute the estimated model Mγ to all subsets 10: for i = 1 to m do 11: β(i) = (X(i)T γ X(i) γ )−1X(i)T γ Y (i) γ # Estimate the coefficients 12: # Gather all subset estimations β(i) 13: ¯β = Pm i=1 β(i)/m 14: 15: return ¯β, γ • mini∈S |βi| ≥c2n−1−τ 2 for some 0 < τ ≤1 A.3 (Lasso) The strong irrepresentable condition. • Assuming XS and XSc are the features having non-zero and zero coefficients, respectively, there exists some positive constant vector η such that |XT ScXS(XT S XS)−1sign(βS)| < 1 −η A.4 (Generalized information criterion, GIC) The sparse Riesz condition. • There exist constants κ ≥0 and c > 0 such that ρ > cn−κ, where ρ = inf |π|≤|S| λmin(XT π Xπ/n) A.1 is the usual consistency condition for regression. A.2 restricts the behaviors of the three key terms and is crucial for model selection. These are both usual assumptions. See [19,20,22]. A.3 and A.4 are specific conditions for model selection consistency for Lasso/GIC. As noted in [22], A.3 is almost sufficient and necessary for sign consistency. A.4 could be relaxed slightly as shown in [19], but for simplicity we rely on this version. To ameliorate possible concerns on how realistic these conditions are, we provide further justifications via Theorem 3 and 4 in the supplementary material. Theorem 1. (GIC) Assume each subset satisfies A.1, A.2 and A.4, and p ≤nα for some α < k(τ − η), where η = max{ι/k, 2κ}. If ι < τ, 2κ < τ and λ in (1) are chosen so that λ = c0/σ2(n/m)τ−κ for some c0 < cc2/2, then there exists some constant C0 such that for n ≥(2C0p)(kτ−kη)−1 and m = ⌊(4C0)−(kτ−kη)−1 · n/p(kτ−kη)−1⌋, the selected model Mγ follows, P(Mγ = MS) ≥1 −exp  −n1−α/(kτ−kη) 24(4C0)(kτ−kη)  , and defining C′ 0 = mini λmin(X(i)T γ X(i) γ /ni), the mean square error follows, E∥¯β −β∥2 2 ≤σ2V −1 2 s n + exp  −n1−α/(kτ−kη) 24(4C0)(kτ−kη)  (1 + 2C′−1 0 sV1)∥β∥2 2 + C′−1 0 σ2  . Theorem 2. (Lasso) Assume each subset satisfies A.1, A.2 and A.3, and p ≤nα for some α < k(τ −ι). If ι < τ and λ in (2) are chosen so that λ = c0(n/m) ι−τ+1 2 for some c0 < c1V2/c2, then there exists some constant C0 such that for n ≥(2C0p)(kτ−kι)−1 and m = ⌊(4C0)(kτ−kι)−1 · n/p(kτ−kι)−1⌋, the selected model Mγ follows P(Mγ = MS) ≥1 −exp  −n1−α/(kτ−kι) 24(4C0)(kτ−kι)  , 4 and with the same C′ 0 defined in Theorem 1, we have E∥¯β −β∥2 2 ≤σ2V −1 2 s n + exp  −n1−α/(kτ−kι) 24(4C0)(kτ−kι)  (1 + 2C′−1 0 sV1)∥β∥2 2 + C′−1 0 σ2  . The above two theorems boost the model consistency property from the original polynomial rate [20,22] to an exponential rate for heavy-tailed errors. In addition, the mean square error, as shown in the above equation, preserves almost the same convergence rate as if the full data is employed and the true model is known. Therefore, we expect a similar or better performance of message with a significantly lower computation load. Detailed comparisons are demonstrated in Section 4. 4 Experiments This section assesses the performance of the message algorithm via extensive examples, comparing the results to • Full data inference. (denoted as “full data”) • Subset averaging. Partition and average the estimates obtained on all subsets. (denoted as “averaging”) • Subset median. Partition and take the marginal median of the estimates obtained on all subsets (denoted as “median”) • Bolasso. Run Lasso on multiple bootstrap samples and intersect to select model. Then estimate the coefficients based on the selected model. (denoted as “Bolasso”) The Lasso part of all algorithms will be implemented by the “glmnet” package [24]. (We did not use ADMM [25] for Lasso as its actual performance might suffer from certain drawbacks [6] and is reported to be slower than “glmnet” [26]) 4.1 Synthetic data sets We use the linear model and the logistic model for (p; s) = (1000; 3) or (10,000; 3) with different sample size n and different partition number m to evaluate the performance. The feature vector is drawn from a multivariate normal distribution with correlation ρ = 0 or 0.5. Coefficients β are chosen as, βi ∼(−1)ber(0.4)(8 log n/√n + |N(0, 1)|), i ∈S Since GIC is intractable to implement (NP hard), we combine it with Lasso for variable selection: Implement Lasso for a set of different λ’s and determine the optimal one via GIC. The concrete setup of models are as follows, Case 1 Linear model with ǫ ∼N(0, 22). Case 2 Linear model with ǫ ∼t(0, df = 3). Case 3 Logistic model. For p = 1, 000, we simulate 200 data sets for each case, and vary the sample size from 2000 to 10,000. For each case, the subset size is fixed to 400, so the number of subsets will be changing from 5 to 25. In the experiment, we record the mean square error for ˆβ, probability of selecting the true model and computational time, and plot them in Fig 1 - 6. For p = 10,000, we simulate 50 data sets for each case, and let the sample size range from 20,000 to 50,000 with subset size fixed to 2000. Results for p = 10,000 are provided in supplementary materials. It is clear that message had excellent performance in all of the simulation cases, with low MSE, high probability of selecting the true model, and low computational time. The other subset-based methods we considered had similar computational times and also had computational burdens that effectively did not increase with sample size, while the full data analysis and bootstrap Lasso approach both were substantially slower than the subset methods, with the gap increasing linearly in sample size. In terms of MSE, the averaging and median approaches both had dramatically worse 5 2000 4000 6000 8000 10000 0.0 0.1 0.2 0.3 0.4 Mean square error Sample size n value median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 0.2 0.4 0.6 0.8 1.0 Probability to select the true model Sample size n prob median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 0.5 1.0 1.5 2.0 2.5 Computational time Sample size n seconds median fullset average message bolasso Figure 1: Results for case 1 with ρ = 0. 2000 4000 6000 8000 10000 0.0 0.2 0.4 0.6 0.8 Mean square error Sample size n value median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 0.2 0.4 0.6 0.8 1.0 Probability to select the true model Sample size n prob median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 1.0 2.0 3.0 Computational time Sample size n seconds median fullset average message bolasso Figure 2: Results for case 1 with ρ = 0.5. 2000 4000 6000 8000 10000 0.00 0.02 0.04 0.06 0.08 0.10 Mean square error Sample size n value median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 0.2 0.4 0.6 0.8 1.0 Probability to select the true model Sample size n prob median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 0.5 1.0 1.5 2.0 2.5 Computational time Sample size n seconds median fullset average message bolasso Figure 3: Results for case 2 with ρ = 0. 2000 4000 6000 8000 10000 0.00 0.10 0.20 0.30 Mean square error Sample size n value median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 0.2 0.4 0.6 0.8 1.0 Probability to select the true model Sample size n prob median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 0.5 1.0 1.5 2.0 2.5 Computational time Sample size n seconds median fullset average message bolasso Figure 4: Results for case 2 with ρ = 0.5. 6 2000 4000 6000 8000 10000 0 1 2 3 4 5 6 Mean square error Sample size n value median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 0.2 0.4 0.6 0.8 1.0 Probability to select the true model Sample size n prob median fullset average message bolasso 2000 4000 6000 8000 10000 0 2 4 6 8 Computational time Sample size n seconds median fullset average message bolasso Figure 5: Results for case 3 with ρ = 0. 2000 4000 6000 8000 10000 0 2 4 6 8 10 Mean square error Sample size n value median fullset average message bolasso 2000 4000 6000 8000 10000 0.0 0.2 0.4 0.6 0.8 1.0 Probability to select the true model Sample size n prob median fullset average message bolasso 2000 4000 6000 8000 10000 0 2 4 6 8 10 12 Computational time Sample size n seconds median fullset average message bolasso Figure 6: Results for case 3 with ρ = 0.5. performance than message in every case, while bootstrap Lasso was competitive (MSEs were same order of magnitude with message ranging from effectively identical to having a small but significant advantage), with both message and bootstrap Lasso clearly outperforming the full data approach. In terms of feature selection performance, averaging had by far the worst performance, followed by the full data approach, which was substantially worse than bootstrap Lasso, median and message, with no clear winner among these three methods. Overall message clearly had by far the best combination of low MSE, accurate model selection and fast computation. 4.2 Individual household electric power consumption This data set contains measurements of electric power consumption for every household with a one-minute sampling rate [27]. The data have been collected over a period of almost 4 years and contain 2,075,259 measurements. There are 8 predictors, which are converted to 74 predictors due to re-coding of the categorical variables (date and time). We use the first 2,000,000 samples as the training set and the remaining 75,259 for testing the prediction accuracy. The data are partitioned into 200 subsets for parallel inference. We plot the prediction accuracy (mean square error for test samples) against time for full data, message, averaging and median method in Fig 7. Bolasso is excluded as it did not produce meaningful results within the time span. To illustrate details of the performance, we split the time line into two parts: the early stage shows how all algorithms adapt to a low prediction error and a later stage captures more subtle performance of faster algorithms (full set inference excluded due to the scale). It can be seen that message dominates other algorithms in both speed and accuracy. 4.3 HIGGS classification The HIGGS data have been produced using Monte Carlo simulations from a particle physics model [28]. They contain 27 predictors that are of interest to physicists wanting to distinguish between two classes of particles. The sample size is 11,000,000. We use the first 10,000,000 samples for training a logistic model and the rest to test the classification accuracy. The training set is partitioned into 1,000 subsets for parallel inference. The classification accuracy (probability of correctly predicting the class of test samples) against computational time is plotted in Fig 8 (Bolasso excluded for the same reason as above). 7 0.060 0.065 0.070 0.075 0.080 0.0 0.2 0.4 0.6 0.8 Mean prediction error (earlier stage) Time (sec) value message median average fullset 0.084 0.086 0.088 0.090 0.092 0.094 0.0016 0.0020 0.0024 Mean prediction error (later stage) Time (sec) value message median average Figure 7: Results for power consumption data. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.50 0.55 0.60 0.65 Mean prediction accuracy Time (sec) value message median average fullset Figure 8: Results for HIGGS classification. Message adapts to the prediction bound quickly. Although the classification results are not as good as the benchmarks listed in [28] (due to the choice of a simple parametric logistic model), our new algorithm achieves the best performance subject to the constraints of the model class. 5 Discussion and conclusion In this paper, we proposed a flexible and efficient message algorithm for regression and classification with feature selection. Message essentially eliminates the computational burden attributable to communication among machines, and is as efficient as other simple subset aggregation methods. By selecting the median model, message can achieve better accuracy even than feature selection on the full data, resulting in an improvement also in MSE performance. Extensive simulation experiments show outstanding performance relative to competitors in terms of computation, feature selection and prediction. Although the theory described in Section 3 is mainly concerned with linear models, the algorithm is applicable in fairly wide situations. Geometric median is a topological concept, which allows the median model to be obtained in any normed model space. The properties of the median model result from independence of the subsets and weak consistency on each subset. Once these two conditions are satisfied, the property shown in Section 3 can be transferred to essentially any model space. The follow-up averaging step has been proven to be consistent for all M estimators with a proper choice of the partition number [8]. References [1] Gonzalo Mateos, Juan Andr´es Bazerque, and Georgios B Giannakis. Distributed sparse linear regression. Signal Processing, IEEE Transactions on, 58(10):5262–5276, 2010. [2] Joseph K Bradley, Aapo Kyrola, Danny Bickson, and Carlos Guestrin. Parallel coordinate descent for l1-regularized loss minimization. arXiv preprint arXiv:1105.5379, 2011. [3] Chad Scherrer, Ambuj Tewari, Mahantesh Halappanavar, and David Haglin. Feature clustering for accelerating parallel coordinate descent. In NIPS, pages 28–36, 2012. 8 [4] Alexander Smola and Shravan Narayanamurthy. An architecture for parallel topic models. Proceedings of the VLDB Endowment, 3(1-2):703–710, 2010. [5] Feng Yan, Ningyi Xu, and Yuan Qi. Parallel inference for latent dirichlet allocation on graphics processing units. In NIPS, volume 9, pages 2134–2142, 2009. [6] Zhimin Peng, Ming Yan, and Wotao Yin. Parallel and distributed sparse optimization. preprint, 2013. [7] Ofer Dekel, Ran Gilad-Bachrach, Ohad Shamir, and Lin Xiao. Optimal distributed online prediction using mini-batches. The Journal of Machine Learning Research, 13:165–202, 2012. [8] Yuchen Zhang, John C Duchi, and Martin J Wainwright. Communication-efficient algorithms for statistical optimization. In NIPS, volume 4, pages 5–1, 2012. [9] Gideon Mann, Ryan T McDonald, Mehryar Mohri, Nathan Silberman, and Dan Walker. Efficient large-scale distributed training of conditional maximum entropy models. In NIPS, volume 22, pages 1231–1239, 2009. [10] Steven L Scott, Alexander W Blocker, Fernando V Bonassi, Hugh A Chipman, Edward I George, and Robert E McCulloch. Bayes and big data: The consensus monte carlo algorithm. In EFaBBayes 250 conference, volume 16, 2013. [11] Willie Neiswanger, Chong Wang, and Eric Xing. Asymptotically exact, embarrassingly parallel MCMC. arXiv preprint arXiv:1311.4780, 2013. [12] Xiangyu Wang and David B Dunson. Parallelizing MCMC via weierstrass sampler. arXiv preprint arXiv:1312.4605, 2013. [13] Stanislav Minsker. Geometric median and robust estimation in banach spaces. arXiv preprint arXiv:1308.1334, 2013. [14] Stanislav Minsker, Sanvesh Srivastava, Lizhen Lin, and David B Dunson. Robust and scalable bayes via a median of subset posterior measures. arXiv preprint arXiv:1403.2660, 2014. [15] Angela M Wood, Ian R White, and Patrick Royston. How should variable selection be performed with multiply imputed data? Statistics in medicine, 27(17):3227–3246, 2008. [16] Francis R Bach. Bolasso: model consistent lasso estimation through the bootstrap. In Proceedings of the 25th international conference on Machine learning, pages 33–40. ACM, 2008. [17] Dean P Foster and Edward I George. The risk inflation criterion for multiple regression. The Annals of Statistics, pages 1947–1975, 1994. [18] Sadanori Konishi and Genshiro Kitagawa. Generalised information criteria in model selection. Biometrika, 83(4):875–890, 1996. [19] Jiahua Chen and Zehua Chen. Extended bayesian information criteria for model selection with large model spaces. Biometrika, 95(3):759–771, 2008. [20] Yongdai Kim, Sunghoon Kwon, and Hosik Choi. Consistent model selection criteria on high dimensions. The Journal of Machine Learning Research, 98888(1):1037–1057, 2012. [21] Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pages 267–288, 1996. [22] Peng Zhao and Bin Yu. On model selection consistency of lasso. The Journal of Machine Learning Research, 7:2541–2563, 2006. [23] Maria Maddalena Barbieri and James O Berger. Optimal predictive model selection. Annals of Statistics, pages 870–897, 2004. [24] Jerome Friedman, Trevor Hastie, and Rob Tibshirani. Regularization paths for generalized linear models via coordinate descent. Journal of statistical software, 33(1):1, 2010. [25] Stephen Boyd, Neal Parikh, Eric Chu, Borja Peleato, and Jonathan Eckstein. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends R⃝in Machine Learning, 3(1):1–122, 2011. [26] Xingguo Li, Tuo Zhao, Xiaoming Yuan, and Han Liu. An R Package flare for high dimensional linear regression and precision matrix estimation, 2013. [27] K. Bache and M. Lichman. UCI machine learning repository, 2013. [28] Pierre Baldi, Peter Sadowski, and Daniel Whiteson. Deep learning in high-energy physics: Improving the search for exotic particles. arXiv preprint arXiv:1402.4735, 2014. 9
2014
360
5,470
Design Principles of the Hippocampal Cognitive Map Kimberly L. Stachenfeld1, Matthew M. Botvinick1, and Samuel J. Gershman2 1Princeton Neuroscience Institute and Department of Psychology, Princeton University 2Department of Brain and Cognitive Sciences, Massachusetts Institute of Technology kls4@princeton.edu, matthewb@princeton.edu, sjgershm@mit.edu Abstract Hippocampal place fields have been shown to reflect behaviorally relevant aspects of space. For instance, place fields tend to be skewed along commonly traveled directions, they cluster around rewarded locations, and they are constrained by the geometric structure of the environment. We hypothesize a set of design principles for the hippocampal cognitive map that explain how place fields represent space in a way that facilitates navigation and reinforcement learning. In particular, we suggest that place fields encode not just information about the current location, but also predictions about future locations under the current transition distribution. Under this model, a variety of place field phenomena arise naturally from the structure of rewards, barriers, and directional biases as reflected in the transition policy. Furthermore, we demonstrate that this representation of space can support efficient reinforcement learning. We also propose that grid cells compute the eigendecomposition of place fields in part because is useful for segmenting an enclosure along natural boundaries. When applied recursively, this segmentation can be used to discover a hierarchical decomposition of space. Thus, grid cells might be involved in computing subgoals for hierarchical reinforcement learning. 1 Introduction A cognitive map, as originally conceived by Tolman [46], is a geometric representation of the environment that can support sophisticated navigational behavior. Tolman was led to this hypothesis by the observation that rats can acquire knowledge about the spatial structure of a maze even in the absence of direct reinforcement (latent learning; [46]). Subsequent work has sought to formalize the representational content of the cognitive map [13], the algorithms that operate on it [33, 35], and its neural implementation [34, 27]. Much of this work was galvanized by the discovery of place cells in the hippocampus [34], which selectively respond when an animal is in a particular location, thus supporting the notion that the brain contains an explicit map of space. The later discovery of grid cells in the entorhinal cortex [16], which respond periodically over the entire environment, indicated a possible neural substrate for encoding metric information about space. Metric information is very useful if one considers the problem of spatial navigation to be computing the shortest path from a starting point to a goal. A mechanism that accumulates a record of displacements can easily compute the shortest path back to the origin, a technique known as path integration. Considerable empirical evidence supports the idea that animals use this technique for navigation [13]. Many authors have proposed theories of how grid cells and place cells can be used to carry out the necessary computations [27]. However, the navigational problems faced by humans and animals are inextricably tied to the more general problem of reward maximization, which cannot be reduced to the problem of finding the shortest path between two points. This raises the question: does the brain employ the same machinery for spatial navigation and reinforcement learning (RL)? A number of authors have suggested how RL mechanisms can support spatial learning, where spatial representations (e.g., place cells or 1 grid cells), serve as the input to the learning system [11, 15]. In contrast to the view that spatial representation is extrinsic to the RL system, we pursue the idea that the brain’s spatial representations are designed to support RL. In particular, we show how spatial representations resembling place cells and grid cells emerge as the solution to the problem of optimizing spatial representation in the service of RL. We first review the formal definition of the RL problem, along with several algorithmic solutions. Special attention is paid to the successor representation (SR) [6], which enables a computationally convenient decomposition of value functions. We then show how the successor representation naturally comes to represent place cells when applied to spatial domains. The eigendecomposition of the successor representation reveals properties of an environment’s spectral graph structure, which is particularly useful for discovering hierarchical decompositions of space. We demonstrate that the eigenvectors resemble grid cells, and suggest that one function of the entorhinal cortex may be to encode a compressed representation of space that aids hierarchical RL [3]. 2 The reinforcement learning problem Here we consider the problem of RL in a Markov decision process, which consists of the following elements: a set of states S, a set of actions A, a transition distribution P(s′|s, a) specifying the probability of transitioning to state s′ ∈S from state s ∈S after taking action a ∈A, a reward function R(s) specifying the expected reward in state s, and a discount factor γ ∈[0, 1]. An agent chooses actions according to a policy π(a|s) and collects rewards as it moves through the state space. The standard RL problem is to choose a policy that maximizes the value (expected discounted future return), V (s) = Eπ [P∞ t=0 γtR(st) | s0 = s]. Our focus here is on policy evaluation (computing V ). In our simulations we feed the agent the optimal policy; in the Supplementary Materials we discuss algorithms for policy improvement. To simplify notation, we assume implicit dependence on π and define the state transition matrix T, where T(s, s′) = P a π(a|s)P(s′|s, a). Most work on RL has focused on two classes of algorithms for policy evaluation: “model-free” algorithms that estimate V directly from sample paths, and “model-based” algorithms that estimate T and R from sample paths and then compute V by some form of dynamic programming or tree search [44, 5]. However, there exists a third class that has received less attention. As shown by Dayan [6], the value function can be decomposed into the inner product of the reward function with the SR, denoted by M: V (s) = P s′ M(s, s′)R(s′), M = (I −γT)−1 (1) where I denotes the identity matrix. The SR encodes the expected discounted future occupancy of state s′ along a trajectory initiated in state s: M(s, s′) = E [P∞ t=0 γtI{st = s′} | s0 = s] , (2) where I{·} = 1 if its argument is true, and 0 otherwise. The SR obeys a recursion analogous to the Bellman equation for value functions: M(s, j) = I{s = j} + γ P s′ T(s, s′)M(s′, j). (3) This recursion can be harnessed to derive a temporal difference learning algorithm for incrementally updating an estimate ˆ M of the SR [6, 14]. After observing a transition s →s′, the estimate is updated according to: ˆ M(s, j) ←ˆ M(s, j) + η h I{s = j} + γ ˆ M(s′, j) −ˆ M(s, j) i , (4) where η is a learning rate (unless specified otherwise, η = 0.1 in our simulations). The SR combines some of the advantages of model-free and model-based algorithms: like model-free algorithms, policy evaluation is computationally efficient, but at the same time the SR provides some of the same flexibility as model-based algorithms. As we illustrate later, an agent using the SR will be sensitive to distal changes in reward, whereas a model-free agent will be insensitive to these changes. 3 The successor representation and place cells In this section, we explore the neural implications of using the SR for policy evaluation: if the brain encoded the SR, what would the receptive fields of the encoding population look like, and what 2 ) + ( d r a w e R a b Empty Room Single Barrier c d d r a w e R o N e f Multiple Rooms 1.8 1.8 1.8 1.8 1.8 1.8 1.8 2.1 1.9 1.9 1.8 1.8 5.6 1.2 1.3 1.2 5.6 1.6 1.4 1.3 1.2 1.3 1.2 1.4 Figure 1: SR place fields. Top two rows show place fields without reward, bottom two show retrospective place fields with reward (marked by +). Maximum firing rate (a.u.) indicated for each plot. (a, b) Empty room. (c, d) Single barrier. (e, f) Multiple rooms. 100 150 200 250 300 350 400 0 1 2 3 4 0.2 0.4 0.6 0.8 1 Direction Selectivity Distance along Track ) R S( s n oit aisiv d e tc e p x e d e t n u o c si D Figure 2: Direction selectivity along a track. Direction selectivity arises in SR place fields when the probability p→ of transitioning in the preferred left-toright direction along a linear track is greater than the probability p←of transitioning in the non-preferred direction. The legend shows the ratio of p←to p→ for each simulation. would the population look like at any point in time? This question is most easily addressed in spatial domains, where states index spatial locations (see Supplementary Materials for simulation details). For an open field with uniformly distributed rewards we assume a random walk policy, and the resulting SR for a particular location is an approximately symmetric, gradually decaying halo around that location (Fig. 1a)—the canonical description of a hippocampal place cell. In order for the population to encode the expected visitations to each state in the domain from the current starting state (i.e. a row of M), each receptive field corresponds to a column of the SR matrix. This allows the current state’s value to be computed by taking the dot product of its population vector with the reward vector. The receptive field (i.e. column of M) will encode the discounted expected number of times that state was visited for each starting state, and will therefore skew in the direction of the states that likely preceded the current state. More interesting predictions can be made when we examine the effects of obstacles and direction preference that shape the transition structure. For instance, when barriers are inserted into the environment, the probability of transitioning across these obstacles will go to zero. SR place fields are therefore constrained by environmental geometry, and the receptive field will be discontinuous across barriers (Fig. 1c,e). Consistent with this idea, experiments have shown that place fields become distorted around barriers [32, 40]. When an animal has been trained to travel in a preferred direction along a linear track, we expect the response of place fields to become skewed opposite the direction of travel (Fig. 2), a result that has been observed experimentally [28, 29]. Another way to alter the transition policy is by introducing a goal, which induces a tendency to move in the direction that maximizes reward. Under these conditions, we expect firing fields centered near rewarded locations to expand to include the surrounding locations and to increase their firing rate, as has been observed experimentally [10, 21]. Meanwhile, we expect the majority of place fields 3 0 2 4 f 0 0.2 0.4 Percentage of Neurons Firing Distance around annular track Depth a b Figure 3: Reward clustering in annular maze. (a) Histogram of number of cells firing above baseline at each displacement around an annular track. (b) Heat map of number of firing cells at each location on unwrapped annular maze. Reward is centered on track. Baseline firing rate set to 10% maximum. a b c d Value Firing Fields no detour early detour late detour 1.25 1.60 2.36 1.15 1.15 1.08 1.49 1.49 1.49 Figure 4: Tolman detour task. The starting location is at the bottom of the maze where the three paths meet, and the reward is at the top. Barriers are shown as black horizontal lines. Three conditions are shown: No detour, early detour, and late detour. (a, b, c) SR place fields centered near and far from detours. Maximum firing rate (a.u.) indicated by each plot. (d) Value function. that encode non-rewarded states to skew slightly away from the reward. Under certain settings for what firing rate constitutes baseline (see Supplementary Materials), the spread of the rewarded locations’ fields compensates for the skew of surrounding fields away from the reward, and we observe “clustering” around rewarded locations (Fig. 3), as has been observed experimentally in the annular water maze task [18]. This parameterization sensitivity may explain why goal-related firing is not observed in all tasks [25, 24, 41]. As another illustration of the model’s response to barriers, we simulated place fields in a version of the Tolman detour task [46], as described in [1]. Rats are trained to move from the start to the rewarded location. At some point, an “early” or a “late” transparent barrier is placed in the maze so that the rat must take a detour. For the early barrier, a short detour is available, and for the later barrier, the only detour is a longer one. Place fields near the detour are more strongly affected than places far away from the detour (Fig. 4a,b,c), consistent with experimental findings [1]. Fig. 4d shows the value function in each of these detour conditions. 4 Behavioral predictions: distance estimation and latent learning In this section, we examine some of the behavioral consequences of using the SR for RL. We first show that the SR anticipates biases in distance estimation induced by semi-permeable boundaries. We then explore the ability of the SR to support latent learning in contextual fear conditioning. 4 0 0.5 1 0 25 50 75 Distance (% Increase) Permeability SR Distance 0 1 2 3 4 5 a b Figure 5: Distance estimates. (a) Increase in the perceived distance between two points on opposite sides of a semipermeable boundary (marked with + and ◦in 5b) as a function of barrier permeability. (b) Perceived distance between destination (market with +) and all other locations in the space (barrier permeability = 0.05). Lesion Value Control Preexposure Duration (steps) Conditioned Response x 10 5 Value a b c 0 2 4 6 8 10 12 14 16 18 0 1 2 3 Lesion Control −0.8 −0.6 −0.4 −0.2 0 −0.3 −0.2 −0.1 0 Figure 6: Context preexposure facilitation effect. (a) Simulated conditioned response (CR) to the context following one-trial contextual fear conditioning, shown as a function of preexposure duration. The CR was approximated as the negative value summed over the environment. The “Lesion” corresponds to agents with hippocampal damage, simulated by setting the SR learning rate to 0.01. The “Control” group has a learning rate of 0.1. (b) value for a single location after preexposure in a control agent. (c) same as (b) in a lesioned agent. Stevens and Coupe [43] reported that people overestimated the distance between two locations when they were separated by a boundary (e.g., a state or country line). This bias was hypothesized to arise from a hierarchical organization of space (see also [17]). We show (Fig. 5) how distance estimates (using the Euclidean distance between SR state representations, p (M(s′) −M(s))2, as a proxy for the perceived distance between s and s′) between points in different regions of the environment are altered when an enclosure is divided by a soft (semi-permeable) boundary. We see that as the permeability of the barrier decreases (making the boundary harder), the percent increase in perceived distance between locations increases without bound. This gives rise to a discontinuity in perceived travel time at the soft boundary. Interestingly, the hippocampus is directly involved in distance estimation [31], suggesting the hippocampal cognitive map as a neural substrate for distance biases (although a direct link has yet to be established). The context preexposure facilitation effect refers to the finding that placing an animal inside a conditioning chamber prior to shocking it facilitates the acquisition of contextual fear [9]. In essence, this is a form of latent learning [46]. The facilitation effect is thought to arise from the development of a conjunctive representation of the context in the hippocampus, though areas outside the hippocampus may also develop a conjunctive representation in the absence of the hippocampus, albeit less efficiently [48]. The SR provides a somewhat different interpretation: over the course of preexposure, the hippocampus develops a predictive representation of the context, such that subsequent learning is rapidly propagated across space. Fig. 6 shows a simulation of this process and how it accounts for the facilitation effect. We simulated hippocampal lesions by reducing the SR learning rate from 0.1 to 0.01, resulting in a more punctate SR following preexposure and a reduced facilitation effect. 5 Eigendecomposition of the successor representation: hierarchical decomposition and grid cells Reinforcement learning and navigation can often be made more efficient by decomposing the environment hierarchically. For example, the options framework [45] utilizes a set of subgoals to divide and conquer a complex learning environment. Recent experimental work suggests that the brain may exploit a similar strategy [3, 36, 8]. A key problem, however, is discovering useful subgoals; while progress has been made on this problem in machine learning, we still know very little about how the brain solves it (but see [37]). In this section, we show how the eigendecomposition of the SR can be used to discover subgoals. The resulting eigenvectors strikingly resemble grid cells observed in entorhinal cortex. 5 a b Multiple Rooms c Single Barrier Open Room Figure 7: Eigendecomposition of the SR. Each panel shows the same 20 eigenvectors randomly sampled from the top 100 (excluding the constant first eigenvector) for the environmental geometries shown in Fig. 1 (no reward). (a) Empty room. (b) Single barrier. (c) Multiple rooms. Eigendecomposition Figure 8: Eigendecomposition of the SR in a hairpin maze. Since the walls of the maze effectively elongate a dimension of travel (the track of the maze), the low frequency eigenvectors resemble one-dimensional sinusoids that have been folded to match the space. Meanwhile, the low frequency eigenvectors exhibit the compartmentalization shown by [7]. A number of authors have used graph partitioning techniques to discover subgoals [30, 39]. These approaches cluster states according to their community membership (a community is defined as a highly interconnected set of nodes with relatively few outgoing edges). Transition points between communities (bottleneck states) are then used as subgoals. One important graph partitioning technique, used by [39] to find subgoals, is the normalized cuts algorithm [38], which recursively thresholds the second smallest eigenvector (the Fiedler vector) of the normalized graph Laplacian to obtain a graph partition. Given an undirected graph with symmetric weight matrix W, the graph Laplacian is given by L = D −W. The normalized graph Laplacian is given by L = I −D−1/2WD−1/2, where D is a diagonal degree matrix with D(s, s) = P s′ W(s, s′). When states are projected onto the second eigenvector, they are pulled along orthogonal dimensions according to their community membership. Locations in distinct regions but close in Euclidean distance – for instance, nearby points on opposite sides of a boundary – will be represented as distant in the eigenspace. The normalized graph Laplacian is closely related to the SR [26]. Under a random walk policy, the transition matrix is given by T = D−1W. If φ is an eigenvector of the random walk’s graph Laplacian I−T, then D1/2φ is an eigenvector of the normalized graph Laplacian. The corresponding eigenvector for the discounted Laplacian, I −γT, is γφ. Since the matrix inverse preserves the eigenvectors, the normalized graph Laplacian has the same eigenvectors as the SR, M = (I−γT)−1, scaled by γD−1/2. These spectral eigenvectors can be approximated by slow feature analysis [42]. Applying hierarchical slow feature analysis to streams of simulated visual inputs produces feature representations that resemble hippocampal receptive fields [12]. A number of representative SR eigenvectors are shown in Fig. 7, for three different room topologies. The higher frequency eigenvectors display the latticing characteristic of grid cells [16]. The eigendecomposition is often discontinuous at barriers, and in many cases different rooms are represented by independent sinusoids. Fig. 8 shows the eigendecomposition for a hairpin maze. The eigenvectors resemble folded up one-dimensional sinusoids, and high frequency eigenvectors appear as repeating phase-locked “submaps” with firing selective to a subset of hallways, much like the grid cells observed by Derdikman and Moser [7]. In the multiple rooms environment, visual inspection reveals that the SR eigenvector with the second smallest eigenvalue (the Fiedler vector) divides the enclosure along the vertical barrier: the left half is almost entirely blue and the right half almost entirely red, with a smooth but steep transition at the doorway (Fig. 9a). As discussed above, this second eigenvector can therefore be used to segment the enclosure along the vertical boundary. Applying this segmentation recursively, as in the normalized cuts algorithm, produces a hierarchical decomposition of the environment (Figure 6 Segmentation Second Level First Level b c a Figure 9: Segmentation using normalized cuts. (a) The results of segmentation by thresholding the second eigenvector of the multiple rooms environment in Fig. 1. Dotted lines indicate the segment boundaries. (b, c) Eigenvector segmentation applied recursively to fully parse the enclosure into the four rooms. 9b,c). By identifying useful subgoals from the environmental topology, this decomposition can be exploited by hierarchical learning algorithms [3, 37]. One might reasonably question why the brain should represent high frequency eigenvectors (like grid cells) if only the low frequency eigenvectors are useful for hierarchical decomposition. Spectral features also serve as generally useful representations [26, 22], and high frequency components are important for representing detail in the value function. The progressive increase in grid cell spacing along the dorsal-ventral axis of the entorhinal cortex may function as a multi-scale representation that supports both fine and coarse detail [2]. 6 Discussion We have shown how many empirically observed properties of spatial representation in the brain, such as changes in place fields induced by manipulations of environmental geometry and reward, can be explained by a predictive representation of the environment. This predictive representation is intimately tied to the problem of RL: in a certain sense, it is the optimal representation of space for the purpose of computing value functions, since it reduces value computation to a simple matrix multiplication [6]. Moreover, this optimality principle is closely connected to ideas from manifold learning and spectral graph theory [26]. Our work thus sheds new computational light on Tolman’s cognitive map [46]. Our work is connected to several lines of previous work. Most relevant is Gustafson and Daw [15], who showed how topologically-sensitive spatial representations recapitulate many aspects of place cells and grid cells that are difficult to reconcile with a purely Euclidean representation of space. They also showed how encoding topological structure greatly aids reinforcement learning in complex spatial environments. Earlier work by Foster and colleagues [11] also used place cells as features for RL, although the spatial representation did not explicitly encode topological structure. While these theoretical precedents highlight the importance of spatial representation, they leave open the deeper question of why particular representations are better than others. We showed that the SR naturally encodes topological structure in a format that enables efficient RL. Spectral graph theory provides insight into the topological structure encoded by the SR. In particular, we showed that eigenvectors of the SR can be used to discover a hierarchical decomposition of the environment for use in hierarchical RL. These eigenvectors may also be useful as a representational basis for RL, encoding multi-scale spatial structure in the value function. Spectral analysis has frequently been invoked as a computational motivation for entorhinal grid cells (e.g., [23]). The fact that any function can be reconstructed by sums of sinusoids suggested that the entorhinal cortex implements a kind of Fourier transform of space, and that place cells are the result of reconstructing spatial signals from their spectral decomposition. Two problems face this interpretation. Fist, recent evidence suggests that the emergence of place cells does not depend on grid cell input [4, 47]. Second, and more importantly for our purposes, Fourier analysis is not the right mathematical tool when dealing with spatial representation in a topologically structured environment, since we do not expect functions to be smooth over boundaries in the environment. This is precisely the purpose of spectral graph theory: the eigenvectors of the graph Laplacian encode the smoothest approximation of a function that respects the graph topology [26]. Recent work has elucidated connections between models of episodic memory and the SR. Specifically, in [14] it was shown that the SR is closely related to the Temporal Context Model (TCM) of episodic memory [20]. The core idea of TCM is that items are bound to their temporal context (a running average of recently experienced items), and the currently active temporal context is used 7 to cue retrieval of other items, which in turn cause their temporal context to be retrieved. The SR can be seen as encoding a set of item-context associations. The connection to episodic memory is especially interesting given the crucial mnemonic role played by the hippocampus and entorhinal cortex in episodic memory. Howard and colleagues [19] have laid out a detailed mapping between TCM and the medial temporal lobe (including entorhinal and hippocampal regions). An important question for future work concerns how biologically plausible mechanisms can implement the computations posited in our paper. We described a simple error-driven updating rule for learning the SR, and in the Supplementary Materials we derive a stochastic gradient learning rule that also uses a simple error-driven update. Considerable attention has been devoted to the implementation of error-driven learning rules in the brain, so we expect that these learning rules can be implemented in a biologically plausible manner. References [1] A. Alvernhe, E. Save, and B. Poucet. Local remapping of place cell firing in the tolman detour task. European Journal of Neuroscience, 33:1696–1705, 2011. [2] H. T. Blair, A. C. Welday, and K. Zhang. Scale-invariant memory representations emerge from moire interference between grid fields that produce theta oscillations: a computational model. The Journal of Neuroscience, 27:3211–3229, 2007. [3] M. M. Botvinick, Y. Niv, and A. C. Barto. Hierarchically organized behavior and its neural foundations: A reinforcement learning perspective. Cognition, 113:262–280, 2009. [4] M. P. Brandon, J. Koenig, J. K. Leutgeb, and S. Leutgeb. New and distinct hippocampal place codes are generated in a new environment during septal inactivation. Neuron, 82:789–796, 2014. [5] N. D. Daw, Y. Niv, and P. Dayan. Uncertainty-based competition between prefrontal and dorsolateral striatal systems for behavioral control. Nature Neuroscience, 8:1704–1711, 2005. [6] P. Dayan. Improving generalization for temporal difference learning: The successor representation. Neural Computation, 5:613–624, 1993. [7] D. Derdikman, J. R. Whitlock, A. Tsao, M. Fyhn, T. Hafting, M.-B. Moser, and E. I. Moser. Fragmentation of grid cell maps in a multicompartment environment. Nature Neuroscience, 12:1325–1332, 2009. [8] C. Diuk, K. Tsai, J. Wallis, M. Botvinick, and Y. Niv. Hierarchical learning induces two simultaneous, but separable, prediction errors in human basal ganglia. The Journal of Neuroscience, 33:5797–5805, 2013. [9] M. S. Fanselow. From contextual fear to a dynamic view of memory systems. Trends in Cognitive Sciences, 14:7–15, 2010. [10] A. Fenton, L. Zinyuk, and J. Bures. Place cell discharge along search and goal-directed trajectories. European Journal of Neuroscience, 12:3450, 2001. [11] D. Foster, R. Morris, and P. Dayan. A model of hippocampally dependent navigation, using the temporal difference learning rule. Hippocampus, 10:1–16, 2000. [12] M. Franzius, H. Sprekeler, and L. Wiskott. Slowness and sparseness lead to place, head-direction, and spatial-view cells. PLoS Computational Biology, 3:3287–3302, 2007. [13] C. R. Gallistel. The Organization of Learning. The MIT Press, 1990. [14] S. J. Gershman, C. D. Moore, M. T. Todd, K. A. Norman, and P. B. Sederberg. The successor representation and temporal context. Neural Computation, 24:1553–1568, 2012. [15] N. J. Gustafson and N. D. Daw. Grid cells, place cells, and geodesic generalization for spatial reinforcement learning. PLoS Computational Biology, 7:e1002235, 2011. [16] T. Hafting, M. Fyhn, S. Molden, M.-B. Moser, and E. I. Moser. Microstructure of a spatial map in the entorhinal cortex. Nature, 436:801–806, 2005. [17] S. C. Hirtle and J. Jonides. Evidence of hierarchies in cognitive maps. Memory & Cognition, 13:208–217, 1985. [18] S. A. Hollup, S. Molden, J. G. Donnett, M. B. Moser, and E. I. Moser. Accumulation of hippocampal place fields at the goal location in an annular watermaze task. Journal of Neuroscience, 21:1635–1644, 2001. [19] M. W. Howard, M. S. Fotedar, A. V. Datey, and M. E. Hasselmo. The temporal context model in spatial navigation and relational learning: toward a common explanation of medial temporal lobe function across domains. Psychological Review, 112:75–116, 2005. [20] M. W. Howard and M. J. Kahana. A distributed representation of temporal context. Journal of Mathematical Psychology, 46:269–299, 2002. 8 [21] T. Kobayashi, A. Tran, H. Nishijo, T. Ono, and G. Matsumoto. Contribution of hippocampal place cell activity to learning and formation of goal-directed navigation in rats. Neuroscience, 117:1025–35, 2003. [22] G. Konidaris, S. Osentoski, and P. S. Thomas. Value function approximation in reinforcement learning using the Fourier basis. In AAAI, 2011. [23] J. Krupic, N. Burgess, and J. O’oeefe. Neural representations of location composed of spatially periodic bands. Science, 337:853–857, 2012. [24] P. Lenck-Santini, R. Muller, E. Save, and B. Poucet. Relationships between place cell firing fields and navigational decisions by rats. The Journal of Neuroscience, 22:9035–47, 2002. [25] P. Lenck-Santini, E. Save, and B. Poucet. Place-cell firing does not depend on the direction of turn in a y-maze alternation task. European Journal of Neuroscience, 13(5):1055–8, 2001. [26] S. Mahadevan. Learning representation and control in markov decision processes: New frontiers. Foundations and Trends in Machine Learning, 1:403–565, 2009. [27] B. L. McNaughton, F. P. Battaglia, O. Jensen, E. I. Moser, and M.-B. Moser. Path integration and the neural basis of the ‘cognitive map’. Nature Reviews Neuroscience, 7:663–678, 2006. [28] M. R. Mehta, C. A. Barnes, and B. L. McNaughton. Experience-dependent, asymmetric expansion of hippocampal place fields. Proceedings of the National Academy of Sciences, 94:8918–8921, 1997. [29] M. R. Mehta, M. C. Quirk, and M. A. Wilson. Experience-dependent asymmetric shape of hippocampal receptive fields. Neuron, 25:707–715, 2000. [30] I. Menache, S. Mannor, and N. Shimkin. Q-cut—dynamic discovery of sub-goals in reinforcement learning. In European Conference on Machine Learning, pages 295–306. Springer, 2002. [31] L. K. Morgan, S. P. MacEvoy, G. K. Aguirre, and R. A. Epstein. Distances between real-world locations are represented in the human hippocampus. The Journal of Neuroscience, 31:1238–1245, 2011. [32] R. U. Muller and J. L. Kubie. The effects of changes in the environment on the spatial firing of hippocampal complex-spike cells. The Journal of Neuroscience, 7:1951–1968, 1987. [33] R. U. Muller, M. Stead, and J. Pach. The hippocampus as a cognitive graph. The Journal of General Physiology, 107:663–694, 1996. [34] J. O’Keefe and L. Nadel. The Hippocampus as a Cognitive Map. Clarendon Press Oxford, 1978. [35] A. K. Reid and J. R. Staddon. A dynamic route finder for the cognitive map. Psychological Review, 105:585–601, 1998. [36] J. J. Ribas-Fernandes, A. Solway, C. Diuk, J. T. McGuire, A. G. Barto, Y. Niv, and M. M. Botvinick. A neural signature of hierarchical reinforcement learning. Neuron, 71:370–379, 2011. [37] A. C. Schapiro, T. T. Rogers, N. I. Cordova, N. B. Turk-Browne, and M. M. Botvinick. Neural representations of events arise from temporal community structure. Nature Neuroscience, 16:486492, 2013. [38] J. Shi and J. Malik. Normalized cuts and image segmentation. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 22:888–905, 2000. [39] ¨O. S¸ims¸ek, A. P. Wolfe, and A. G. Barto. Identifying useful subgoals in reinforcement learning by local graph partitioning. In Proceedings of the 22nd International Conference on Machine Learning, pages 816–823. ACM, 2005. [40] W. E. Skaggs and B. L. McNaughton. Spatial firing properties of hippocampal ca1 populations in an environment containing two visually identical regions. The Journal of Neuroscience, 18:8455–8466, 1998. [41] A. Speakman and J. O’Keefe. Hippocampal complex spike cells do not change their place fields if the goal is moved within a cue controlled environment. European Journal of Neuroscience, 2:544–5, 1990. [42] H. Sprekeler. On the relation of slow feature analysis and laplacian eigenmaps. Neural computation, 23:3287–3302, 2011. [43] A. Stevens and P. Coupe. Distortions in judged spatial relations. Cognitive Psychology, 10:422 – 437, 1978. [44] R. S. Sutton and A. G. Barto. Reinforcement Learning: An Introduction. MIT press, 1998. [45] R. S. Sutton, D. Precup, and S. Singh. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 112:181–211, 1999. [46] E. C. Tolman. Cognitive maps in rats and men. Psychological Review, 55:189–208, 1948. [47] T. J. Wills, F. Cacucci, N. Burgess, and J. O’Keefe. Development of the hippocampal cognitive map in preweanling rats. Science, 328:1573–1576, 2010. [48] B. J. Wiltgen, M. J. Sanders, S. G. Anagnostaras, J. R. Sage, and M. S. Fanselow. Context fear learning in the absence of the hippocampus. The Journal of Neuroscience, 26:5484–5491, 2006. 9
2014
361
5,471
Smoothed Gradients for Stochastic Variational Inference Stephan Mandt Department of Physics Princeton University smandt@princeton.edu David Blei Department of Computer Science Department of Statistics Columbia University david.blei@columbia.edu Abstract Stochastic variational inference (SVI) lets us scale up Bayesian computation to massive data. It uses stochastic optimization to fit a variational distribution, following easy-to-compute noisy natural gradients. As with most traditional stochastic optimization methods, SVI takes precautions to use unbiased stochastic gradients whose expectations are equal to the true gradients. In this paper, we explore the idea of following biased stochastic gradients in SVI. Our method replaces the natural gradient with a similarly constructed vector that uses a fixed-window moving average of some of its previous terms. We will demonstrate the many advantages of this technique. First, its computational cost is the same as for SVI and storage requirements only multiply by a constant factor. Second, it enjoys significant variance reduction over the unbiased estimates, smaller bias than averaged gradients, and leads to smaller mean-squared error against the full gradient. We test our method on latent Dirichlet allocation with three large corpora. 1 Introduction Stochastic variational inference (SVI) lets us scale up Bayesian computation to massive data [1]. SVI has been applied to many types of models, including topic models [1], probabilistic factorization [2], statistical network analysis [3, 4], and Gaussian processes [5]. SVI uses stochastic optimization [6] to fit a variational distribution, following easy-to-compute noisy natural gradients that come from repeatedly subsampling from the large data set. As with most traditional stochastic optimization methods, SVI takes precautions to use unbiased, noisy gradients whose expectations are equal to the true gradients. This is necessary for the conditions of [6] to apply, and guarantees that SVI climbs to a local optimum of the variational objective. Innovations on SVI, such as subsampling from data non-uniformly [2] or using control variates [7, 8], have maintained the unbiasedness of the noisy gradient. In this paper, we explore the idea of following a biased stochastic gradient in SVI. We are inspired by the recent work in stochastic optimization that uses biased gradients. For example, stochastic averaged gradients (SAG) iteratively updates only a subset of terms in the full gradient [9]; averaged gradients (AG) follows the average of the sequence of stochastic gradients [10]. These methods lead to faster convergence on many problems. However, SAG and AG are not immediately applicable to SVI. First, SAG requires storing all of the terms of the gradient. In most applications of SVI there is a term for each data point, and avoiding such storage is one of the motivations for using the algorithm. Second, the SVI update has a form where we update the variational parameter with a convex combination of the previous parameter and a new noisy version of it. This property falls out of the special structure of the gradient of the variational objective, and has the significant advantage of keeping the parameter in its feasible 1 space. (E.g., the parameter may be constrained to be positive or even on the simplex.) Averaged gradients, as we show below, do not enjoy this property. Thus, we develop a new method to form biased gradients in SVI. To understand our method, we must briefly explain the special structure of the SVI stochastic natural gradient. At any iteration of SVI, we have a current estimate of the variational parameter λi, i.e., the parameter governing an approximate posterior that we are trying to estimate. First, we sample a data point wi. Then, we use the current estimate of variational parameters to compute expected sufficient statistics ˆSi about that data point. (The sufficient statistics ˆSi is a vector of the same dimension as λi.) Finally, we form the stochastic natural gradient of the variational objective L with this simple expression: ∇λL = η + N ˆSi −λi, (1) where η is a prior from the model and N is an appropriate scaling. This is an unbiased noisy gradient [11, 1], and we follow it with a step size ρi that decreases across iterations [6]. Because of its algebraic structure, each step amounts to taking a weighted average, λi+1 = (1 −ρi)λi + ρi(η + N ˆSi). (2) Note that this keeps λi in its feasible set. With these details in mind, we can now describe our method. Our method replaces the natural gradient in Eq. (1) with a similarly constructed vector that uses a fixed-window moving average of the previous sufficient statistics. That is, we replace the sufficient statistics with an appropriate scaled sum, PL−1 j=0 ˆSi−j. Note this is different from averaging the gradients, which also involves the current iteration’s estimate. We will demonstrate the many advantages of this technique. First, its computational cost is the same as for SVI and storage requirements only multiply by a constant factor (the window length L). Second, it enjoys significant variance reduction over the unbiased estimates, smaller bias than averaged gradients, and leads to smaller mean-squared error against the full gradient. Finally, we tested our method on latent Dirichlet allocation with three large corpora. We found it leads to faster convergence and better local optima. Related work We first discuss the related work from the SVI literature. Both Ref. [8] and Ref. [7] introduce control variates to reduce the gradient’s variance. The method leads to unbiased gradient estimates. On the other hand, every few hundred iterations, an entire pass through the data set is necessary, which makes the performance and expenses of the method depend on the size of the data set. Ref. [12] develops a method to pre-select documents according to their influence on the global update. For large data sets, however, it also suffers from high storage requirements. In the stochastic optimization literature, we have already discussed SAG [9] and AG [10]. Similarly, Ref. [13] introduces an exponentially fading momentum term. It too suffers from the issues of SAG and AG, mentioned above. 2 Smoothed stochastic gradients for SVI Latent Dirichlet Allocation and Variational Inference We start by reviewing stochastic variational inference for LDA [1, 14], a topic model that will be our running example. We are given a corpus of D documents with words w1:D,1:N. We want to infer K hidden topics, defined as multinomial distributions over a vocabulary of size V . We define a multinomial parameter β1:V,1:K, termed the topics. Each document d is associated with a normalized vector of topic weights Θd. Furthermore, each word n in document d has a topic assignment zdn. This is a K−vector of binary entries, such that zk dn = 1 if word n in document d is assigned to topic k, and zk dn = 0 otherwise. In the generative process, we first draw the topics from a Dirichlet, βk ∼Dirichlet(η). For each document, we draw the topic weights, Θd ∼Dirichlet(α). Finally, for each word in the document, we draw an assignment zdn ∼Multinomial(Θd), and we draw the word from the assigned topic, wdn ∼Multinomial(βzdn). The model has the following joint probability distribution: p(w, β, Θ, z|η, α) = K Y k=1 p(βk|η) D Y d=1 p(Θd|α) N Y n=1 p(zdn|Θd)p(wdn|β1:K, zdn) (3) 2 Following [1], the topics β are global parameters, shared among all documents. The assignments z and topic proportions Θ are local, as they characterize a single document. In variational inference [15], we approximate the posterior distribution, p(β, Θ, z|w) = p(β, Θ, z, w) P z R dβdΘ p(β, Θ, z, w), (4) which is intractable to compute. The posterior is approximated by a factorized distribution, q(β, Θ, z) = q(β|λ) D Y d=1 N Y n=1 q(zdn|φdn) ! D Y d=1 q(Θd|γd) ! (5) Here, q(β|λ) and q(Θd|γd) are Dirichlet distributions, and q(zdn|φdn) are multinomials. The parameters λ, γ and φ minimize the Kullback-Leibler (KL) divergence between the variational distribution and the posterior [16]. As shown in Refs. [1, 17], the objective to maximize is the evidence lower bound (ELBO), L(q) = Eq[log p(x, β, Θ, z)] −Eq[log q(β, Θ, z)]. (6) This is a lower bound on the marginal probability of the observations. It is a sensible objective function because, up to a constant, it is equal to the negative KL divergence between q and the posterior. Thus optimizing the ELBO with respect to q is equivalent to minimizing its KL divergence to the posterior. In traditional variational methods, we iteratively update the local and global parameters. The local parameters are updated as described in [1, 17] . They are a function of the global parameters, so at iteration i the local parameter is φdn(λi). We are interested in the global parameters. They are updated based on the (expected) sufficient statistics S(λi), S(λi) = X d∈{1,...,D} N X n=1 φdn(λi) · WT dn (7) λi+1 = η + S(λi) For fixed d and n, the multinomial parameter φdn is K×1. The binary vector Wdn is V×1; it satisfies Wv dn = 1 if the word n in document d is v, and else contains only zeros. Hence, S is K×V and therefore has the same dimension as λ. Alternating updates lead to convergence. Stochastic variational inference for LDA The computation of the sufficient statistics is inefficient because it involves a pass through the entire data set. In Stochastic Variational Inference for LDA [1, 14], it is approximated by stochastically sampling a ”minibatch” Bi ⊂{1, ..., D} of |Bi| documents, estimating S on the basis of the minibatch, and scaling the result appropriately, ˆS(λi, Bi) = D |Bi| X d∈Bi N X n=1 φdn(λi) · WT dn. Because it depends on the minibatch, ˆSi = ˆS(λi, Bi) is now a random variable. We will denote variables that explicitly depend on the random minibatch Bi at the current time i by circumflexes, such as ˆg and ˆS. In SVI, we update λ by admixing the random estimate of the sufficient statistics to the current value of λ. This involves a learning rate ρi < 1, λi+1 = (1 −ρi)λi + ρi(η + ˆS(λi, Bi)) (8) The case of ρ = 1 and |Bi| = D corresponds to batch variational inference (when sampling without replacement) . For arbitrary ρ, this update is just stochastic gradient ascent, as a stochastic estimate of the natural gradient of the ELBO [1] is ˆg(λi, Bi) = (η −λi) + ˆS(λi, Bi), (9) This interpretation opens the world of gradient smoothing techniques. Note that the above stochastic gradient is unbiased: its expectation value is the full gradient. However, it has a variance. The goal of this paper will be to reduce this variance at the expense of introducing a bias. 3 Algorithm 1: Smoothed stochastic gradients for Latent Dirichlet Allocation Input: D documents, minibatch size B, number of stored sufficient statistics L, learning rate ρt, hyperparameters α, η. Output: Hidden variational parameters λ, φ, γ. 1 Initialize λ randomly and ˆgL i = 0. 2 Initialize empty queue Q = {}. 3 for i = 0 to ∞do 4 Sample minibatch Bi ⊂{1, . . . , D} uniformly. 5 initialize γ 6 repeat 7 For d ∈Bi and n ∈{1, . . . , N} set 8 φk dn ∝exp(E[log Θdk] + E[log βk,wd]), k ∈{1, . . . , K} 9 γd = α + P n φdn 10 until φdn and γd converge. 11 For each topic k, calculate sufficient statistics for minibatch Bi: 12 ˆSi = D |Bi| P d∈Bi PN n=1 φdnWT dn 13 Add new sufficient statistic in front of queue Q: 14 Q ←{ ˆSi} + Q 15 Remove last element when length L has been reached: 16 if length(Q) > L then 17 Q ←Q −{ ˆSi−L} 18 end 19 Update λ, using stored sufficient statistics: 20 ˆSL i ←ˆSL i−1 + ( ˆSi −ˆSi−L)/L 21 ˆgL i ←(η −λi) + ˆSL i 22 λt+1 = λt + ρt ˆgL t . 23 end Smoothed stochastic gradients for SVI Noisy stochastic gradients can slow down the convergence of SVI or lead to convergence to bad local optima. Hence, we propose a smoothing scheme to reduce the variance of the noisy natural gradient. To this end, we average the sufficient statistics over the past L iterations. Here is a sketch: 1. Uniformly sample a minibatch Bi ⊂{1, . . . , D} of documents. Compute the local variational parameters φ from a given λi. 2. Compute the sufficient statistics ˆSi = ˆS(φ(λi), Bi). 3. Store ˆSi, along with the L most recent sufficient statistics. Compute ˆSL i = 1 L PL−1 j=0 ˆSi−j as their mean. 4. Compute the smoothed stochastic gradient according to ˆgL i = (η −λi) + ˆSL i (10) 5. Use the smoothed stochastic gradient to calculate λi+1. Repeat. Details are in Algorithm 1. We now explore its properties. First, note that smoothing the sufficient statistics comes at almost no extra computational costs. In fact, the mean of the stored sufficient statistics does not explicitly have to be computed, but rather amounts to the update ˆSL i ←ˆSL i−1 + ( ˆSi −ˆSi−L)/L, (11) after which ˆSi−L is deleted. Storing the sufficient statistics can be expensive for large values of L: In the context of LDA involving the typical parameters K = 102 and V = 104, using L = 102 amounts to storing 108 64-bit floats which is in the Gigabyte range. Note that when L = 1 we obtain stochastic variational inference (SVI) in its basic form. This includes deterministic variational inference for L = 1, B = D in the case of sampling without replacement within the minibatch. Biased gradients Let us now investigate the algorithm theoretically. Note that the only noisy part in the stochastic gradient in Eq. (9) is the sufficient statistics. Averaging over L stochastic sufficient statistics thus promises to reduce the noise in the gradient. We are interested in the effect of the additional parameter L. 4 When we average over the L most recent sufficient statistics, we introduce a bias. As the variational parameters change during each iteration, the averaged sufficient statistics deviate in expectation from its current value. This induces biased gradients. In a nutshell, large values of L will reduce the variance but increase the bias. To better understand this tradeoff, we need to introduce some notation. We defined the stochastic gradient ˆgi = ˆg(λi, Bi) in Eq. (9) and refer to gi = EBi[ˆg(λi, Bi)] as the full gradient (FG). We also defined the smoothed stochastic gradient ˆgi L in Eq. (10). Now, we need to introduce an auxiliary variable, gL i := (η −λi) + 1 L PL−1 j=0 Si−j. This is the time-averaged full gradient. It involves the full sufficient statistics Si = S(λi) evaluated along the sequence λ1, λ2,... generated by our algorithm. We can expand the smoothed stochastic gradient into three terms: ˆgL i = gi |{z} FG + (gL i −gi) | {z } bias + (ˆgL i −gL i ) | {z } noise (12) This involves the full gradient (FG), a bias term and a stochastic noise term. We want to minimize the statistical error between the full gradient and the smoothed gradient by an optimal choice of L. We will show this the optimal choice is determined by a tradeoff between variance and bias. For the following analysis, we need to compute expectation values with respect to realizations of our algorithm, which is a stochastic process that generates a sequence of λi’s. Those expectation values are denoted by E[·]. Notably, not only the minibatches Bi are random variables under this expectation, but also the entire sequences λ1, λ2, ... . Therefore, one needs to keep in mind that even the full gradients gi = g(λi) are random variables and can be studied under this expectation. We find that the mean squared error of the smoothed stochastic gradient dominantly decomposes into a mean squared bias and a noise term: E[(ˆgL i −gi)2] ≈ E[(ˆgL i −gL i )2] | {z } variance + E[(gL i −gi)2] | {z } mean squared bias (13) To see this, consider the mean squared error of the smoothed stochastic gradient with respect to the full gradient, E[(ˆgL i −gi)2], adding and subtracting gL i : E  (ˆgL i −gL i + gL i −gi)2 = E  (ˆgL i −gL i )2 + 2 E  (ˆgL i −gL i )(gL i −gi)  + E  (gL i −gi)2 . We encounter a cross-term, which we argue to be negligible. In defining ∆ˆSi = ( ˆSi −Si) we find that (ˆgL i −gL i ) = 1 L PL−1 j=0 ∆Si−j. Therefore, E  (ˆgL i −gL i )(gL i −gi)  = 1 L L−1 X j=0 E h ∆ˆSi−j(gL i −gi) i . The fluctuations of the sufficient statistics ∆ˆSi is a random variable with mean zero, and the randomness of (gL i −gi) enters only via λi. One can assume a very small statistical correlation between those two terms, E h ∆ˆSi−j(gL i −gi) i ≈E h ∆ˆSi−j i E  (gL i −gi)  = 0. Therefore, the cross-term can be expected to be negligible. We confirmed this fact empirically in our numerical experiments: the top row of Fig. 1 shows that the sum of squared bias and variance is barely distinguishable from the squared error. By construction, all bias comes from the sufficient statistics: E[(gL i −gi)2] = E  1 L PL−1 j=0 (Si−j −Si) 2 . (14) At this point, little can be said in general about the bias term, apart from the fact that it should shrink with the learning rate. We will explore it empirically in the next section. We now consider the variance term: E[(ˆgL i −gL i )2] = E  1 L PL−1 j=0 ∆ˆSi−j 2 = 1 L2 L−1 X j=0 E h (∆ˆSi−j)2i = 1 L2 L−1 X j=0 E[(ˆgi−j −gi−j)2]. 5 Figure 1: Empirical test of the variance-bias tradeoff on 2,000 abstracts from the Arxiv repository (ρ = 0.01, B = 300). Top row. For fixed L = 30 (left), L = 100 (middle), and L = 300 (right), we compare the squared bias, variance, variance+bias and the squared error as a function of iterations. Depending on L, the variance or the bias give the dominant contribution to the error. Bottom row. Squared bias (left), variance (middle) and squared error (right) for different values of L. Intermediate values of L lead to the smallest squared error and hence to the best tradeoff between small variance and small bias. This can be reformulated as var(ˆgL i ) = 1 L2 PL−1 j=0 var(ˆgi−j). Assuming that the variance changes little during those L successive updates, we can approximate var(ˆgi−j) ≈var(ˆgi), which yields var(ˆgL i ) ≈ 1 Lvar(ˆgi). (15) The smoothed gradient has therefore a variance that is approximately L times smaller than the variance of the original stochastic gradient. Bias-variance tradeoff To understand and illustrate the effect of L in our optimization problem, we used a small data set of 2000 abstracts from the Arxiv repository. This allowed us to compute the full sufficient statistics and the full gradient for reference. More details on the data set and the corresponding parameters will be given below. We computed squared bias (SB), variance (VAR) and squared error (SE) according to Eq. (13) for a single stochastic optimization run. More explicitly, SBi = K X k=1 V X v=1 gL i −gi 2 kv , VARi = K X k=1 V X v=1 ˆgL i −gL i 2 kv , SEi = K X k=1 V X v=1 ˆgL i −gi 2 kv . (16) In Fig. 1, we plot those quantities as a function of iteration steps (time). As argued before, we arrive at a drastic variance reduction (bottom, middle) when choosing large values of L. In contrast, the squared bias (bottom, left) typically increases with L. The bias shows a complex time-evolution as it maintains memory of L previous steps. For example, the kinks in the bias curves (bottom, left) occur at times 3, 10, 30, 100 and 300, i.e. they correspond to the values of L. Those are the times from which on the smoothed gradient looses memory of its initial state, typically carrying a large bias. The variances become approximately stationary at iteration L (bottom, middle). Those are the times where the initialization process ends and the queue Q in Algorithm 1 has reached its maximal length L. The squared error (bottom, right) is to a good approximation just the sum of squared bias and variance. This is also shown in the top panel of Fig. 1. 6 Due to the long-time memory of the smoothed gradients, one can associate some ”inertia” or ”momentum” to each value of L. The larger L, the smaller the variance and the larger the inertia. In a non-convex optimization setup with many local optima as in our case, too much inertia can be harmful. This effect can be seen for the L = 100 and L = 300 runs in Fig. 1 (bottom), where the mean squared bias and error curves bend upwards at long times. Think of a marble rolling in a wavy landscape: with too much momentum it runs the danger of passing through a good optimum and eventually getting trapped in a bad local optimum. This picture suggests that the optimal value of L depends on the ”ruggedness” of the potential landscape of the optimization problem at hand. Our empirical study suggest that choosing L between 10 and 100 produces the smallest mean squared error. Aside: connection to gradient averaging Our algorithm was inspired by various gradient averaging schemes. However, we cannot easily used averaged gradients in SVI. To see the drawbacks of gradient averaging, let us consider L stochastic gradients ˆgi, ˆgi−1, ˆgi−2, ..., ˆgi−L+1 and replace ˆgi −→ 1 L PL−1 j=0 ˆgi−j. (17) One arrives at the following parameter update for λi: λi+1 = (1 −ρi)λi + ρi  η + 1 L L−1 X j=0 ˆSi−j −1 L L−1 X j=0 (λi−j −λi)  . (18) This update can lead to the violation of optimization constraints, namely to a negative variational parameter λ. Note that for L = 1 (the case of SVI), the third term is zero, guaranteeing positivity of the update. This is no longer guaranteed for L > 1, and the gradient updates will eventually become negative. We found this in practice. Furthermore, we find that there is an extra contribution to the bias compared to Eq. (14), E[(gL i −gi)2] = E  1 L PL−1 j=0 (λi −λi−j) + 1 L PL−1 j=0 (Si−j −Si) 2 . (19) Hence, the averaged gradient carries an additional bias in λ - it is the same term that may violate optimization constraints. In contrast, the variance of the averaged gradient is the same as the variance of the smoothed gradient. Compared to gradient averaging, the smoothed gradient has a smaller bias while profiting from the same variance reduction. 3 Empirical study We tested SVI for LDA, using the smoothed stochastic gradients, on three large corpora: • 882K scientific abstracts from the Arxiv repository, using a vocabulary of 14K words. • 1.7M articles from the New York Times, using a vocabulary of 8K words. • 3.6M articles from Wikipedia, using a vocabulary of 7.7K words. We set the minibatch size to B = 300 and furthermore set the number of topics to K = 100, and the hyper-parameters α = η = 0.5. We fixed the learning rate to ρ = 10−3. We also compared our results to a decreasing learning rate and found the same behavior. For a quantitative test of model fitness, we evaluate the predictive probability over the vocabulary [1]. To this end, we separate a test set from the training set. This test set is furthermore split into two parts: half of it is used to obtain the local variational parameters (i.e. the topic proportions by fitting LDA with the fixed global parameters λ. The second part is used to compute the likelihoods of the contained words: p(wnew|wold, D) ≈ Z PK k=1 Θkβk,wnew  q(Θ)q(β)dΘdβ = Eq[θk]Eq[βk,wnew]. (20) We show the predictive probabilities as a function of effective passes through the data set in Fig. 2 for the New York Times, Arxiv, and Wikipedia corpus, respectively. Effective passes through the data set are defined as (minibatch size * iterations / size of corpus). Within each plot, we compare 7 Figure 2: Per-word predictive probabilitiy as a function of the effective number of passes through the data (minibatch size * iterations / size of corpus). We compare results for the New York Times, Arxiv, and Wikipedia data sets. Each plot shows data for different values of L. We used a constant learning rate of 10−3, and set a time budget of 24 hours. Highest likelihoods are obtained for L between 10 and 100, after which strong bias effects set in. different numbers of stored sufficient statistics, L ∈{1, 10, 100, 1000, 10000, ∞}. The last value of L = ∞corresponds to a version of the algorithm where we average over all previous sufficient statistics, which is related to averaged gradients (AG), but which has a bias too large to compete with small and finite values of L. The maximal values of 30, 5 and 6 effective passes through the Arxiv, New York Times and Wikipedia data sets, respectively, approximately correspond to a run time of 24 hours, which we set as a hard cutoff in our study. We obtain the highest held-out likelihoods for intermediate values of L. E.g., averaging only over 10 subsequent sufficient statistics results in much faster convergence and higher likelihoods at very little extra storage costs. As we discussed above, we attribute this fact to the best tradeoff between variance and bias. 4 Discussion and Conclusions SVI scales up Bayesian inference, but suffers from noisy stochastic gradients. To reduce the mean squared error relative to the full gradient, we averaged the sufficient statistics of SVI successively over L iteration steps. The resulting smoothed gradient is biased, however, and the performance of the method is governed by the competition between bias and variance. We argued theoretically and showed empirically that intermediate values of the number of stored sufficient statistics L give the highest held-out likelihoods. Proving convergence for our algorithm is still an open problem, which is non-trivial especially because the variational objective is non-convex. To guarantee convergence, however, we can simply phase out our algorithm and reduce the number of stored gradients to one as we get close to convergence. At this point, we recover SVI. Acknowledgements We thank Laurent Charlin, Alp Kucukelbir, Prem Gopolan, Rajesh Ranganath, Linpeng Tang, Neil Houlsby, Marius Kloft, and Matthew Hoffman for discussions. We acknowledge financial support by NSF CAREER NSF IIS-0745520, NSF BIGDATA NSF IIS1247664, NSF NEURO NSF IIS-1009542, ONR N00014-11-1-0651, the Alfred P. Sloan foundation, DARPA FA8750-14-2-0009 and the NSF MRSEC program through the Princeton Center for Complex Materials Fellowship (DMR-0819860). 8 References [1] Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic variational inference. The Journal of Machine Learning Research, 14(1):1303–1347, 2013. [2] Prem Gopalan, Jake M Hofman, and David M Blei. Scalable recommendation with Poisson factorization. Preprint, arXiv:1311.1704, 2013. [3] Prem K Gopalan and David M Blei. Efficient discovery of overlapping communities in massive networks. Proceedings of the National Academy of Sciences, 110(36):14534–14539, 2013. [4] Edoardo M Airoldi, David M Blei, Stephen E Fienberg, and Eric P Xing. Mixed membership stochastic blockmodels. In Advances in Neural Information Processing Systems, pages 33–40, 2009. [5] James Hensman, Nicolo Fusi, and Neil D Lawrence. Gaussian processes for big data. Uncertainty in Artificial Intelligence, 2013. [6] Herbert Robbins and Sutton Monro. A stochastic approximation method. The Annals of Mathematical Statistics, pages 400–407, 1951. [7] Chong Wang, Xi Chen, Alex Smola, and Eric Xing. Variance reduction for stochastic gradient optimization. In Advances in Neural Information Processing Systems, pages 181–189, 2013. [8] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in Neural Information Processing Systems, pages 315–323, 2013. [9] Mark Schmidt, Nicolas Le Roux, and Francis Bach. Minimizing finite sums with the stochastic average gradient. Technical report, HAL 00860051, 2013. [10] Yurii Nesterov. Primal-dual subgradient methods for convex problems. Mathematical Programming, 120(1):221–259, 2009. [11] Masa-Aki Sato. Online model selection based on the variational Bayes. Neural Computation, 13(7):1649–1681, 2001. [12] Mirwaes Wahabzada and Kristian Kersting. Larger residuals, less work: Active document scheduling for latent Dirichlet allocation. In Machine Learning and Knowledge Discovery in Databases, pages 475–490. Springer, 2011. [13] Paul Tseng. An incremental gradient (-projection) method with momentum term and adaptive stepsize rule. SIAM Journal on Optimization, 8(2):506–531, 1998. [14] Matthew Hoffman, Francis R Bach, and David M Blei. Online learning for latent Dirichlet allocation. In Advances in Neural Information Processing Systems, pages 856–864, 2010. [15] Martin J Wainwright and Michael I Jordan. Graphical models, exponential families, and variational inference. Foundations and Trends in Machine Learning, 1(1-2):1–305, 2008. [16] Christopher M Bishop et al. Pattern Recognition and Machine Learning, volume 1. Springer New York, 2006. [17] David M Blei, Andrew Y Ng, and Michael I Jordan. Latent Dirichlet allocation. The Journal of Machine Learning Research, 3:993–1022, 2003. 9
2014
362
5,472
A Multiplicative Model for Learning Distributed Text-Based Attribute Representations Ryan Kiros, Richard S. Zemel, Ruslan Salakhutdinov University of Toronto Canadian Institute for Advanced Research {rkiros, zemel, rsalakhu}@cs.toronto.edu Abstract In this paper we propose a general framework for learning distributed representations of attributes: characteristics of text whose representations can be jointly learned with word embeddings. Attributes can correspond to a wide variety of concepts, such as document indicators (to learn sentence vectors), language indicators (to learn distributed language representations), meta-data and side information (such as the age, gender and industry of a blogger) or representations of authors. We describe a third-order model where word context and attribute vectors interact multiplicatively to predict the next word in a sequence. This leads to the notion of conditional word similarity: how meanings of words change when conditioned on different attributes. We perform several experimental tasks including sentiment classification, cross-lingual document classification, and blog authorship attribution. We also qualitatively evaluate conditional word neighbours and attribute-conditioned text generation. 1 Introduction Distributed word representations have enjoyed success in several NLP tasks [1, 2]. More recently, the use of distributed representations have been extended to model concepts beyond the word level, such as sentences, phrases and paragraphs [3, 4, 5, 6], entities and relationships [7, 8] and embeddings of semantic categories [9, 10]. In this paper we propose a general framework for learning distributed representations of attributes: characteristics of text whose representations can be jointly learned with word embeddings. The use of the word attribute in this context is general. Table 1 illustrates several of the experiments we perform along with the corresponding notion of attribute. For example, an attribute can represent an indicator of the current sentence or language being processed. This allows us to learn sentence and language vectors, similar to the proposed model of [6]. Attributes can also correspond to side information, or metadata associated with text. For instance, a collection of blogs may come with information about the age, gender or industry of the author. This allows us to learn vectors that can capture similarities across metadata based on the associated body of text. The goal of this work is to show that our notion of attribute vectors can achieve strong performance on a wide variety of NLP related tasks. In particular, we demonstrate strong quantitative performance on three highly diverse tasks: sentiment classification, cross-lingual document classification, and blog authorship attribution. To capture these kinds of interactions between attributes and text, we propose to use a third-order model where attribute vectors act as gating units to a word embedding tensor. That is, words are represented as a tensor consisting of several prototype vectors. Given an attribute vector, a word embedding matrix can be computed as a linear combination of word prototypes weighted by the attribute representation. During training, attribute vectors reside in a separate lookup table which can be jointly learned along with word features and the model parameters. This type of three-way 1 Table 1: Summary of tasks and attribute types used in our experiments. The first three are quantitative while the second three are qualitative. Task Dataset Attribute type Sentiment Classification Sentiment Treebank Sentence Vector Cross-Lingual Classification RCV1/RCV2 Language Vector Authorship Attribution Blog Corpus Author Metadata Conditional Text Generation Gutenberg Corpus Book Vector Structured Text Generation Gutenberg Corpus Part of Speech Tags Conditional Word Similarity Blogs & Europarl Author Metadata / Language interaction can be embedded into a neural language model, where the three-way interaction consists of the previous context, the attribute and the score (or distribution) of the next word after the context. Using a word embedding tensor gives rise to the notion of conditional word similarity. More specifically, the neighbours of word embeddings can change depending on which attribute is being conditioned on. For example, the word ‘joy’ when conditioned on an author with the industry attribute ‘religion’ appears near ‘rapture’ and ‘god’ but near ‘delight’ and ‘comfort’ when conditioned on an author with the industry attribute ‘science’. Another way of thinking of our model would be the language analogue of [11]. They used a factored conditional restricted Boltzmann machine for modelling motion style defined by real or continuous valued style variables. When our factorization is embedded into a neural language model, it allows us to generate text conditioned on different attributes in the same manner as [11] could generate motions from different styles. As we show in our experiments, if attributes are represented by different books, samples generated from the model learn to capture associated writing styles from the author. Furthermore, we demonstrate a strong performance gain for authorship attribution when conditional word representations are used. Multiplicative interactions have also been previously incorporated into neural language models. [12] introduced a multiplicative model where images are used for gating word representations. Our framework can be seen as a generalization of [12] and in the context of their work an attribute would correspond to a fixed representation of an image. [13] introduced a multiplicative recurrent neural network for generating text at the character level. In their model, the character at the current timestep is used to gate the network’s recurrent matrix. This led to a substantial improvement in the ability to generate text at the character level as opposed to a non-multiplicative recurrent network. 2 Methods In this section we describe the proposed models. We first review the log-bilinear neural language model of [14] as it forms the basis for much of our work. Next, we describe a word embedding tensor and show how it can be factored and introduced into a multiplicative neural language model. This is concluded by detailing how our attribute vectors are learned. 2.1 Log-bilinear neural language models The log-bilinear language model (LBL) [14] is a deterministic model that may be viewed as a feedforward neural network with a single linear hidden layer. Each word w in the vocabulary is represented as a K-dimensional real-valued vector rw ∈RK. Let R denote the V × K matrix of word representation vectors where V is the vocabulary size. Let (w1, . . . wn−1) be a tuple of n −1 words where n −1 is the context size. The LBL model makes a linear prediction of the next word representation as ˆr = n−1 X i=1 C(i)rwi, (1) where C(i), i = 1, . . . , n −1 are K × K context parameter matrices. Thus, ˆr is the predicted representation of rwn. The conditional probability P(wn = i|w1:n−1) of wn given w1, . . . , wn−1 is P(wn = i|w1:n−1) = exp(ˆrT ri + bi) PV j=1 exp(ˆrT rj + bj) , (2) where b ∈RV is a bias vector. Learning can be done using backpropagation. 2 (a) NLM (b) Multiplicative NLM (c) Multiplicative NLM with language switch Figure 1: Three different formulations for predicting the next word in a neural language model. Left: A standard neural language model (NLM). Middle: The context and attribute vectors interact via a multiplicative interaction. Right: When words are unshared across attributes, a one-hot attribute vector gates the factors-to-vocabulary matrix. 2.2 A word embedding tensor Traditionally, word representation matrices are represented as a matrix R ∈RV ×K, such as in the case of the log-bilinear model. Throughout this work, we instead represent words as a tensor T ∈RV ×K×D where D corresponds to the number of tensor slices. Given an attribute vector x ∈RD, we can compute attribute-gated word representations as T x = PD i=1 xiT (i) i.e. word representations with respect to x are computed as a linear combination of slices weighted by each component xi of x. It is often unnecessary to use a fully unfactored tensor. Following [15, 16], we re-represent T in terms of three matrices Wfk ∈RF ×K, Wfd ∈RF ×D and Wfv ∈RF ×V , such that T x = (Wfv)⊤· diag(Wfdx) · Wfk, (3) where diag(·) denotes the matrix with its argument on the diagonal. These matrices are parametrized by a pre-chosen number of factors F. 2.3 Multiplicative neural language models We now show how to embed our word representation tensor T into the log-bilinear neural language model. Let E = (Wfk)⊤Wfv denote a ‘folded’ K × V matrix of word embeddings. Given the context w1, . . . , wn−1, the predicted next word representation ˆr is given by ˆr = n−1 X i=1 C(i)E(:, wi), (4) where E(:, wi) denotes the column of E for the word representation of wi and C(i), i = 1, . . . , n−1 are K × K context matrices. Given a predicted next word representation ˆr, the factor outputs are f = (Wfkˆr) • (Wfdx), (5) where • is a component-wise product. The conditional probability P(wn = i|w1:n−1, x) of wn given w1, . . . , wn−1 and x can be written as P(wn = i|w1:n−1, x) = exp (Wfv(:, i))⊤f + bi  PV j=1 exp (Wfv(:, j))⊤f + bj . Here, Wfv(:, i) denotes the column of Wfv corresponding to word i. In contrast to the log-bilinear model, the matrix of word representations R from before is replaced with the factored tensor T , as shown in Fig. 1. 2.4 Unshared vocabularies across attributes Our formulation for T assumes that word representations are shared across all attributes. In some cases, words may only be specific to certain attributes and not others. An example of this is crosslingual modelling, where it is necessary to have language specific vocabularies. As a running example, consider the case where each attribute corresponds to a language representation vector. Let 3 Table 2: Samples generated from the model when conditioning on various attributes. For the last example, we condition on the average of the two vectors (symbol <#> corresponds to a number). Attribute Sample <#> : <#> for thus i enquired unto thee , saying , the lord had not come unto Bible him . <#> : <#> when i see them shall see me greater am that under the name of the king on israel . to tell vs pindarus : shortly pray , now hence , a word . comes hither , and Caesar let vs exclaim once by him fear till loved against caesar . till you are now which have kept what proper deed there is an ant ? for caesar not wise cassi let our spring tiger as with less ; for tucking great fellowes at ghosts of broth . 1 2 (Bible + industrious time with golden glory employments . <#> : <#> but are far in men Caesar) soft from bones , assur too , set and blood of smelling , and there they cost , i learned : love no guile his word downe the mystery of possession x denote the attribute vector for language ℓand x′ for language ℓ′ (e.g. English and French). We can then compute language-specific word representations T ℓby breaking up our decomposition into language dependent and independent components (see Fig. 1c): T ℓ= (Wfv ℓ)⊤· diag(Wfdx) · Wfk, (6) where (Wfv ℓ)⊤is a Vℓ× F language specific matrix. The matrices Wfd and Wfk do not depend on the language or the vocabulary, whereas (Wfv ℓ)⊤is language specific. Moreover, since each language may have a different sized vocabulary, we use Vℓto denote the vocabulary size of language ℓ. Observe that this model has an interesting property in that it allows us to share statistical strength across word representations of different languages. In particular, we show in our experiments how we can improve cross-lingual classification performance between English and German when a large amount of parallel data exists between English and French and only a small amount of parallel data exists between English and German. 2.5 Learning attribute representations We now discuss how to learn representation vectors x. Recall that when training neural language models, the word representations of w1, . . . , wn−1 are updated by backpropagating through the word embedding matrix. We can think of this as being a linear layer, where the input to this layer is a one-hot vector with the i-th position active for word wi. Then multiplying this vector by the embedding matrix results in the word vector for wi. Thus the columns of the word representations matrix consisting of words from w1, . . . , wn−1 will have non-zero gradients with respect to the loss. This allows us to consistently modify the word representations throughout training. We construct attribute representations in a similar way. Suppose that L is an attribute lookup table, where x = f(L(:, x)) and f is an optional non-linearity. We often use a rectifier non-linearity in order to keep x sparse and positive, which we found made training much more stable. Initially, the entries of L are generated randomly. During training, we treat L in the same way as the word embedding matrix. This way of learning language representations allows us to measure how ‘similar’ attributes are as opposed to using a one-hot encoding of attributes for which no such similarity could be computed. In some cases, attributes that are available during training may not also be available at test time. An example of this is when attributes are used as sentence indicators for learning representations of sentences. To accommodate for this, we use an inference step similar to that proposed by [6]. That is, at test time all the network parameters are fixed and stochastic gradient descent is used for inferring the representation of an unseen attribute vector. 3 Experiments In this section we describe our experimental evaluation and results. Throughout this section we refer to our model as Attribute Tensor Decomposition (ATD). All models are trained using stochastic gradient descent with an exponential learning rate decay and linear (per epoch) increase in momentum. We first demonstrate initial qualitative results to get a sense of the tasks our model can perform. For these, we use the small project Gutenberg corpus which consists of 18 books, some of which have the same author. We first trained a multiplicative neural language model with a context size of 5, 4 Table 3: A modified version of the game Mad Libs. Given an initialization, the model is to generate the next 5 words according to the part-of-speech sequence (note that these are not hard constraints). [DT, NN, IN, DT, JJ] [TO, VB, VBD, JJS, NNS] [PRP, NN, ’,’ , JJ, NN] the meaning of life is... my greatest accomplishment is... i could not live without... the cure of the bad to keep sold most wishes his regard , willing tenderness the truth of the good to make manned most magnificent her french , serious friend a penny for the fourth to keep wounded best nations her father , good voice the globe of those modern to be allowed best arguments her heart , likely beauty all man upon the same to be mentioned most people her sister , such character Table 4: Classification accuracies on various tasks. Left: Sentiment classification on the treebank dataset. Competing methods include the Neural Bag of words (NBoW) [5], Recursive Network (RNN) [17], Matrix-Vector Recursive Network (MV-RNN) [18], Recursive Tensor Network (RTNN) [3], Dynamic Convolutional Network (DCNN) [5] and Paragraph Vector (PV) [6]. Right: Cross-lingual classification on RCV2. Methods include statistical machine translation (SMT), IMatrix [19], Bag-of-words autoencoders (BAE-*) [20] and BiCVM, BiCVM+ [21]. The use of ‘+’ on cross-lingual tasks indicate the use of a third language (French) for learning embeddings. Method Fine-grained Positive / Negative SVM 40.7% 79.4% BiNB 41.9% 83.1% NBoW 42.4% 80.5% RNN 43.2% 82.4% MVRNN 44.4% 82.9% RTNN 45.7% 85.4% DCNN 48.5% 86.8% PV 48.7% 87.8% ATD 45.9% 83.3% Method EN →DE DE →EN SMT 68.1% 67.4% I-Matrix 77.6% 71.1% BAE-cr 78.2% 63.6% BAE-tree 80.2% 68.2% BiCVM 83.7% 71.4% BiCVM+ 86.2% 76.9% BAE-corr 91.8% 72.8% ATD 80.8% 71.8% ATD+ 83.4% 72.9% where each attribute is represented as a book. This results in 18 learned attribute vectors, one for each book. After training, we can condition on a book vector and generate samples from the model. Table 2 illustrates some the generated samples. Our model learns to capture the ‘style’ associated with different books. Furthermore, by conditioning on the average of book representations, the model can generate reasonable samples that represent a hybrid of both attributes, even though such attribute combinations were not observed during training. Next, we computed POS sequences from sentences that occur in the training corpus. We trained a multiplicative neural language model with a context size of 5 to predict the next word from its context, given knowledge of the POS tag for the next word. That is, we model P(wn = i|w1:n−1, x) where x denotes the POS tag for word wn. After training, we gave the model an initial input and a POS sequence and proceeded to generate samples. Table 3 shows some results for this task. Interestingly, the model can generate rather funny and poetic completions to the initial context. 3.1 Sentiment classification Our first quantitative experiments are performed on the sentiment treebank of [3]. A common challenge for sentiment classification tasks is that the global sentiment of a sentence need not correspond to local sentiments exhibited in sub-phrases of the sentence. To address this issue, [3] collected annotations from the movie reviews corpus of [22] of all subphrases extracted from a sentence parser. By incorporating local sentiment into their recursive architectures, [3] was able to obtain significant performance gains with recursive networks over bag of words baselines. We follow the same experimental procedure proposed by [3] for which evaluation is reported on two tasks: fine-grained classification of categories {very negative, negative, neutral, positive, very positive } and binary classification {positive, negative }. We extracted all subphrases of sentences that occur in the training set and used these to train a multiplicative neural language model. Here, each attribute is represented as a sentence vector, as in [6]. In order to compute subphrases for unseen sentences, we apply an inference procedure similar to [6], where the weights of the network are frozen and gradient descent is used to infer representations for each unseen vector. We trained a logistic regression classifier using all training subphrases in the training set. At test time, we infer a representation for a new sentence which is used for making a review prediction. We used a context 5 size of 8, 100 dimensional word vectors initialized from [2] and 100 dimensional sentence vectors initialized by averaging vectors of words from the corresponding sentence. Table 4, left panel, illustrates our results on this task in comparison to all other proposed approaches. Our results are on par with the highest performing recursive network on the fine-grained task and outperforms all bag-of-words baselines and recursive networks with the exception of the RTNN on the binary task. Our method is outperformed by the two recently proposed approaches of [5] (a convolutional network trained on sentences) and Paragraph Vector [6]. 3.2 Cross-lingual document classification We follow the experimental procedure of [19], for which several existing baselines are available to compare our results. The experiment proceeds as follows. We first use the Europarl corpus [23] for inducing word representations across languages. Let S be a sentence with words w in language ℓ and let x be the corresponding language vector. Let vℓ(S) = X w∈S T ℓ(:, w) = X w∈S (Wfv ℓ(:, w))⊤· diag(Wfdx) · Wfk (7) denote the sentence representation of S, defined as the sum of language conditioned word representations for each w ∈S. Equivalently we define a sentence representation for the translation S′ of S denoted as vℓ′(S′). We then optimize the following ranking objective: minimize θ X S X k max  0, α + vℓ(S) −vℓ′(S′) 2 2 − vℓ(S) −vℓ′(Ck) 2 2  + λ θ 2 2 subject to the constraints that each sentence vector has unit norm. Each Ck is a constrastive (nontranslation) sentence of S and θ denotes all model parameters. This type of cross-language ranking loss was first used by [21] but without the norm constraint which we found significantly improved the stability of training. The Europarl corpus contains roughly 2 million parallel sentence pairs between English and German as well as English and French, for which we induce 40 dimensional word representations. Evaluation is then performed on English and German sections of the Reuters RCV1/RCV2 corpora. Note that these documents are not parallel. The Reuters dataset contains multiple labels for each document. Following [19], we only consider documents which have been assigned to one of the top 4 categories in the label hierarchy. These are CCAT (Corporate/Industrial), ECAT (Economics), GCAT (Government/Social) and MCAT (Markets). There are a total of 34,000 English documents and 42,753 German documents with vocabulary sizes of 43614 English words and 50,110 German words. We consider both training on English and evaluating on German and vice versa. To represent a document, we sum over the word representations of words in that document followed by a unit-ball projection. Following [19] we use an averaged perceptron classifier. Classification accuracy is then evaluated on a held-out test set in the other language. We used a monolingual validation set for tuning the margin α, which was set to α = 1. Five contrastive terms were used per example which were randomly assigned per epoch. Table 4, right panel, shows our results compared to all proposed methods thus far. We are competitive with the current state-of-the-art approaches, being outperformed only by BiCVM+ [21] and BAE-corr [20] on EN →DE. The BAE-corr method combines both a reconstruction term and a correlation regularizer to match sentences, while our method does not consider reconstruction. We also performed experimentation on a low resource task, where we assume the same conditions as above with the exception that we only use 10,000 parallel sentence pairs between English and German while still incorporating all English and French parallel sentences. For this task, we compare against a separation baseline, which is the same as our model but with no parameter sharing across languages (and thus resembles [21]). Here we achieve 74.7% and 69.7% accuracies (EN→DE and DE→EN) while the separation baseline obtains 63.8% and 67.1%. This indicates that parameter sharing across languages can be useful when only a small amount of parallel data is available. Figure 2 further shows t-SNE embeddings of English-German word pairs.1 Another interesting consideration is whether or not the learned language vectors can capture any interesting properties of various languages. To look into this, we trained a multiplicative neural language model simultaneously on 5 languages: English, French, German, Czech and Slovak. To our knowledge, this is the most languages word representations have been jointly learned on. We 1We note that Germany and Deutschland are nearest neighbours in the original space. 6 (a) Months (b) Countries Figure 2: t-SNE embeddings of English-German word pairs learned from Europarl. (a) Correlation matrix 5 10 25 50 100 382 # Documents (thousands) 0 1 2 3 4 5 6 Improvement over initial model unconditioned ATD LBL conditioned ATD (b) Effect of conditional embeddings 5 10 25 50 100 382 # Documents (thousands) −0.2 −0.1 0.0 0.1 0.2 0.3 Inferred attributes difference unconditioned ATD (c) Effect of inferring attribute vectors Figure 3: Results on the Blog classification corpus. For the middle and right plots, each pair of same coloured bars corresponds to the non-inclusion or inclusion of inferred attribute vectors, respectively. computed a correlation matrix from the language vectors, illustrated in Fig. 3a. Interestingly, we observe high correlation between Czech and Slovak representations, indicating that the model may have learned some notion of lexical similarity. That being said, additional experimentation for future work is necessary to better understand the similarities exhibited through language vectors. 3.3 Blog authorship attribution For our final task, we use the Blog corpus of [24] which contains 681,288 blog posts from 19,320 authors. For our experiments, we break the corpus into two separate datasets: one containing the 1000 most prolific authors (most blog posts) and the other containing all the rest. Each author comes with an attribute tag corresponding to a tuple (age, gender, industry) indicating the age range of the author (10s, 20s or 30s), whether the author is male or female, and what industry the author works in. Note that industry does not necessary correspond to the topic of blog posts. We use the dataset of non-prolific authors to train a multiplicative language model conditioned on an attribute tuple of which there are 234 unique tuples in total. We used 100 dimensional word vectors initialized from [2], 100 dimensional attribute vectors with random initialization and a context size of 5. A 1000-way classification task is then performed on the prolific author subset and evaluation is done using 10-fold cross-validation. Our initial experimentation with baselines found that tf-idf performs well on this dataset (45.9% accuracy). Thus, we consider how much we can improve on the tf-idf baseline by augmenting word and attribute features. For the first experiment, we determine the effect conditional word embeddings have on classification performance, assuming attributes are available at test time. For this, we compute two embedding matrices from a trained ATD model, one without and with attribute knowledge: unconditioned ATD : (Wfv)⊤Wfk (8) conditioned ATD : (Wfv)⊤· diag(Wfdx) · Wfk. (9) We represent a blog post as the sum of word vectors projected to unit norm and augment these with tf-idf features. As an additional baseline we include a log-bilinear language model [14]. 2 Figure 3b illustrates the results from which we observe that conditioned word embeddings are significantly more discriminative over word embeddings computed without knowledge of attribute vectors. 2The log-bilinear model has no concept of attributes. 7 Table 5: Results from a conditional word similarity task using Blog attributes and language vectors. Query,A,B Common Unique to A Unique to B school work choir therapy f/10/student church prom tech m/20/tech college skool job journal diary project zine f/10/student blog book app m/30/adv. webpage yearbook referral create build provide compile f/30/arts develop acquire follow f/30/internet maintain generate analyse joy happiness rapture delight m/30/religion sadness god comfort m/20/science pain heartbreak soul cool nice beautiful sexy m/10/student funny amazing hott f/10/student awesome neat lame English French German january janvier januar june decembre dezember october juin juni market marche markt markets marches binnenmarktes internal interne marktes war guerre krieg weapons terrorisme globale global mondaile krieges said dit sagte stated disait gesagt told declare sagten two deux zwei two-thirds deuxieme beiden both seconde zweier For the second experiment, we determine the effect of inferring attribute vectors at test time if they are not assumed to be available. To do this, we train a logistic regression classifier within each fold for predicting attributes. We compute an inferred vector by averaging each of the attribute vectors weighted by the log-probabilities of the classifier. In Fig. 3c we plot the difference in performance when an inferred vector is augmented vs. when it is not. These results show consistent, albeit small improvement gains when attribute vectors are inferred at test time. To get a better sense of the attribute features learned from the model, the supplementary material contains a t-SNE embedding of the learned attribute vectors. Interestingly, the model learns features which largely isolate the vectors of all teenage bloggers independent of gender and topic. 3.4 Conditional word similarity One of the key properties of our tensor formulation is the notion of conditional word similarity, namely how neighbours of word representations change depending on the attributes that are conditioned on. In order to explore the effects of this, we performed two qualitative comparisons: one using blog attribute vectors and the other with language vectors. These results are illustrated in Table 5. For the first comparison on the left, we chose two attributes from the blog corpus and a query word. We identify each of these attribute pairs as A and B. Next, we computed a ranked list of the nearest neighbours (by cosine similarity) of words conditioned on each attribute and identified the top 15 words in each. Out of these 15 words, we display the top 3 words which are common to both ranked lists, as well as 3 words that are unique to a specific attribute. Our results illustrate that the model can capture distinctive notions of word similarities depending on which attributes are being conditioned. On the right of Table 5, we chose a query word in English (italicized) and computed the nearest neighbours when conditioned on each language vector. This results in neighbours that are either direct translations of the query word or words that are semantically similar. The supplementary material includes additional examples with nearest neighbours of collocations. 4 Conclusion There are several future directions from which this work can be extended. One application area of interest is in learning representations of authors from papers they choose to review as a way of improving automating reviewer-paper matching [25]. Since authors contribute to different research topics, it might be more useful to instead consider a mixture of attribute vectors that can allow for distinctive representations of the same author across research areas. Another interesting application is learning representations of graphs. Recently, [26] proposed an approach for learning embeddings of nodes in social networks. Introducing network indicator vectors could allow us to potentially learn representations of full graphs. Finally, it would be interesting to train a multiplicative neural language model simultaneously across dozens of languages. Acknowledgments We would also like to thank the anonymous reviewers for their valuable comments and suggestions. This work was supported by NSERC, Google, Samsung, and ONR Grant N00014-14-1-0232. 8 References [1] Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In ICML, pages 160–167, 2008. [2] Joseph Turian, Lev Ratinov, and Yoshua Bengio. Word representations: a simple and general method for semi-supervised learning. In ACL, pages 384–394, 2010. [3] Richard Socher, Alex Perelygin, Jean Y Wu, Jason Chuang, Christopher D Manning, Andrew Y Ng, and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In EMNLP, pages 1631–1642, 2013. [4] Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In NIPS, pages 3111–3119, 2013. [5] Phil Blunsom, Edward Grefenstette, Nal Kalchbrenner, et al. A convolutional neural network for modelling sentences. In ACL, 2014. [6] Quoc V Le and Tomas Mikolov. Distributed representations of sentences and documents. ICML, 2014. [7] Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In NIPS, pages 2787–2795, 2013. [8] Richard Socher, Danqi Chen, Christopher D Manning, and Andrew Ng. Reasoning with neural tensor networks for knowledge base completion. In NIPS, pages 926–934, 2013. [9] Yann N Dauphin, Gokhan Tur, Dilek Hakkani-Tur, and Larry Heck. Zero-shot learning for semantic utterance classification. ICLR, 2014. [10] Andrea Frome, Greg S Corrado, Jon Shlens, Samy Bengio, Jeffrey Dean, and Tomas Mikolov MarcAurelio Ranzato. Devise: A deep visual-semantic embedding model. NIPS, 2013. [11] Graham W Taylor and Geoffrey E Hinton. Factored conditional restricted boltzmann machines for modeling motion style. In ICML, pages 1025–1032, 2009. [12] Ryan Kiros, Richard S Zemel, and Ruslan Salakhutdinov. Multimodal neural language models. ICML, 2014. [13] Ilya Sutskever, James Martens, and Geoffrey E Hinton. Generating text with recurrent neural networks. In ICML, pages 1017–1024, 2011. [14] Andriy Mnih and Geoffrey Hinton. Three new graphical models for statistical language modelling. In ICML, pages 641–648, 2007. [15] Roland Memisevic and Geoffrey Hinton. Unsupervised learning of image transformations. In CVPR, pages 1–8, 2007. [16] Alex Krizhevsky, Geoffrey E Hinton, et al. Factored 3-way restricted boltzmann machines for modeling natural images. In AISTATS, pages 621–628, 2010. [17] Richard Socher, Jeffrey Pennington, Eric H Huang, Andrew Y Ng, and Christopher D Manning. Semisupervised recursive autoencoders for predicting sentiment distributions. In EMNLP, pages 151–161, 2011. [18] Richard Socher, Brody Huval, Christopher D Manning, and Andrew Y Ng. Semantic compositionality through recursive matrix-vector spaces. In EMNLP, pages 1201–1211, 2012. [19] Alexandre Klementiev, Ivan Titov, and Binod Bhattarai. Inducing crosslingual distributed representations of words. In COLING, pages 1459–1474, 2012. [20] Sarath Chandar A P, Stanislas Lauly, Hugo Larochelle, Mitesh M Khapra, Balaraman Ravindran, Vikas Raykar, and Amrita Saha. An autoencoder approach to learning bilingual word representations. NIPS, 2014. [21] Karl Moritz Hermann and Phil Blunsom. Multilingual distributed representations without word alignment. ICLR, 2014. [22] Bo Pang and Lillian Lee. Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. In ACL, pages 115–124, 2005. [23] Philipp Koehn. Europarl: A parallel corpus for statistical machine translation. In MT summit, volume 5, pages 79–86, 2005. [24] Jonathan Schler, Moshe Koppel, Shlomo Argamon, and James W Pennebaker. Effects of age and gender on blogging. In AAAI Spring Symposium: Computational Approaches to Analyzing Weblogs, volume 6, pages 199–205, 2006. [25] Laurent Charlin, Richard S Zemel, and Craig Boutilier. A framework for optimizing paper matching. UAI, 2011. [26] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. KDD, 2014. 9
2014
363
5,473
Feedforward Learning of Mixture Models Matthew Lawlor∗ Applied Math Yale University New Haven, CT 06520 mflawlor@gmail.com Steven W. Zucker Computer Science Yale University New Haven, CT 06520 zucker@cs.yale.edu Abstract We develop a biologically-plausible learning rule that provably converges to the class means of general mixture models. This rule generalizes the classical BCM neural rule within a tensor framework, substantially increasing the generality of the learning problem it solves. It achieves this by incorporating triplets of samples from the mixtures, which provides a novel information processing interpretation to spike-timing-dependent plasticity. We provide both proofs of convergence, and a close fit to experimental data on STDP. 1 Introduction Spectral tensor methods and tensor decomposition are emerging themes in machine learning, but they remain global rather than “online.” While incremental (online) learning can be useful for applications, it is essential for neurobiology. Error back propagation does operate incrementally, but its neurobiological relevance remains a question for debate. We introduce a triplet learning rule for mixture distributions based on a tensor formulation of the BCM biological learning rule. It is implemented in a feedforward fashion, removing the need for backpropagation of error signals. The triplet requirement is natural biologically. Informally imagine your eyes microsaccading during a fixation, so that a tiny image fragment is “sampled” repeatedly until the next fixation. Viewed from visual cortex, edge selective neurons will fire repeatedly. Importantly, they exhibit strong statistical dependencies due to the geometry of objects and their relationships in the world. “Hidden” information such as edge curvatures, the presence of textures, and lighting discontinuities all affect the probability distribution of firing rates among orientation selective neurons, leading to complex statistical interdependencies between neurons. Latent variable models are powerful tools in this context. They formalize the idea that highly coupled random variables can be simply explained by a small number of hidden causes. Conditioned on these causes, the input distribution should be simple. For example, while the joint distribution of edges in a small patch of a scene might be quite complex, the distribution conditioned on the presence of a curved object at a particular location might be comparatively simple [14]. The specific question is whether brains can learn these mixture models, and how. Example: Imagine a stimulus space of K inputs. These could be images of edges at particular orientations, or audio tones at K frequencies. These stimuli are fed into a network of n LinearNonlinear Poisson (LNP) spiking neurons. Let rij denote the firing rate of neuron i to stimulus j. Assuming the stimuli are drawn independently with probability αk, then the number of spikes d in an interval where a single stimulus is shown is distributed according to a mixture model. P(d) = X k αkPk(d) 1Now at Google Inc. 1 where Pk(d) is a vector of independent Poisson distributions, and the rate parameter of the ith component is rik. We seek a filter that responds (in expectation) to one and only one stimulus. To do this, we must learn a set of weights that are orthogonal to all but one of the vectors of rates r·j. Each rate vector corresponds to the mean of one of the mixtures. Our problem is thus to learn the means of mixtures. We will demonstrate that this can be done non-parametrically over a broad class of firing patterns, not just Poisson spiking neurons. Although fitting mixture models can be exponentially hard, under a certain multiview assumption, non-parametric estimation of mixture means can be done by tensor decomposition [2][1]. This multiview assumption requires access to at least 3 independent copies of the samples; i.e., multiple samples drawn from the same mixture component. For the LNP example above, this multiview assumption requires only that we have access to the number of spikes in three disjoint intervals, while the stimulus remains constant. After these intervals, the stimulus is free to change – in vision, say, after a saccade – after which point another sample triple is taken. Our main result is that, with a slight modification of classical Bienenstock-Cooper-Munro [5] synaptic update rule a neuron can perform a tensor decomposition of the input data. By incorporating the interactions between input triplets, our online learning rule can provably learn the mixture means under an extremely broad class of mixture distributions and noise models. (The classical BCM learning rule will not converge properly in the presence of noise.) Specifically we show how the classical BCM neuron performs gradient ascent in a tensor objective function, when the data consists of discrete input vectors, and how our modified rule converges when the data are drawn from a general mixture model. The multiview requirement has an intriguing implication for neuroscience. Since spikes arrive in waves, and spike trains matter for learning [9], our model suggests that the waves of spikes arriving during adjacent epochs in time provide multiple samples of a given stimulus. This provides an unusual information processing interpretation for the functional role of spike trains. To realize it fully, we point out that classical BCM can be implemented via spike timing dependent plasticity [17][10][6][18]. However, most of these approaches require much stronger distributional assumptions on the input data (generally Poisson), or learn a much simpler decomposition of the data than our algorithm. Other, Bayesian methods [16], require the computation of a posterior distribution which requires an implausible normalization step. Our learning rule successfully avoids these issues, and has provable guarantees of convergence to the true mixture means. At the end of this paper we show how our rule predicts pair and triple spike timing dependent plasticity data. 2 Tensor Notation Let ⊗denote the tensor product. We denote application of a k-tensor to k vectors by T(w1, ..., wk), so in the simple case where T = v1 ⊗... ⊗vk, T(w1, ..., wk) = Y j ⟨vj, wj⟩ We further denote the application of a k-tensor to k matrices by T(M1, ..., Mk) where T(M1, ..., Mk)i1,...,ik = X j1,...,jk Tj1,...,jk[M1]j1,i1...[Mk]jk,ik Thus if T is a symmetric 2-tensor, T(M1, M2) = M T 1 TM2 with ordinary matrix multiplication. Similarly, T(v1, v2) = vT 1 Tv2. We say that T has an orthogonal tensor decomposition if T = X k αkvk ⊗vk ⊗... ⊗vk and ⟨vi, vj⟩= δij 3 Connection Between BCM Neuron and Tensor Decompositions The BCM learning rule was introduced in 1982 in part to correct failings of the classical Hebbian learning rule [5]. The Hebbian learning rule [11] is one of the simplest and oldest learning rules. It 2 posits that the selectivity of a neuron to input i, mt(i) is increased in proportion to the post-synaptic activity of that neuron ct = ⟨mt−1, dt⟩, where m is a vector of synaptic weights. mt −mt−1 = γtctdt This learning rule will become increasingly correlated with its input. As formulated this rule does not converge for most input, as ∥m∥→∞. In addition, in the presence of multiple inputs Hebbian learning rule will always converge to an “average” of the inputs, rather than becoming selective to one particular input. It is possible to choose a normalization of m such that m will converge to the first eigenvector of the input data. The BCM rule tries to correct for the lack of selectivity, and for the stabilization problems. Like the Hebbian learning rule, it always updates its weights in the direction of the input, however it also has a sliding threshold that controls the magnitude and sign of this weight update. The original formulation of the BCM rule is as follows: Let c be the post-synaptic firing rate, d ∈RN be the vector of presynaptic firing rates, and m be the vector of synaptic weights. Then the BCM synaptic modification rule is c = ⟨m, d⟩ ˙m = φ(c, θ)d φ is a non-linear function of the firing rate, and θ is a sliding threshold that increases as a superlinear function of the average firing rate. There are many different formulations of the BCM rule. The primary features that are required are φ(c, θ) is convex in c, φ(0, θ) = 0, φ(θ, θ) = 0, and θ is a super-linear function of E[c]. These properties guarantee that the BCM learning rule will not grow without bound. There have been many variants of this rule. One of the most theoretically well analyzed variants is the Intrator and Cooper model [12], which has the following form for φ and θ. φ(c, θ) = c(c −θ) with θ = E[c2] Definition 3.1 (BCM Update Rule). With the Intrator and Cooper definition, the BCM rule is defined as mt = mt−1 + γtct(ct −θt−1)dt (1) where ct = ⟨mt−1, dt⟩and θ = E[c2]. γt is a sequence of positive step sizes with the property that P t γt →∞and P t γ2 t < ∞ The traditional application of this rule is a system where the input d is drawn from linearly independent vectors {d1, ..., dk} with probabilities α1, ..., αK, with K = N, the dimension of the space. These choices are quite convenient because they lead to the following objective function formulation of the synaptic update rule. R(m) = 1 3E h ⟨m, d⟩3i −1 4E h ⟨m, d⟩2i2 Thus, ∇R = E h ⟨m, d⟩2 d −E[⟨m, d⟩2] ⟨m, d⟩d i = E[c(c −θ)d] = E[φ(c, θ)d] So in expectation, the BCM rule performs a gradient ascent in R(m). For random, discrete input this rule would then be a form of stochastic gradient ascent. With this model, we observe that the objective function can be rewritten in tensor notation. Note that this input model can be seen as a kind of degenerate mixture model. 3 This objective function can be written as a tensor objective function, by noting the following: T = X k αkdk ⊗dk ⊗dk M = X k αkdk ⊗dk R(m) = 1 3T(m, m, m) −1 4M(m, m)2 (2) For completeness, we present a proof that the stable points of the expected BCM update are selective for only one of the data vectors. The stable points of the expected update occur when E[ ˙m] = 0. Let ck = ⟨m, dk⟩and φk = φ(ck, θ). Let c = [c1, . . . , cK]T and Φ = [φ1, . . . , φK]T . DT = [d1| · · · |dK] P = diag(α) Theorem 3.2. (Intrator 1992) Let K = N, let each dk be linearly independent, and let αk > 0 and distinct. Then stable points (in the sense of Lyapunov) of the expected update ˙m = ∇R occur when c = α−1 k ek or m = α−1 k D−1ek. ek is the unit basis vector, so there is activity for only one stimuli. Proof. E[ ˙m] = DT PΦ which is 0 only when Φ = 0. Note θ = P k αkc2 k. φk = 0 if ck = 0 or ck = θ. Let S+ = {k : ck ̸= 0}, and S−= {k : ck = 0}. Then for all k ∈S+, ck = βS+ βS+ −β2 S+ X k∈S+ αi = 0 βS+ =  X k∈S+ αi   −1 Therefore the solutions of the BCM learning rule are c = 1S+βS+, for all subsets S+ ⊂{1, . . . , K}. We now need to check which solutions are stable. The stable points (in the sense of Lyapunov) are points where the matrix H = ∂E[ ˙m] ∂m = DT P ∂Φ ∂c  ∂c ∂m = DT P ∂Φ ∂c  D is negative semidefinite. Let S be an index set S ⊂{1, . . . , n}. We will use the following notation for the diagonal matrix IS: (IS)ii = 1 i ∈S 0 i /∈S (3) So IS + ISc = I, and eieT i = I{i} a quick calculation shows ∂φi ∂cj  = βS+IS+ −βS+IS−−2β2 S+ diag(α) 1S+1T S+ This is negative semidefinite iff A = IS+ −2βS+ diag(α) 1S+1T S+ is negative semidefinite. Assuming a non-degeneracy of the probabilities α, and assume |S+| > 1. Let j = arg mink∈S+ αk. Then βS+αj < 1 2 so A is not negative semi-definite. However, if |S+| = 1 then A = −IS+ so the stable points occur when c = 1 αi ei The triplet version of BCM can be viewed as a modification of the classical BCM rule which allows it to converge in the presence of zero-mean noise. This indicates that the stable solutions of this learning rule are selective for only one data vector, dk. Building off of the work of [2] we will use this characterization of the objective function to build a triplet BCM update rule which will converge for general mixtures, not just discrete data points. 4 d1 d2 m1 m2 −10 −5 0 5 10 15 20 25 0 2 4 6 8 10 12 14 ⟨m1,d⟩ −10 −5 0 5 10 15 20 25 0 2 4 6 8 10 12 14 16 18 20 22 ⟨m2,d⟩ (a) Geometry of stable solutions. Each stable solution is selective in expectation for a single mixture. Note that the classical BCM rule will not converge to these values in the presence of noise. 10−2 10−1 100 101 0 1 2 3 Noise σ ∥m −m0∥ Noise sensitivity of m after 10e6 steps Triplet Rule BCM (b) Noise response of triplet BCM update rule vs BCM update. Input data was a mixture of Gaussians with standard deviation σ. The selectivity of the triplet BCM rule remains unchanged in the presence of noise. 4 Triplet BCM Rule We now show that by modifying the update rule to incorporate information from triplets of input vectors, the generality of the input data can be dramatically increased. Our new BCM rule will learn selectivity for arbitrary mixture distributions, and learn weights which in expectation are selective for only one mixture component. Assume that P(d) = X k αkPk(d) where EPk[d] = dk. For example, the data could be a mixture of axis-aligned Gaussians, a mixture of independent Poisson variables, or mixtures of independent Bernoulli random variables to name a few. We also require EPk[∥d∥2] < ∞. We emphasize that we do not require our data to come from any parametric distribution. We interpret k to be a latent variable that signals the hidden cause of the underlying input distribution, with distribution Pk. Critically, we assume that the hidden variable k changes slowly compared to the inter-spike period of the neuron. In particular, we need at least 3 samples from each Pk. This corresponds to the multi-view assumption of [2]. A particularly relevant model meeting this assumption is that of spike counts in disjoint intervals under a Poisson process, with a discrete, time varying rate parameter. For the purpose of this paper, we assume the number of mixed distributions, k, is equal to the number of dimensions, n, however it is possible to relax this to k < n. Let {d1, d2, d3} be a triplet of independent copies from some Pk(d), i.e. each are drawn from the same mixture. It is critical to note that if {d1, d2, d3} are not drawn from the same class, this update will not converge to the global maximum. Numerical experiments show this assumption can be violated somewhat without severe changes to the fixed points of the algorithm. Our sample is then a sequence of triplets, each triplet drawn from the same latent distribution. Let ci = di, m . With these independent triples, we note that the tensors T and M from equation (2) can be written as moments of the independent triplets T = E[d1 ⊗d2 ⊗d3] M = E[d1 ⊗d2] R(m) = 1 3T(m, m, m) −1 4M(m, m)2 This is precisely the same objective function optimized by the classical BCM update, with the conditional means of the mixture distributions taking the place of discrete data points. With access to independent triplets, selectivity for significantly richer input distributions can be learned. 5 As with classical BCM, we can perform gradient ascent in this objective function which leads to the expected update E[∇R] = E[c1c2d3 + (c1d2 + c2d1)(c3 −2θ)] where θ = E[c1c2]. This update is rather complicated, and couples pre and post synaptic firing rates across multiple time intervals. Since each ci and di are identically distributed, this expectation is equal to E[c2(c3 −θ)d1] which suggests a much simpler update. This ordering was chosen to match the spike timing dependency of synaptic modification. This update depends on the presynaptic input, and the postsynaptic excitation in two disjoint time periods. Definition 4.1 (Full-rank Triplet BCM). The full-rank Triplet BCM update rule is: mt = π(mt−1 + γtφ(c2, c3, θt−1)d1) (4) where φ(c2, c3, θ) = c2(c3 −θ), the step size γt obeys P t γt →∞, and P t γ2 t < ∞. π is a projection into an arbitrary large compact ball, which is needed for technical reasons to guarantee convergence. 5 Stochastic Approximation Having found the stable points of the expected update for BCM and triplet BCM, we now turn to a proof of convergence for the stochastic update generated by mixture models. For this, we turn to results from the theory of stochastic approximation. We will decompose our update into two parts, the expected update, and the (random) deviation. This deviation will be a L2 bounded martingale, while the expected update will be a ODE with the previously calculated stable points. Since the expected update is the gradient of a objective function R, the Lyapunov functions required for the stability analysis are simply this objective function. The decomposition of the triplet BCM stochastic process is as follows: mt −mt−1 = γtφ(c2 t, c3 t, θt−1)d1 = γnE[φ(c2, c3, θt−1)d1] + γn φ(c2, c3, θt−1)d1 −E[φ(c2, c3, θt−1)d1]  = γth(mt) −γtηt Here, h(mt) is the deterministic expected update, and ηt is a martingale. All our expectations are taken with respect to triplets of input data. The decomposition for classical BCM is similar. This is the Doob decomposition [8] of the sequence. Using a theorem of Delyon [7], we will show that our triplet BCM algorithm will converge with probability 1 to the stable points of the expected update. As was shown previously, these stable points are selective for one and only one mixture component in expectation. Theorem 5.1. For the full rank case, the projected update converges w.p. 1 to the zeros of ∇Φ Proof. See supplementary material, or an extended discussion in a forthcoming arXiv preprint [13]. 6 Triplet BCM Explains STDP Up to Spike Triplets Biophysically synaptic efficiency in the brain is more closely modeled by spike timing dependent plasticity (STDP). It depends precisely on the interval between pre- and post-synaptic spikes. Initial research on spike pairs [15, 3] showed that a presynaptic spike followed in close succession by a postsynaptic spike tended to strengthen a synapse, while the reverse timing weakened it. Later work on natural spike chains [9], triplets of spikes [4, 19], and quadruplets have shown interaction effects beyond pairs. Most closely to ours, recent work by Pfister and Gerstner [17] suggested that a synaptic modification function depending only on spike triplets is sufficient to explain all current experimental data. Furthermore, their rule resembles a BCM learning rule when the pre- and postsynaptic firing distributions are independent Poisson. 6 We now demonstrate that our learning rule can model both the pairwise and triplet results from Pfister and Gerstner using a smaller number of free parameters and without the introduction of hidden leaky timing variables. Instead, we work directly with the pre- and post-synaptic voltages, and model the natural voltage decay during the falling phase of an action potential. Our (four) free variables are the voltage decay, which we set within reasonable biological limits; a bin width, controlling the distance between spiking triplet periods; θ, our sliding voltage threshold; and an overall multiplicative constant. We emphasize that our model was not designed to fit these data; it was designed to learn selectivity for the multi-view mixture task. Spike timing dependence falls out as a natural consequence of our multi-view assumption. −100 −80 −60 −40 −20 0 20 40 60 80 100 −50 0 50 100 Spike Timing (ms) Change in EPSC Amplitude (%) Figure 2: Fit of triplet BCM learning rule to synaptic strength STDP curve from [3]. Data points were recreated from [3] . Spike timing measures the time between post synaptic and presynaptic spikes, tpost −tpre. A positive time means the presynaptic spike was followed by a postsynaptic spike. We first model hippocampus data from Mu-ming Poo [3], who applied repeated electrical stimulation to the pre- and post-synaptic neurons in a pairing protocol within which the relative timing of the two spike chains was varied. After repeated stimulation at a fixed timing offset, the change in synaptic strength (postsynaptic current) was measured. We take the average voltage in triplet intervals to be the measure of pre- and post-synaptic activity, and consider a one-dimensional version of our synaptic update: δm = Ac2(c3 −θ)d1 (5) where c2 and c3 are the postsynaptic voltage averaged over the second and third time bins, and d1 is the presynaptic voltage averaged over the first time bin. We assume our pre and post synaptic voltages are governed by the differential equation: dV dt = −τV (6) such that, if t = sk where sk is the kth spike, V (t) →1. That is, the voltage is set to 1 at each spike time before decaying again. Let Vpre be the presynaptic voltage trace, and Vpost be the postsynaptic voltage trace. They are determined by the timing of pre- and post-synaptic spikes, which occur at r1, r2, . . . , rn for the presynaptic spikes, and o1, o2, . . . om for the postsynaptic spikes. To model the pairwise experiments, we let ri = r0 + iT where T = 1000ms, a large time constant. Then oi = ri + δt where δt is the spike timing. Let δb be the size of the bins. That is to say, d1(t) = Z t+ δb 2 t− δb 2 Vpre(t′ + δb)dt′ c2(t) = Z t+ δb 2 t− δb 2 Vpost(t′)dt′ c3(t) = Z t+ δb 2 t− δb 2 Vpost(t′ −δb)dt′ Vpost(t) = Vpre(t −δt) Then the overall synaptic modification is given by Z t Ac2(t)(c3(t) −θ)d1(t)dt 7 We fit A, τ, θ, and the bin size of integration. Recall that the sliding threshold, θ is a function of the expected firing rate of the neuron. Therefore we would not expect it to be a fixed constant. Instead, it should vary slowly over a time period much longer than the data sampling period. For the purpose of these experiments it would be at an unknown level that depends on the history of neural activity. See figure 2 for the fit for Mu-ming Poo’s synaptic modification data. Froemke and Dan also investigated higher order spike chains, and found that two spikes in short succession did not simply multiply in their effects. This would be the expected result if the spike timing dependence treated each pair in a triplet as an independent event. Instead, they found that a presynaptic spike followed by two postsynaptic spikes resulted in significantly less excitation than expected if the two pairs were treated as independent events. They posited that repeated spikes interacted suppressively, and fit a model based on that hypothesis. They performed two triplet experiments with pre- pre-post triplets, and pre-post-post triplets. Results of their experiment along with the predictions based on our model are presented in figure 3. Figure 3: Measured excitation and inhibition for spike triplets from Froemke and Dan are demarcated in circles and triangles. A red circle or triangle indicates excitation, while a blue circle or triangle indicates inhibition. The predicted results from our model are indicated by the background color. Numerical results for our model, with boundaries for the Froemke and Dan model are reproduced. Left figure is pairs of presynaptic spikes, and a single post-synaptic spike. The right figure is pairs of postsynaptic spikes, and a presynaptic spike. For each figure, t1 measures the time between the first paired spike with the singleton spike, with the convention that each t is positive if the presynaptic spike happens before the post synaptic spike. See paired STDP experiments for our spiking model. For the top figure, θ = .65, our bin width was 2ms, and our spike voltage decay rate τ = 8ms. For the right figure θ = .45. Red is excitatory, blue is inhibitory, white is no modification. A positive t indicates a presynaptic spike occurred before a postsynaptic spike. 7 Conclusion We introduced a modified formulation of the classical BCM neural update rule. This update rule drives the synaptic weights toward the components of a tensor decomposition of the input data. By further modifying the update to incorporate information from triplets of input data, this tensor decomposition can learn the mixture means for a broad class of mixture distributions. Unlike other methods to fit mixture models, we incorporate a multiview assumption that allows us to learn asymptotically exact mixture means, rather than local maxima of a similarity measure. This is in stark contrast to EM and other gradient ascent based methods, which have limited guarantees about the quality of their results. Conceptually our model suggests a different view of spike waves during adjacent time epochs: they provide multiple independent samples of the presynaptic “image.” Due to size constraints, this abstract has has skipped some details, particularly in the experimental sections. More detailed explanations will be provided in future publications. Research supported by NSF, NIH, The Paul Allen Foundation, and The Simons Foundation. 8 References [1] Animashree Anandkumar, Dean P Foster, Daniel Hsu, Sham M Kakade, and Yi-Kai Liu. Two svds suffice: Spectral decompositions for probabilistic topic modeling and latent dirichlet allocation. CoRR, abs/1204.6703, 1, 2012. [2] Animashree Anandkumar, Rong Ge, Daniel Hsu, Sham M Kakade, and Matus Telgarsky. Tensor decompositions for learning latent variable models. arXiv preprint arXiv:1210.7559, 2012. [3] 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. [4] Guo-Qiang Bi and Huai-Xing Wang. Temporal asymmetry in spike timing-dependent synaptic plasticity. Physiology & behavior, 77(4):551–555, 2002. [5] Elie L Bienenstock, Leon N Cooper, and Paul W Munro. Theory for the development of neuron selectivity: orientation specificity and binocular interaction in visual cortex. The Journal of Neuroscience, 2(1):32–48, 1982. [6] Natalia Caporale and Yang Dan. Spike timing-dependent plasticity: a hebbian learning rule. Annual Review Neuroscience, 31:25–46, 2008. [7] Bernard Delyon. General results on the convergence of stochastic algorithms. Automatic Control, IEEE Transactions on, 41(9):1245–1255, 1996. [8] Joseph L Doob. Stochastic processes, volume 101. New York Wiley, 1953. [9] Robert C Froemke and Yang Dan. Spike-timing-dependent synaptic modification induced by natural spike trains. Nature, 416(6879):433–438, 2002. [10] Julijana Gjorgjieva, Claudia Clopath, Juliette Audet, and Jean-Pascal Pfister. A triplet spike-timing–dependent plasticity model generalizes the bienenstock–cooper–munro rule to higher-order spatiotemporal correlations. Proceedings of the National Academy of Sciences, 108(48):19383–19388, 2011. [11] DO Hebb. The organization of behavior; a neuropsychological theory. 1949. [12] Nathan Intrator and Leon N Cooper. Objective function formulation of the bcm theory of visual cortical plasticity: Statistical connections, stability conditions. Neural Networks, 5(1):3–17, 1992. [13] Matthew Lawlor and Steven S. W. Zucker. An online algorithm for learning selectivity to mixture means. arXiv preprint, 2014. [14] Matthew Lawlor and Steven W Zucker. Third-order edge statistics: Contour continuation, curvature, and cortical connections. In Advances in Neural Information Processing Systems, pages 1763–1771, 2013. [15] WB Levy and O Steward. Temporal contiguity requirements for long-term associative potentiation/depression in the hippocampus. Neuroscience, 8(4):791–797, 1983. [16] Bernhard Nessler, Michael Pfeiffer, and Wolfgang Maass. Stdp enables spiking neurons to detect hidden causes of their inputs. In Advances in neural information processing systems, pages 1357–1365, 2009. [17] Jean-Pascal Pfister and Wulfram Gerstner. Triplets of spikes in a model of spike timingdependent plasticity. The Journal of neuroscience, 26(38):9673–9682, 2006. [18] Sen Song, Kenneth D Miller, and Larry F Abbott. Competitive hebbian learning through spiketiming-dependent synaptic plasticity. Nature neuroscience, 3(9):919–926, 2000. [19] Huai-Xing Wang, Richard C Gerkin, David W Nauen, and Guo-Qiang Bi. Coactivation and timing-dependent integration of synaptic potentiation and depression. Nature neuroscience, 8(2):187–193, 2005. 9
2014
364
5,474
Searching for Higgs Boson Decay Modes with Deep Learning Peter Sadowski Department of Computer Science University of California, Irvine Irvine, CA 92617 peter.j.sadowski@uci.edu Pierre Baldi Department of Computer Science University of California, Irvine Irvine, CA 92617 pfbaldi@ics.uci.edu Daniel Whiteson Department of Physics and Astronomy University of California, Irvine Irvine, CA 92617 Address daniel@uci.edu Abstract Particle colliders enable us to probe the fundamental nature of matter by observing exotic particles produced by high-energy collisions. Because the experimental measurements from these collisions are necessarily incomplete and imprecise, machine learning algorithms play a major role in the analysis of experimental data. The high-energy physics community typically relies on standardized machine learning software packages for this analysis, and devotes substantial effort towards improving statistical power by hand-crafting high-level features derived from the raw collider measurements. In this paper, we train artificial neural networks to detect the decay of the Higgs boson to tau leptons on a dataset of 82 million simulated collision events. We demonstrate that deep neural network architectures are particularly well-suited for this task with the ability to automatically discover high-level features from the data and increase discovery significance. 1 Introduction The Higgs boson was observed for the first time in 2011-2012 and will be the central object of study when the Large Hadron Collider (LHC) comes back online to collect new data in 2015. The observation of the Higgs boson in ZZ, γγ, and WW decay modes at the LHC confirms its role in electroweak symmetry-breaking [1, 2]. However, to establish that it also provides the interaction which gives mass to the fundamental fermions, it must be demonstrated that the Higgs boson couples to fermions through direct decay modes. Of the available modes, the most promising is the decay to a pair of tau leptons (τ), which balances a modest branching ratio with manageable backgrounds. From the measurements collected in 2011-2012, the LHC collaborations report data consistent with h →ττ decays, but without statistical power to cross the 5σ threshold, the standard for claims of discovery in high-energy physics. Machine learning plays a major role in processing data at particle colliders. This occurs at two levels: the online filtering of streaming detector measurements, and the offline analysis of data once it has been recorded [3], which is the focus of this work. Machine learning classifiers learn to distinguish between different types of collision events by training on simulated data from sophisticated MonteCarlo programs. Single-hidden-layer, shallow neural networks are one of the primary techniques used for this analysis, and standardized implementations are included in the prevalent multi-variate 1 g g H τ − τ + ντ νℓ ℓ+ ντ ℓ′− νℓ′ τ − τ + ντ νℓ ℓ+ ντ ℓ′− νℓ′ Z ¯q q Figure 1: Diagrams for the signal gg →h →ττ →ℓ−ννℓ+νν and the dominant background q¯q →Z →ττ →ℓ−ννℓ+νν. analysis software tools used by physicists. Efforts to increase statistical power tend to focus on developing new features for use with the existing machine learning classifiers — these high-level features are non-linear functions of the low-level measurements, derived using knowledge of the underlying physical processes. However, the abundance of labeled simulation training data and the complex underlying structure make this an ideal application for large, deep neural networks. In this work, we show how deep neural networks can simplify and improve the analysis of high-energy physics data by automatically learning high-level features from the data. We begin by describing the nature of the data and explaining the difference between the low-level and high-level features used by physicists. Then we demonstrate that deep neural networks increase the statistical power of this analysis even without the help of manually-derived high-level features. 2 Data Collisions of protons at the LHC annhiliate the proton constituents, quarks and gluons. In a small fraction of collisions, a new heavy state of matter is formed, such as a Higgs or Z boson. Such states are very unstable and decay rapidly and successively into lighter particles until stable particles are produced. In the case of Higgs boson production, the process is: gg →H →τ +τ − (1) followed by the subsequent decay of the τ leptons into lighter leptons (e and µ) and pairs of neutrinos (ν), see Fig. 1. The point of collision is surrounded by concentric layers of detectors that measure the momentum and direction of the final stable particles. The intermediate states are not observable, such that two different processes with the same set of final stable particles can be difficult to distinguish. For example, Figure 1 shows how the process q¯q →Z →τ +τ −yields the identical list of particles as a process that produces the Higgs boson. The primary approach to distinguish between two processes with identical final state particles is via the momentum and direction of the particles, which contain information about the identity of the intermediate state. With perfect measurement resolution and complete information of final state 2 [GeV] T Lepton 1 p 0 50 100 150 200 Fraction of Events 0 0.2 0.4 η Lepton 1 -4 -2 0 2 4 Fraction of Events 0 0.05 0.1 0.15 0.2 [GeV] T Lepton 2 p 0 50 100 150 200 Fraction of Events 0 0.2 0.4 η Lepton 2 -4 -2 0 2 4 Fraction of Events 0 0.05 0.1 0.15 0.2 N jets 0 1 2 3 4 Fraction of Events 0 0.2 0.4 0.6 0.8 Missing Trans. Mom [GeV] 0 50 100 150 200 Fraction of Events 0 0.05 0.1 0.15 0.2 Figure 2: Low-level input features from basic kinematic quantities in ℓℓ+ ̸pT events for simulated signal (black) and background (red) benchmark events. Shown are the distributions of transverse momenta (pT) of each observed particle as well as the imbalance of momentum in the final state. Momentum angular information for each observed particle is also available to the network, but is not shown, as the one-dimensional projections have little information. particles B and C, we could calculate the invariant mass of the short-lived intermediate state A in the process A →B + C, via: m2 A = m2 B+C = (EB + EC)2 −|(pB + pC)|2 (2) However, finite measurement resolution and escaping neutrinos (which are invisible to the detectors) make it impossible to calculate the intermediate state mass precisely. Instead, the momentum and direction of the final state particles are studied. This is done using simulated collisions from sophisticated Monte Carlo programs [4, 5, 6] that have been carefully tuned to provide highly faithful descriptions of the collider data. Machine learning classifiers are trained on the simulated data to recognize small differences in these processes, then the trained classifiers are used to analyze the experimental data. 2.1 Low-level features There are ten low-level features that comprise the essential measurements provided by the detectors: • The three-dimensional momenta, p, of the charged leptons; • The imbalance of momentum (̸pT ) in the final state transverse to the beam direction, due to unobserved or mismeasured particles; • The number and momenta of particle ‘jets’ due to radiation of gluons or quarks. Distributions of these features are given in Fig. 2. 2.2 High-level features There is a vigorous effort in the physics community to construct non-linear combinations of these low-level features that improve discrimination between Higgs-boson production and Z-boson production. High-level features that have been considered include: • Axial missing momentum, ̸pT · pℓ+ℓ−; 3 • Scalar sum of the observed momenta, |pℓ+| + |pℓ−| + |̸pT | + P i |pjeti|; • Relative missing momentum, ̸pT if ∆φ(p, ̸pT ) ≥π/2, and ̸pT × sin(∆φ(p, ̸pT ) if ∆φ(p, ̸pT ) < π/2, where p is the momentum of any charged lepton or jet; • Difference in lepton azimuthal angles, ∆φ(ℓ+, ℓ−); • Difference in lepton polar angles, ∆η(ℓ+, ℓ−); • Angular distance between leptons, ∆R = p (∆η)2 + (∆φ)2; • Invariant mass of the two leptons, mℓ+ℓ−; • Missing mass, mMMC [7]; • Sphericity and transverse sphericity; • Invariant mass of all visible objects (leptons and jets). Distributions of these features are given in Fig. 3. 3 Methods 3.1 Current approach Standard machine learning techniques in high-energy physics include methods such as boosted decision trees and single-layer feed-forward neural networks. The TMVA package [8] contains a standardized implementation of these techniques that is widely-used by physicists. However, we have found that our own hyperparameter-optimized, single-layer neural networks perform better than the TMVA implementations. Therefore, we use our own hyperparameter-optimized shallow neural networks trained on fast graphics processors as a benchmark for comparison. 3.2 Deep learning Deep neural networks can automatically learn a complex hierarchy of non-linear features from data. Training deep networks often requires additional computation and a careful selection of hyperparameters, but these difficulties have diminished substantially with the advent of inexpensive graphics processing hardware. We demonstrate here that deep neural networks provide a practical tool for learning deep feature hierarchies and improving classifier accuracy while reducing the need for physicists to carefully derive new features by hand. Many exploratory experiments were carried with different architectures, training protocols, and hyperparameter optimization strategies. Some of these experiments are still ongoing and, for conciseness, we report only the main results obtained so far. 3.3 Hyperparameter optimization Hyperparameters were optimized separately for shallow and deep neural networks. Shallow network hyperparameters were chosen from combinations of the parameters listed in Table 1, while deep network hyperparameters were chosen from combinations of those listed in Table 2. These were selected based on classification performance (cross-entropy error) on the validation set, using the full set of available features: 10 low-level features plus 15 high-level features. The best architectures were the largest ones: a deep network with 300 hidden units in each of five hidden layers and an initial learning rate of 0.03, and a shallow network with 15000 hidden units and an initial learning rate of 0.01. These neural networks have approximately the same number of tunable parameters, with 369,301 parameters in the deep network and 405,001 parameters in the shallow network. Table 1: Hyperparameter options for shallow networks. Hyperparameter Options Hidden units 100, 300, 1000, 15000 Initial learning rate 0.03, 0.01, 0.003, 0.001 4 Axial MET -100 -50 0 50 100 Fraction of Events 0 0.05 0.1 0.15 0.2 Sum PT 0 100 200 300 400 500 Fraction of Events 0 0.1 0.2 0.3 MET_rel 0 20 40 60 80 100 Fraction of Events 0 0.05 0.1 0.15 0.2 (ll) η ∆ -2 0 2 Fraction of Events 0 0.05 0.1 0.15 0.2 R(ll) ∆ 0 1 2 3 4 Fraction of Events 0 0.1 0.2 0.3 0.4 ll m 0 50 100 150 Fraction of Events 0 0.1 0.2 0.3 l2 /Pt l1 Pt 0 1 2 3 Fraction of Events 0 0.05 0.1 0.15 0.2 all T P 0 50 100 150 Fraction of Events 0 0.05 0.1 0.15 0.2 Spher 0 0.2 0.4 0.6 0.8 1 Fraction of Events 0 0.05 0.1 0.15 0.2 T Spher 0 0.2 0.4 0.6 0.8 1 Fraction of Events 0 0.2 0.4 0.6 0.8 MMC 0 100 200 300 Fraction of Events 0 0.05 0.1 0.15 0.2 vis m 0 100 200 300 Fraction of Events 0 0.05 0.1 0.15 0.2 (l,l) φ ∆ -4 -2 0 2 4 Fraction of Events 0 0.1 0.2 Figure 3: Distribution of high-level input features from invariant mass calculations in ℓνjjb¯b events for simulated signal (black) and background (red) events. 3.4 Training details The problem is a basic classification task with two classes. The data set is balanced and contains 82 million examples. A validation set of 1 million examples was randomly set aside for tuning the hyperparameters. Different cross validation strategies were used with little influence on the results reported since these are obtained in a regime far away from overfitting. 5 Table 2: Hyperparameter options for deep networks. Hyperparameter Options Number of layers 3,4,5,6 Hidden units per layer 100, 300 Initial learning rate 0.03, 0.01, 0.003 The following neural network hyperparameters were predetermined without optimization. The tanh activation function was used for all hidden units, while the the logistic function was used for the output. Weights were initialized from a normal distribution with zero mean and standard deviation 0.1 in the first layer, 0.001 in the output layer, and 1 √ k for all other hidden layers, where k was the number of units in the previous layer. Gradient computations were made on mini-batches of size 100. A momentum term increased linearly over the first 25 epochs from 0.5 to 0.99, then remained constant. The learning rate decayed by a factor of 1.0000002 every batch update until it reached a minimum of 10−6. All networks were trained for 50 epochs. Computations were performed using machines with 16 Intel Xeon cores, an NVIDIA Tesla C2070 graphics processor, and 64 GB memory. Training was performed using the Theano and Pylearn2 software libraries [9, 10]. 4 Results The performance of each neural network architecture in terms of the Area Under the signal-rejection Curve (AUC) is shown in Table 3. As expected, the shallow neural networks (one hidden layer) perform better with the high-level features than the low-level features alone; the high-level features were specifically designed to discriminate between the two hypotheses. However, this difference disappears in deep neural networks, and in fact performance is better with the 10 low-level features than with the 15 high-level features alone. This, along with the fact that the complete set of features always performs best, suggests that there is information in the low-level measurements that is not captured by the high-level features, and that the deep networks are exploiting this information. Table 3: Comparison of performance for neural network architectures: shallow neural networks (NN), and deep neural networks (DN) with different numbers of hidden units and layers. Each network architecture was trained on three sets of input features: low-level features, high-level features, and the complete set of features. The table displays the test set AUC and the expected significance of a discovery (in units of Gaussian σ) for 100 signal events and 5000 background events with a 5% relative uncertainty. AUC Technique Low-level High-level Complete NN 300 0.788 0.792 0.798 NN 1000 0.788 0.792 0.798 NN 15000 0.788 0.792 0.798 DN 3-layer 0.796 0.794 0.801 DN 4-layer 0.797 0.797 0.802 DN 5-layer 0.798 0.798 0.803 DN 6-layer 0.799 0.797 0.803 Discovery significance Technique Low-level High-level Complete NN 15000 1.7σ 2.0σ 2.0σ DN 6-layer 2.1σ 2.2σ 2.2σ The best networks are trained with the complete set of features, which provides both the raw measurements and the physicist’s domain knowledge. Figure 4 plots the empirical distribution of predictions (neural network output) for the test samples from each class, and shows how both the shallow and deep networks trained on the complete feature set are more confident about their correct predictions. 6 0.0 0.2 0.4 0.6 0.8 1.0 Prediction NN lo-level NN hi-level NN lo+hi-level 0.0 0.2 0.4 0.6 0.8 1.0 Prediction DN lo-level DN hi-level DN lo+hi-level Figure 4: Empirical distribution of predictions for signal events (solid) and background events (dashed) from the test set. Figure 5 shows how the AUC translates into discovery significance [11]. On this metric too, the sixlayer deep network trained on the low-level features outperforms the best shallow network (15000 hidden units) trained with the best feature set. 5 Discussion While deep learning has led to significant advances in computer vision, speech, and natural language processing, it is clearly useful for a wide range of applications, including a host of applications in the natural sciences. The problems in high-energy physics are particularly suitable for deep learning, having large data sets with complex underlying structure. Our results show that deep neural networks provide a powerful and practical approach to analyzing particle collider data, and that the high-level features learned from the data by deep neural networks increase the statistical power more than the common high-level features handcrafted by the physicists. While the improvements may seem small, they are very significant, especially when considering the billion-dollar cost of accelerator experiments. These preliminary experiments demonstrate the advantages of deep neural networks, but we have not yet pushed the limits of what deep learning can do for this application. The deep architectures in this work have less than 500,000 parameters and have not even begun to overfit the training data. 7 0.0 0.5 1.0 1.5 2.0 2.5 Discovery significance (¾) Shallow networks Deep networks raw inputs human-assisted all inputs raw inputs human-assisted all inputs Figure 5: Comparison of discovery significance for the traditional learning method (left) and the deep learning method (right) using the low-level features, the high-level features, and the complete set of features. Experiments with larger architectures, including ensembles, with a variety of shapes and neuron types, are currently in progress. Since the high-level features are derived from the low-level features, it is interesting to note that one could train a regression neural network to learn this relationship. Such a network would then be able to predict the physicist-derived features from the low-level measurements. Some of these high-level features may be more difficult to compute than others, requiring neural networks of a particular size and depth, and it would be interesting to analyze the complexity of the high-level features in this way. We are in the process of training such regression networks which could then be incorporated into a larger prediction architecture, either by freezing their weights, or by allowing them to learn further. In combination, these deep learning approaches should yield a system ready to sift through the new Large Hadron Collider data in 2015. References [1] Aad, G., Abajyan, T., et al. A particle consistent with the higgs boson observed with the ATLAS detector at the large hadron collider. Science, 338(6114):1576–1582, December 2012. ISSN 0036-8075, 1095-9203. doi:10.1126/science.1232005. PMID: 23258888. [2] Abbaneo, D., Abbiendi, G., et al. A new boson with a mass of 125 GeV observed with the CMS experiment at the large hadron collider. Science, 338(6114):1569–1575, December 2012. ISSN 0036-8075, 1095-9203. doi:10.1126/science.1230816. PMID: 23258887. [3] Denby, B. Neural networks in high energy physics: A ten year perspective. Computer Physics Communications, 119(23):219–231, June 1999. ISSN 0010-4655. doi:10.1016/ S0010-4655(98)00199-4. [4] Alwall, J. et al. MadGraph 5 : Going Beyond. JHEP, 1106:128, 2011. doi:10.1007/ JHEP06(2011)128. [5] Sjostrand, T. et al. PYTHIA 6.4 physics and manual. JHEP, 05:026, 2006. [6] Ovyn, S., Rouby, X., et al. DELPHES, a framework for fast simulation of a generic collider experiment. 2009. [7] Elagin, A., Murat, P., et al. A New Mass Reconstruction Technique for Resonances Decaying to di-tau. Nucl.Instrum.Meth., A654:481–489, 2011. doi:10.1016/j.nima.2011.07.009. [8] Hocker, A. et al. TMVA - Toolkit for Multivariate Data Analysis. PoS, ACAT:040, 2007. [9] Bergstra, J., Breuleux, O., et al. Theano: a CPU and GPU math expression compiler. In Proceedings of the Python for Scientific Computing Conference (SciPy). Austin, TX, June 2010. Oral Presentation. 8 [10] Goodfellow, I. J., Warde-Farley, D., et al. Pylearn2: a machine learning research library. arXiv e-print 1308.4214, August 2013. [11] Cowan, G., Cranmer, K., et al. Asymptotic formulae for likelihood-based tests of new physics. Eur.Phys.J., C71:1554, 2011. doi:10.1140/epjc/s10052-011-1554-0. 9
2014
365
5,475
Decoupled Variational Gaussian Inference Mohammad Emtiyaz Khan Ecole Polytechnique F´ed´erale de Lausanne (EPFL), Switzerland emtiyaz@gmail.com Abstract Variational Gaussian (VG) inference methods that optimize a lower bound to the marginal likelihood are a popular approach for Bayesian inference. A difficulty remains in computation of the lower bound when the latent dimensionality L is large. Even though the lower bound is concave for many models, its computation requires optimization over O(L2) variational parameters. Efficient reparameterization schemes can reduce the number of parameters, but give inaccurate solutions or destroy concavity leading to slow convergence. We propose decoupled variational inference that brings the best of both worlds together. First, it maximizes a Lagrangian of the lower bound reducing the number of parameters to O(N), where N is the number of data examples. The reparameterization obtained is unique and recovers maxima of the lower-bound even when it is not concave. Second, our method maximizes the lower bound using a sequence of convex problems, each of which is parallellizable over data examples. Each gradient computation reduces to prediction in a pseudo linear regression model, thereby avoiding all direct computations of the covariance and only requiring its linear projections. Theoretically, our method converges at the same rate as existing methods in the case of concave lower bounds, while remaining convergent at a reasonable rate for the non-concave case. 1 Introduction Large-scale Bayesian inference remains intractable for many models, such as logistic regression, sparse linear models, or dynamical systems with non-Gaussian observations. Approximate Bayesian inference requires fast, robust, and reliable algorithms. In this context, algorithms based on variational Gaussian (VG) approximations are growing in popularity [17, 3, 13, 6] since they strike a favorable balance between accuracy, generality, speed, and ease of use. VG inference remains problematic for models with large latent-dimensionality. While some variants are convex [3], they require O(L2) variational parameters to be optimized, where L is the latent-dimensionality. This slows down the optimization. One solution is to restrict the covariance representations by naive mean-field [2] or restricted Cholesky [3], but this can result in considerable loss of accuracy when significant posterior correlations exist. An alternative is to reparameterize the covariance to obtain O(N) number of parameters, where N is the number of data examples [17]. However, this destroys the convexity and converges slowly [12]. A recent approach called dual variational inference [10] obtains fast convergence while retaining this parameterization, but is applicable to only some models such as Poisson regression. In this paper, we propose an approach called decoupled variational Gaussian inference which extends the dual variational inference to a large class of models. Our method relies on the theory of Lagrangian multiplier methods. While remaining widely applicable, our approach reduces the number of variational parameters similar to [17, 10] and converges at similar convergence rates as convex methods such as [3]. Our method is similar in spirit to parallel expectation-propagation (EP) but has provable convergence guarantees even when likelihoods are not log-concave. 1 2 The Model In this paper, we apply our method for Bayesian inference on Latent Gaussian Models (LGMs). This choice is motivated by a large amount of existing work on VG approximations for LGMs [16, 17, 3, 10, 12, 11, 7, 2], and because LGMs include many popular models, such as Gaussian processes, Bayesian regression and classification, Gaussian Markov random field, and probabilistic PCA. An extensive list of these models is given in Chapter 1 of [9]. We have also included few examples in the supplementary material. Given a vector of observations y of length N, LGMs model the dependencies among its components using a latent Gaussian vector z of length L. The joint distribution is shown below. p(y, z) = N Y n=1 pn(yn|ηn)p(z), η = Wz, p(z) := N(z|µ, Σ) (1) where W is a known real-valued matrix of size N × L, and is used to define linear predictors η. Each ηn is used to model the observation yn using a link function pn(yn|ηn). The exact form of this function depends on the type of observations, e.g. a Bernoulli-logit distribution can be used for binary data [14, 7]. See the supplementary material for an example. Usually, an exponential family distribution is used, although there are other choices (such as T-distribution [8, 17]). The parameter set θ includes {W, µ, Σ} and other parameters of the link function and is assumed to be known. We suppress θ in our notation, for simplicity. In Bayesian inference, we wish to compute expectations with respect to the posterior distribution p(z|y) which is shown below. Another important task is the computation of the marginal likelihood p(y) which can be maximized to estimate parameters θ, for example, using empirical Bayes [18]. p(z|y) ∝ N Y n=1 p(yn|ηn)N(z|µ, Σ) , p(y) = Z N Y n=1 p(yn|ηn)N(z|µ, Σ) dz (2) For non-Gaussian likelihoods, both of these tasks are intractable. Applications in practice demand good approximations that scale favorably in N and L. 3 VG Inference by Lower Bound Maximization In variational Gaussian (VG) inference [17], we assume the posterior to be a Gaussian q(z) = N(z|m, V). The posterior mean m and covariance V form the set of variational parameters, and are chosen to maximize the variational lower bound to the log marginal likelihood shown in Eq. (3). To get this lower bound, we first multiply and divide by q(z) and then apply Jensen’s inequality using the concavity of log. log p(y) = log Z q(z) Q n p(yn|ηn)p(z) q(z) dz ≥Eq(z)  log Q n p(yn|ηn)p(z) q(z)  (3) The simplified lower bound is shown in Eq. (4). The detailed derivation can be found in Eqs. (4)–(7) in [11] (and in the supplementary material). Below, we provide a summary of its components. max m,V≻0 −D[q(z) ∥p(z)] − N X n=1 fn( ¯mn, ¯σn), fn( ¯mn, ¯σn) := EN (ηn| ¯mn,¯σ2n)[−log p(yn|ηn)] (4) The first term is the KL-divergence D[q ∥p] = Eq[log q(z) −log p(z)], which is jointly concave in (m, V). The second term sums over data examples, where each term denoted by fn is the expectation of −log p(yn|ηn) with respect to ηn. Since ηn = wT nz, it follows a Gaussian distribution q(ηn) = N( ¯mn, ¯σ2 n) with mean ¯mn = wT nm and variances ¯σ2 n = wT nVwn. The terms fn are not always available in closed form, but can be computed using quadrature or look-up tables [14]. Note that unlike many other methods such [2, 11, 10, 7, 21], we do not bound or approximate these terms. Such approximations lead to loss of accuracy. We denote the lower bound of Eq. (3) by f and expand it below in Eq. (5): f(m, V) := 1 2[log |V| −Tr(VΣ−1) −(m −µ)T Σ−1(m −µ) + L] − N X n=1 fn( ¯mn, ¯σn) (5) Here |V| denotes the determinant of V. We now discuss existing methods and their pros and cons. 2 3.1 Related Work A straight-forward approach is to optimize Eq. (5) directly in (m, V) [2, 3, 14, 11]. In practice, direct methods are slow and memory-intensive because of the very large number L + L(L + 1)/2 of variables. Challis and Barber [3] show that for log-concave likelihoods p(yn|ηn), the original problem Eq. (4) is jointly concave in m and the Cholesky factor of V. This fact, however, does not result in any reduction in the number of parameters, and they propose to use factorizations of a restricted form, which negatively affects the approximation accuracy. [17] and [16] note that the optimal V∗must be of the form V∗= [Σ−1 +WT diag(λ)W]−1, which suggests reparameterizing Eq. (5) in terms of L+N parameters (m, λ), where λ is the new variable. However, the problem is not concave in this alternative parameterization [12]. Moreover, as shown in [12] and [10], convergence can be exceedingly slow. The coordinate-ascent approach of [12] and dual variational inference [10] both speed-up convergence, but only for a limited class of models. A range of different deterministic inference approximations exist as well. The local variational method is convex for log-concave potentials and can be solved at very large scales [23], but applies only to models with super-Gaussian likelihoods. The bound it maximizes is provably less tight than Eq. (4) [22, 3] making it less accurate. Expectation propagation (EP) [15, 21] is more general and can be more accurate than most other approximations mentioned here. However, it is based on a saddle-point rather than an optimization problem, and the standard EP algorithm does not always converge and can be numerically unstable. Among these alternatives, the variational Gaussian approximation stands out as a compromise between accuracy and good algorithmic properties. 4 Decoupled Variational Gaussian Inference using a Lagrangian We simplify the form of the objective function by decoupling the KL divergence term from the terms including fn. In other words, we separate the prior distribution from the likelihoods. We do so by introducing real-valued auxiliary-variables hn and σn > 0, such that the following constraints hold: hn = ¯mn and σn = ¯σn. This gives us the following (equivalent) optimization problem over x := {m, V, h, σ}, max x g(x) := 1 2  log |V| −Tr(VΣ−1) −(m −µ)T Σ−1(m −µ) + L  − N X n=1 fn(hn, σn) (6) subject to constraints c1 n(x) := hn −wT nm = 0 and c2 n(x) := 1 2(σ2 n −wT nVwn) = 0 for all n. For log-concave likelihoods, the function g(x) is concave in V, unlike the original function f (see Eq. (5)) which is concave with respect to Cholesky of V. The difficulty now lies with the nonlinear constraints c2 n(x). We will now establish that the new problem gives rise to a convenient parameterization, but does not affect the maximum. The significance of this reformulation lies in its Lagrangian, shown below. L(x, α, λ) := g(x) + N X n=1 αn(hn −wT nm) + 1 2λn(σ2 n −wT nVwn) (7) Here, αn, λn are Lagrangian multipliers for the constraints c1 n(x) and c2(x). We will now show that the maximum of f of Eq. (5) can be parameterized in terms of these multipliers, and that this reparameterization is unique. The following theorem states this result along with three other useful relationships between the maximum of Eq. (5), (6), and (7). Proof is in the supplementary material. Theorem 4.1. The following holds for maxima of Eq. (5), (6), and (7): 1. A stationary point x∗of Eq. (6) will also be a stationary point of Eq. (5). For every such stationary point x∗, there exist unique α∗and λ∗such that, V∗= [Σ−1 + WT diag(λ∗)W]−1, m∗= µ −ΣWT α∗ (8) 2. The α∗ n and λ∗ n depend on the gradient of function fn and satisfy the following conditions, ▽hn fn(h∗ n, σ∗ n) = α∗ n, ▽σnfn(h∗ n, σ∗ n) = σ∗ nλ∗ n (9) 3 where h∗ n = wT nm∗and (σ∗ n)2 = wT nV∗wn for all n and ▽xf(x∗) denotes the gradient of f(x) with respect to x at x = x∗. 3. When {m∗, V∗} is a local maximizer of Eq. (5), then the set {m∗, V∗, h∗, σ∗, α∗, λ∗} is a strict maximizer of Eq. (7). 4. When likelihoods p(yn|ηn) are log-concave, there is only one global maximum of f, and any {m∗, V∗} obtained by maximizing Eq. (7) will be the global maximizer of Eq. (5). Part 1 establishes the parameterization of (m∗, V∗) by (α∗, λ∗) and its uniqueness, while part 2 shows the conditions that (α∗, λ∗) satisfy. This form has also been used in [12] for Gaussian Processes where a fixed-point iteration was employed to search for λ∗. Part 3 shows that such parameterization can be obtained at maxima of the Lagrangian rather than minima or saddle-points. The final part considers the case when f is concave and shows that the global maximum can be obtained by maximizing the Lagrangian. Note that concavity of the lower bound is required for the last part only and the other three parts are true irrespective of concavity. Detailed proof of the theorem is given in the supplementary material. Note that the conditions of Eq. (9) restrict the values that α∗ n and λ∗ n can take. Their values will be valid only in the range of the gradients of fn. This is unlike the formulation of [17] which does not constrain these variables, but is similar to the method of [10]. We will see later that our algorithm makes the problem infeasible for values outside this range. Ranges of these variables vary depending on the likelihood p(yn|ηn). However, we show below in Eq. (10) that λ∗ n is always strictly positive for log-concave likelihoods. The first equality is obtained using Eq. (9), while the second equality is simply change of variables from σn to σ2 n. The third equality is obtained using Eq. (19) from [17]. The final inequality is obtained since fn is convex for all log-concave likelihoods (▽xxf(x) denotes the Hessian of f(x)). λ∗ n = σ∗ n −1 ▽σn fn(h∗ n, σ∗ n) = 2 ▽σ2n fn(h∗ n, σ∗ n) = ▽2 hnhnfn(h∗ n, σ∗ n) > 0 (10) 5 Optimization Algorithms for Decoupled Variational Gaussian Inference Theorem 4.1 suggests that the optimal solution can be obtained by maximizing g(x) or the Lagrangian L. The maximization is difficult for two reasons. First, the constraints c2 n(x) are non-linear and second the function g(x) may not always be concave. Note that it is not easy to apply the augmented Lagrangian method or first-order methods (see Chapter 4 of [1]) because their application would require storage of V. Instead, we use a method based on linearization of the constraints which will avoid explicit computation and storage of V. First, we will show that when g(x) is concave, we can maximize it by minimizing a sequence of convex problems. We will then solve each convex problem using the dual-variational method of [10]. 5.1 Linearly Constrained Lagrangian (LCL) Method We now derive an algorithm based on the linearly constrained Lagrangian (LCL) method [19]. The LCL approach involves linearization of the non-linear constraints and is an effective method for large-scale optimization, e.g. in packages such as MINOS [24]. There are variants of this method that are globally convergent and robust [4], but we use the variant described in Chapter 17 of [24]. The final algorithm: See Algorithm 1. We start with a α, λ and σ. At every iteration k, we minimize the following dual: min α,λ∈S −1 2 log |Σ−1 + WT diag(λ)W| + 1 2αT eΣα −eµT α + N X n=1 f k∗ n (αn, λn) (11) Here, eΣ = WΣWT and eµ = Wµ. The functions f k∗ n are obtained as follows: f k∗ n (αn, λn) := max hn,σn>0 −fn(hn, σn) + αnhn + 1 2λnσk n(2σn −σk n) −1 2λk n(σn −σk n)2 (12) where λk n and σk n were obtained at the previous iteration. 4 Algorithm 1 Linearly constrained Lagrangian (LCL) method for VG approximation Initialize α, λ ∈S and σ ≻0. for k = 1, 2, 3, . . . do λk ←λ and σk ←σ. repeat For all n, compute predictive mean ˆm∗ n and variances ˆv∗ n using linear regression (Eq. (13)) For all n, in parallel, compute (h∗ n, σ∗ n) that maximizes Eq. (12). Find next (α, λ) ∈S using gradients gα n = h∗ n −ˆm∗ n and gλ n = 1 2[−(σk n)2 + 2σk nσn −ˆv∗ n]. until convergence end for The constraint set S is a box constraints on αn and λn such that a global minimum of Eq. (12) exists. We will show some examples later in this section. Efficient gradient computation: An advantage of this approach is that the gradient at each iteration can be computed efficiently, especially for large N and L. The gradient computation is decoupled into two terms. The first term can be computed by computing f k∗ n in parallel, while the second term involves prediction in a linear model. The gradients with respect to αn and λn (derived in the supplementary material) are given as gα n := h∗ n −ˆm∗ n and gλ n := 1 2[−(σk n)2 + 2σk nσ∗ n −ˆv∗ n], where (h∗ n, σ∗ n) are maximizers of Eq. (12) and ˆv∗ n and ˆm∗ n are computed as follows: ˆv∗ n := wT nV∗ nwn = wT n(Σ−1 + WT diag(λ)W)−1wn = eΣnn −eΣn,:(eΣ + diag(λ)−1)−1 eΣn,: ˆm∗ n := wT nm∗ n = wT n(µ −ΣWT α) = eµn −eΣn,:α (13) The quantities (h∗ n, σ∗ n) can be computed in parallel over all n. Sometimes, this can be done in closed form (as we shown in the next section), otherwise we can compute them by numerically optimizing over two-dimensional functions. Since these problems are only two-dimensional, a Newton method can be easily implemented to obtain fast convergence. The other two terms ˆv∗ n and ˆm∗ n can be interpreted as predictive means and variances of a pseudo linear model, e.g. compare Eq. (13) with Eq. 2.25 and 2.26 of Rasmussen’s book [18]. Hence every gradient computation can be expressed as Bayesian prediction in a linear model for which we can use existing implementation. For example, for binary or multi-class GP classification, we can reuse efficient implementation of GP regression. In general, we can use a Bayesian inference in a conjuate model to compute the gradient of a non-conjugate model. This way the method also avoids forming V∗and work only with its linear projections which can be efficiently computed using vector-matrix-vector products. The “decoupling” nature of our algorithm should now be clear. The non-linear computations depending on the data, are done in parallel to compute h∗ n and σ∗ n. These are completely decoupled from linear computations for ˆmn and ˆvn. This is summarized in Algorithm (1). Derivation: To derive the algorithm, we first linearize the constraints. Given multiplier λk and a point xk at the k’th iteration, we linearize the constraints c2 n(x): ¯c2 nk(x) := c2 n(xk) + ▽c2 n(xk)T (x −xk) (14) = 1 2[(σk n)2 −wT nVkwn + 2σk n(σn −σk n) −(wT nVwn −wT nVkwn)] (15) = −1 2[(σk n)2 −2σk nσn + wT nVwn] (16) Since we want the linearized constraint ¯c2 nk(x) to be close to the original constraint c2 n(x), we will penalize the difference between the two. c2 n(x) −¯c2 nk(x) = 1 2{σ2 n −wT nVwn −[−(σk n)2 + 2σk nσn −wT nVwn]} = 1 2(σn −σk n)2 (17) The key point is that this term is independent of V, allowing us to obtain a closed-form solution for V∗. This will also be crucial for the extension to non-concave case in the next section. 5 The new k’th subproblem is defined with the linearized constraints and the penalization term: max x gk(x) := g(x) − N X n=1 1 2λk n(σn −σk n)2 (18) s.t. hn −wT nmn = 0 , −1 2[(σk n)2 −2σk nσn + wT nVwn] = 0, ∀n This is a concave problem with linear constraints and can be optimized using dual variational inference [10]. Detailed derivation is given in the supplementary material. Convergence: When LCL algorithm converges, it has quadratic convergence rates [19]. However, it may not always converge. Globally convergent methods do exist (e.g. [4]) although we do not explore them in this paper. Below, we present a simple approach that improves the convergence for non log-concave likelihoods. Augmented Lagrangian Methods for non log-concave likelihoods: When the likelihood p(yn|ηn) are not log-concave, the lower bound can contain local minimum, making the optimization difficult for function f(m, V). In such scenarios, the algorithm may not converge for all starting values. The convergence of our approach can be improved for such cases. We simply add an augmented Lagrangian term [¯c2 nk(x)]2 to the linearly constrained Lagrangian defined in Eq. (18), as shown below [24]. Here, δk i > 0 and i is the i’th iteration of k’th subproblem: gk aug(x) := g(x) − N X n=1 1 2λk n(σn −σk n)2 + 1 2δk i (σn −σk n)4 (19) subject to the same constraints as Eq. (18). The sequence δk i can either be set to a constant or be increased slowly to ensure convergence to a local maximum. More details on setting this sequence and its affect on the convergence can be found in Chapter 4.2 of [1]. It is in fact possible to know the value of δk i such that the algorithm always converge. This value can be set by examining the primal function - a function with respect to the deviations in constraints. It turns out that it should be set larger than the largest eigenvalues of the Hessian of the primal function at 0. A good discussion of this can be found in Chapter 4.2 of [1]. The fact that that the linearized constraint ¯c2 nk(x) does not depend on V is very useful here since addition of this term then only affects computation of f k∗ n . We modify the algorithm by simply changing the computation to optimization of the following function: max hn,σn>0 −fn(hn, σn) + αnhn + 1 2λnσk n(2σn −σk n) −1 2λk n(σn −σk n)2 −δk i 2 (σn −σk n)4 (20) It is clear from this that the augmented Lagrangian term is trying to “convexify” the non-convex function fn, leading to improved convergence. Computation of f k∗ n (α,λn) These functions are obtained by solving the optimization problem shown in Eq. (12). In some cases, we can compute these functions in closed form. For example, as shown in the supplementary material, we can compute h∗and σ∗in closed form for Poisson likelihood as shown below. We also show the range of αn and λn for which f k∗ n is finite. σ∗ n = λn + λk n yn + αn + λkn σk n, h∗ n = −1 2σ∗2 n + log(yn + αn), S = {αn > −yn, λn > 0, ∀n} (21) An expression for Laplace likelihood is also derived in the supplementary material. When we do not have a closed-form expression for f k∗ n , we can use a 2-D Newton method for optimization. To facilitate convergence, we must warm-start the optimization. When fn is concave, this usually converges in few iterations, and since we can parallelize over n, a significant speed-up can be obtained. A significant engineering effort is required for parallelization and for our experiments in this paper, we have not done so. An issue that remains open is the evaluation of the range S for which each f k∗ n is finite. For now, we have simply set it to the range of gradients of function fn as shown by Eq. 9 (also see the last paragraph in that section). It is not clear whether this will always assure convergence for the 2-D optimization. Prediction: Given α∗and λ∗, we can compute the predictions by using equations similar to GP regression. See details in Rasmussen’s book [18]. 6 6 Results We demonstrate the advantages of our approach on a binary GP classification problem. We model the binary data using Bernoulli-logit likelihoods. Function fn are computed to a reasonable accuracy using the piecewise bound [14] with 20 pieces. We apply this model to a subproblem of the USPS digit data [18]. Here, the task is to classify between 3’s vs. 5’s. There are a total of 1540 data examples with feature dimensionality of 256. Since we want to compare the convergence, we will show results for different data sizes by subsampling randomly from these examples. We set µ = 0 and use a squared-exponential kernel, for which the (i, j)th entry of Σ is defined as: Σij = −σ2 exp[−1 2||xi −xj||2/s] where xi is i’th feature. We show results for log(σ) = 4 and log(s) = −1 which corresponds to a difficult case where VG approximations converge slowly (due to the ill-conditioning of the Kernel) [18]. Our conclusions hold for other parameter settings as well. We compare our algorithm with the approach of Opper and Archambeau [17] and Challis and Barber [3]. We refer to them as ‘Opper’ and ‘Cholesky’, respectively. We call our approach ‘Decoupled’. For all methods, we use L-BFGS method for optimization (implemented in minFunc by Mark Schmidt), since a Newton method would be too expensive for large N. All algorithms were stopped when the subsequent changes in the lower bound value of Eq. 5 were less than 10−4. All methods were randomly initialized. Our results are not sensitive to initialization. We compare convergence in terms of the value of lower bound. The prediction errors show very similar trend, therefore we do not present them. The results are summarized in Figure 1. Each plot shows the negative of the lower bound vs time in seconds for increasing data sizes N = 200, 500, 1000 and 1500. For Opper and Cholesky, we show markers for every iteration. For decoupled, we show markers after completion of each subproblem. We can not see the result of first subproblem here, and the first visible marker is obtained from the second subproblem onwards. We see that as the data size increases, Decoupled converges faster than the other methods, showing a clear advantage over other methods for large dimensionality. 7 Discussion and Future Work In this paper, we proposed the decoupled VG inference method for approximate Bayesian inference. We obtain efficient reparameterization using a Lagrangian to the lower bound. We showed that such a parameterization is unique, even for non log-concave likelihood functions, and the maximum of the lower bound can be obtained by maximizing the Lagrangian. For concave likelihood function, our method recovers the global maximum. We proposed a linearly constrained Lagrangian method to maximize the Lagrangian. The algorithm has the desired property that it reduces each gradient computation to a linear model computation, while parallelizing non-linear computations over data examples. Our proposed algorithm is capable of attaining convergence rates similar to convex methods. Unlike methods such as mean-field approximation, our method preserves all posterior correlations and can be useful towards generalizing stochastic variational inference (SVI) methods [5] to nonconjugate models. Existing SVI methods rely on mean-field approximations and are widely applied for conjugate models. Under our method, we can stochastically include only few constraints to maximize the Lagrangian. This amounts to a low-rank approximation of the covariance matrix and can be used to construct an unbiased estimate of the gradient. We have focused only on latent Gaussian models for simplicity. It is easy to extend our approach to other non-Gaussian latent models, e.g. sparse Bayesian linear model [21] and Bayesian nonnegative matrix factorization [20]. Similar decoupling method can also be applied to general latent variable models. Note that a choice of proper posterior distribution is required to get an efficient parameterization of the posterior. It is also possible to get sparse posterior covariance approximation using our decoupled formulation. One possible idea is to use Hinge type of loss to approximate the likelihood terms. Using the dualization similar to what we have shown here would give us a sparse posterior covariance. 7 0.2 0.3 0.4 0.5 1 525 535 545 N = 200 Time in seconds Negative Lower Bound 10 0 10 1 1360 1380 1400 1420 1440 1460 1480 1500 N = 500 Time in seconds Negative Lower Bound 20 30 40 50 100 150 200 2760 2780 2800 2820 2840 N = 1000 Time in seconds Negative Lower Bound 50 100 150 200 300 400 500 4230 4240 4250 4260 4270 4280 N = 1500 Time in seconds Negative Lower Bound Cholesky Opper Decoupled Cholesky Opper Decoupled Cholesky Opper Decoupled Cholesky Opper Decoupled Figure 1: Convergence results for a GP classification on the USPS-3vs5 data set. Each plot shows the negative of the lower bound vs time in seconds for data sizes N = 200, 500, 1000 and 1500. For Opper and Cholesky, we show markers for every iteration. For decoupled, we show markers after completion of each subproblem. We can not see the result of first subproblem here, and the first visible marker is obtained from the second subproblem. As the data size increases, Decoupled converges faster, showing a clear advantage over other methods for large dimensionality. A weakness of our paper is a lack of strong experiments showing that the decoupled method indeed converge at a fast rate. The implementation of decoupled method requires a good engineering effort for it to scale to big data. In future, we plan to have an efficient implementation of this method and demonstrate that this enables variational inference to scale to large data. Acknowledgments This work was supported by School of Computer Science and Communication at EPFL. I would specifically like to thank Matthias Grossglauser, Rudiger Urbanke, and Jame Larus for providing me support and funding during this work. I would like to personally thank Volkan Cevher, Quoc TranDinh, and Matthias Seeger from EPFL for early discussions of this work and Marc Desgroseilliers from EPFL for checkin some proofs. I would also like to thank the reviewers for their valuable feedback. The experiments in this paper are less extensive than what I promised them. Due to time and space constraints, I have not been able to add all of them. More experiments will appear in an arXiv version of this paper. 8 References [1] Dimitri P Bertsekas. Nonlinear programming. Athena Scientific, 1999. [2] M. Braun and J. McAuliffe. Variational inference for large-scale models of discrete choice. Journal of the American Statistical Association, 105(489):324–335, 2010. [3] E. Challis and D. Barber. Concave Gaussian variational approximations for inference in large-scale Bayesian linear models. In International conference on Artificial Intelligence and Statistics, 2011. [4] Michael P Friedlander and Michael A Saunders. A globally convergent linearly constrained lagrangian method for nonlinear optimization. SIAM Journal on Optimization, 15(3):863–897, 2005. [5] M. Hoffman, D. Blei, C. Wang, and J. Paisley. Stochastic variational inference. Journal of Machine Learning Research, 14:1303–1347, 2013. [6] A. Honkela, T. Raiko, M. Kuusela, M. Tornio, and J. Karhunen. Approximate Riemannian conjugate gradient learning for fixed-form variational Bayes. Journal of Machine Learning Research, 11:3235– 3268, 2011. [7] T. Jaakkola and M. Jordan. A variational approach to Bayesian logistic regression problems and their extensions. In International conference on Artificial Intelligence and Statistics, 1996. [8] P. Jyl¨anki, J. Vanhatalo, and A. Vehtari. Robust Gaussian process regression with a Student-t likelihood. The Journal of Machine Learning Research, 999888:3227–3257, 2011. [9] Mohammad Emtiyaz Khan. Variational Learning for Latent Gaussian Models of Discrete Data. PhD thesis, University of British Columbia, 2012. [10] Mohammad Emtiyaz Khan, Aleksandr Y. Aravkin, Michael P. Friedlander, and Matthias Seeger. Fast dual variational inference for non-conjugate latent gaussian models. In ICML (3), volume 28 of JMLR Proceedings, pages 951–959. JMLR.org, 2013. [11] Mohammad Emtiyaz Khan, Shakir Mohamed, Benjamin Marlin, and Kevin Murphy. A stick breaking likelihood for categorical data analysis with latent Gaussian models. In International conference on Artificial Intelligence and Statistics, 2012. [12] Mohammad Emtiyaz Khan, Shakir Mohamed, and Kevin Murphy. Fast Bayesian inference for nonconjugate Gaussian process regression. In Advances in Neural Information Processing Systems, 2012. [13] M. L´azaro-Gredilla and M. Titsias. Variational heteroscedastic Gaussian process regression. In International Conference on Machine Learning, 2011. [14] B. Marlin, M. Khan, and K. Murphy. Piecewise bounds for estimating Bernoulli-logistic latent Gaussian models. In International Conference on Machine Learning, 2011. [15] T. Minka. Expectation propagation for approximate Bayesian inference. In Proceedings of the Conference on Uncertainty in Artificial Intelligence, 2001. [16] H. Nickisch and C.E. Rasmussen. Approximations for binary Gaussian process classification. Journal of Machine Learning Research, 9(10), 2008. [17] M. Opper and C. Archambeau. The variational gaussian approximation revisited. Neural Computation, 21(3):786–792, 2009. [18] Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian Processes for Machine Learning. MIT Press, 2006. [19] Stephen M Robinson. A quadratically-convergent algorithm for general nonlinear programming problems. Mathematical programming, 3(1):145–156, 1972. [20] Mikkel N Schmidt, Ole Winther, and Lars Kai Hansen. Bayesian non-negative matrix factorization. In Independent Component Analysis and Signal Separation, pages 540–547. Springer, 2009. [21] M. Seeger. Bayesian Inference and Optimal Design in the Sparse Linear Model. Journal of Machine Learning Research, 9:759–813, 2008. [22] M. Seeger. Sparse linear models: Variational approximate inference and Bayesian experimental design. Journal of Physics: Conference Series, 197(012001), 2009. [23] M. Seeger and H. Nickisch. Large scale Bayesian inference and experimental design for sparse linear models. SIAM Journal of Imaging Sciences, 4(1):166–199, 2011. [24] SJ Wright and J Nocedal. Numerical optimization, volume 2. Springer New York, 1999. 9
2014
366
5,476
On Multiplicative Multitask Feature Learning Xin Wang†, Jinbo Bi†, Shipeng Yu‡, Jiangwen Sun† †Dept. of Computer Science & Engineering ‡ Health Services Innovation Center University of Connecticut Siemens Healthcare Storrs, CT 06269 Malvern, PA 19355 wangxin,jinbo,javon@engr.uconn.edu shipeng.yu@siemens.com Abstract We investigate a general framework of multiplicative multitask feature learning which decomposes each task’s model parameters into a multiplication of two components. One of the components is used across all tasks and the other component is task-specific. Several previous methods have been proposed as special cases of our framework. We study the theoretical properties of this framework when different regularization conditions are applied to the two decomposed components. We prove that this framework is mathematically equivalent to the widely used multitask feature learning methods that are based on a joint regularization of all model parameters, but with a more general form of regularizers. Further, an analytical formula is derived for the across-task component as related to the taskspecific component for all these regularizers, leading to a better understanding of the shrinkage effect. Study of this framework motivates new multitask learning algorithms. We propose two new learning formulations by varying the parameters in the proposed framework. Empirical studies have revealed the relative advantages of the two new formulations by comparing with the state of the art, which provides instructive insights into the feature learning problem with multiple tasks. 1 Introduction Multitask learning (MTL) captures and exploits the relationship among multiple related tasks and has been empirically and theoretically shown to be more effective than learning each task independently. Multitask feature learning (MTFL) investigates a basic assumption that different tasks may share a common representation in the feature space. Either the task parameters can be projected to explore the latent common substructure [18], or a shared low-dimensional representation of data can be formed by feature learning [10]. Recent methods either explore the latent basis that is used to develop the entire set of tasks, or learn how to group the tasks [16, 11], or identify if certain tasks are outliers to other tasks [6]. A widely used MTFL strategy is to impose a blockwise joint regularization of all task parameters to shrink the effects of features for the tasks. These methods employ a regularizer based on the so-called ℓ1,p matrix norm [12, 13, 15, 22, 24] that is the sum of the ℓp norms of the rows in a matrix. Regularizers based on the ℓ1,p norms encourage row sparsity. If rows represent features and columns represent tasks, they shrink the entire rows of the matrix to have zero entries. Typical choices for p are 2 [15, 4] and ∞[20] which are used in the very early MTFL methods. Effective algorithms have since then been developed for the ℓ1,2 [13] and ℓ1,∞[17] regularization. Later, the ℓ1,p norm is generalized to include 1 < p ≤∞with a probabilistic interpretation that the resultant MTFL method solves a relaxed optimization problem with a generalized normal prior for all tasks [22]. Recent research applies the capped ℓ1,1 norm as a nonconvex joint regularizer [5]. The major limitation of joint regularized MTFL is that it either selects a feature as relevant to all tasks or excludes it from all models, which is very restrictive in practice where tasks may share some features but may have their own specific features as well. 1 To overcome this limitation, one of the most effective strategies is to decompose the model parameters into either summation [9, 3, 6] or multiplication [21, 2, 14] of two components with different regularizers applied to the two components. One regularizer is used to take care of cross-task similarities and the other for cross-feature sparsity. Specifically, for the methods that decompose the parameter matrix into summation of two matrices, the dirty model in [9] employs ℓ1,1 and ℓ1,∞ regularizers to the two components. A robust MTFL method in [3] uses the trace norm on one component for mining a low-rank structure shared by tasks and a column-wise ℓ1,2-norm on the other component for identifying task outliers. Another method applies the ℓ1,2-norm both row-wisely to one component and column-wisely to the other [6]. For the methods that work with multiplicative decompositions, the parameter vector of each task is decomposed into an element-wise product of two vectors where one is used across tasks and the other is task-specific. These methods either use the ℓ2-norm penalty on both of the component vectors [2], or the sparse ℓ1-norm on the two components (i.e., multi-level LASSO) [14]. The multi-level LASSO method has been analytically compared to the dirty model [14], showing that the multiplicative decomposition creates better shrinkage on the global and task-specific parameters. The across-task component can screen out the features irrelevant to all tasks. To exclude a feature from a task, the additive decomposition requires the corresponding entries in both components to be zero whereas the multiplicative decomposition only requires one of the components to have a zero entry. Although there are different ways to regularize the two components in the product, no systematic work has been done to analyze the algorithmic and statistical properties of the different regularizers. It is insightful to answer the questions such as how these learning formulations differ from the early methods based on blockwise joint regularization, how the optimal solutions of the two components look like, and how the resultant solutions are compared with those of other methods that also learn both shared and task-specific features. In this paper, we investigate a general framework of the multiplicative decomposition that enables a variety of regularizers to be applied. This general form includes all early methods that represent model parameters as a product of two components [2, 14]. Our theoretical analysis has revealed that this family of methods is actually equivalent to the joint regularization based approach but with a more general form of regularizers, including those that do not correspond to a matrix norm. The optimal solution of the across-task component can be analytically computed by a formula of the optimal task-specific parameters, showing the different shrinkage effects. Statistical justification and efficient algorithms are derived for this family of formulations. Motivated by the analysis, we propose two new MTFL formulations. Unlike the existing methods [2, 14] where the same kind of vector norm is applied to both components, the shrinkage of the global and task-specific parameters differ in the new formulations. Hence, one component is regularized by the ℓ2-norm and the other is by the ℓ1-norm, which aims to reflect the degree of sparsity of the task-specific parameters relative to the sparsity of the across-task parameters. In empirical experiments, simulations have been designed to examine the various feature sharing patterns where a specific choice of regularizer may be preferred. Empirical results on benchmark data are also discussed. 2 The Proposed Multiplicative MTFL Given T tasks in total, for each task t, t ∈{1, · · · , T}, we have sample set (Xt ∈Rℓt×d, yt ∈Rℓt). The data set of Xt has ℓt examples, where the i-th row corresponds to the i-th example xt i of task t, i ∈{1, · · · , ℓt}, and each column represents a feature. The vector yt contains yt i, the label of the i-th example of task t. We consider functions of the linear form Xtαt where αt ∈Rd. We define the parameter matrix or weight matrix A = [α1, · · · , αT ] and αj are the rows, j ∈{1, · · · , d}. A family of multiplicative MTFL methods can be derived by rewriting αt = diag(c)βt where diag(c) is a diagonal matrix with its diagonal elements composing a vector c. The c vector is used across all tasks, indicating if a feature is useful for any of the tasks, and the vector βt is only for task t. Let j index the entries in these vectors. We have αt j = cjβt j. Typically c comprises binary entries that are equal to 0 or 1, but the integer constraint is often relaxed to require just non-negativity. We minimize a regularized loss function as follows for the best c and βt:t=1,··· ,T : min βt,c≥0 TP t=1 L(c, βt, Xt, yt) + γ1 TP t=1 ||βt||p p + γ2||c||k k (1) 2 where L(·) is a loss function, e.g., the least squares loss for regression problems or the logistic loss for classification problems, ||βt||p p = Pd j=1 |βt j|p and ||c||k k = Pd j=1(cj)k, which are the ℓp-norm of βt to the power of p and the ℓk-norm of c to the power of k if p and k are positive integers. The tuning parameters γ1, γ2 are used to balance the empirical loss and regularizers. At optimality, if cj = 0, the j-th variable is removed for all tasks, and the corresponding row vector αj = 0; otherwise the j-th variable is selected for use in at least one of the α’s. Then, a specific βt can rule out the j-th variable from task t if βt j = 0. In particular, if both p = k = 2, Problem (1) becomes the formulation in [2] and if p = k = 1, Problem (1) becomes the formulation in [14]. Any other choices of p and k will derive into new formulations for MTFL. We first examine the theoretical properties of this entire family of methods, and then empirically study two new formulations by varying p and k. 3 Theoretical Analysis The joint ℓ1,p regularized MTFL method minimizes PT t=1 L(αt, Xt, yt) + λ Pd j=1 ||αj||p for the best αt:t=1,··· ,T where λ is a tuning parameter. We now extend this formulation to allow more choices of regularizers. We introduce a new notation that is an operator applied to a vector, such as αj. The operator ||αj||p/q = qqPT t=1 |αt j|p, p, q ≥0, which corresponds to the ℓp norm if p = q and both are positive integers. A joint regularized MTFL approach can solve the following optimization problem with pre-specified values of p, q and λ, for the best parameters αt:t=1,··· ,T : min αt TP t=1 L(αt, Xt, yt) + λ dP j=1 p ||αj||p/q. (2) Our main result of this paper is (i) a theorem that establishes the equivalence between the models derived from solving Problem (1) and Problem (2) for properly chosen values of λ, q, k, γ1 and γ2; and (ii) an analytical solution of Problem (1) for c which shows how the sparsity of the across-task component is relative to the sparsity of task-specific components. Theorem 1 Let ˆ αt be the optimal solution to Problem (2) and ( ˆβt, ˆc) be the optimal solution to Problem (1). Then ˆ αt = diag(ˆc) ˆβt when λ = 2 q γ 2−p kq 1 γ p kq 2 and q = k+p 2k (or k = p 2q−1). Proof. The theorem holds by proving the following two Lemmas. The first lemma proves that the solution ˆ αt of Problem (2) also minimizes the following optimization problem: minαt,σ≥0 PT t=1 L(αt, Xt, yt) + µ1 Pd j=1 σ−1 j ||αj||p/q + µ2 Pd j=1 σj, (3) and the optimal solution of Problem (3) also minimizes Problem (2) when proper values of λ, µ1 and µ2 are chosen. The second lemma connects Problem (3) to our formulation (1). We show that the optimal ˆσj is equal to (ˆcj)k, and then the optimal ˆβ can be computed from the optimal ˆα. Lemma 1 The solution sets of Problem (2) and Problem (3) are identical when λ = 2√µ1µ2. Proof. First, we show that when λ = 2√µ1µ2, the optimal solution ˆαt j of Problem (2) minimizes Problem (3) and the optimal ˆσj = µ 1 2 1 µ −1 2 2 q ||ˆαj||p/q. By the Cauchy-Schwarz inequality, the following inequality holds µ1 d X j=1 σ−1 j ||αj||p/q + µ2 d X j=1 σj ≥2√µ1µ2 d X j=1 q ||αj||p/q where the equality holds if and only if σj = µ 1 2 1 µ −1 2 2 p ||αj||p/q. Since Problems (3) and (2) use the exactly same loss function, when we set ˆσj = µ 1 2 1 µ −1 2 2 q ||ˆαj||p/q, Problems (3) and (2) have identical objective function if λ = 2√µ1µ2. Hence the pair ( ˆA = (ˆαt j)jt, ˆσ = (ˆσj)j=1,··· ,d) minimizes Problem (3) as it entails the objective function to reach its lower bound. 3 Second, it can be proved that if the pair ( ˆA, ˆσ) minimizes Problem (3), then ˆA also minimizes Problem (2) by proof of contradiction. Suppose that ˆA does not minimize Problem (2), which means that there exists ˜αj (̸= ˆαj for some j) that is an optimal solution to Problem (2) and achieves a lower objective value than ˆαj. We set ˜σj = µ 1 2 1 µ −1 2 2 q ||˜αj||p/q. The pair ( ˜A, ˜σ) is an optimal solution of Problem (3) as proved in the first paragraph. Then ( ˜A, ˜σ) will bring the objective function of Problem (3) to a lower value than that of ( ˆA, ˆσ), contradicting to the assumption that ( ˆA, ˆσ) be optimal to Problem (3). Hence, we have proved that Problems (3) and (2) have identical solutions when λ = 2√µ1µ2. From the proof of Lemma (1), we also see that the optimal objective value of Problem (2) gives a lower bound to the objective of Problem (3). Let σj = (cj)k, k ∈R, k ̸= 0 and αt j = cjβt j, an equivalent objective function of Problem (3) can be derived. Lemma 2 The optimal solution ( ˆA, ˆσ) of Problem (3) is equivalent to the optimal solution ( ˆB, ˆc) of Problem (1) where ˆαt j = ˆcj ˆβt j and ˆσj = (ˆcj)k when γ1 = µ kq 2kq−p 1 µ kq−p 2kq−p 2 , γ2 = µ2, and k = p 2q−1. Proof. First, by proof of contradiction, we show that if ˆαt j and ˆσj optimize Problem (3), then ˆcj = kp ˆσj and ˆβt j = ˆαt j ˆcj optimize Problem (1). Denote the objectives of (1) and (3) by J(1) and J(3). Substituting ˆβt j, ˆcj for ˆαt j, ˆσj in J(3) yields an objective function L(ˆc, ˆβt, Xt, yt) + µ1 Pd j=1 ||ˆβ j||p/qˆc(p−kq)/q j + µ2 Pd j=1(ˆcj)k. By the proof of Lemma 1, ˆσj = µ 1 2 1 µ −1 2 2 q ||ˆαj||p/q. Hence, ˆcj =  µ1µ−1 2 ||ˆβ j||p/q q 2kq−p . Applying the formula of ˆcj and substituting µ1 and µ2 by γ1 and γ2 yield an objective identical to J(1). Suppose ∃(˜βt j, ˜cj)(̸= (ˆβt j, ˆcj)) that minimize (1), and J(1)(˜βt j, ˜cj) < J(1)(ˆβt j, ˆcj). Let ˜αt j = ˜cj ˜βt j and substitute ˜βt j by ˜αt j/˜cj in J(1). By Cauchy-Schwarz inequality, we similarly have ˜cj = (γ1γ−1 2 PT t=1(˜αt j)p) 1 p+k . Thus, J(1)(˜αt j, ˜cj) can be derived into J(3)(˜αt j, ˜cj). Let ˜σj = (˜cj)k, and we have J(3)(˜αt j, ˜σj) < J(3)(ˆαt j, ˆσj), which contradicts with the optimality of (ˆαt j, ˆσj). Second, we similarly prove that if ˆβt j and ˆcj optimize Problem (1), then ˆαt j = ˆcj ˆβt j and ˆσj = (ˆcj)k optimize Problem (3). Now, combining the results from the two Lemmas, we can derive that when λ = 2 q γ 2−p kq 1 γ p kq 2 and q = k+p 2k , the optimal solutions to Problems (1) and (2) are equivalent. Solving Problem (1) will yield an optimal solution ˆα to Problem (2) and vice versa. Theorem 2 Let ˆβt, t = 1, · · · , T, be the optimal solutions of Problem (1), Let ˆB = [ˆβ1, · · · , ˆβT ] and ˆβ j denote the j-th row of the matrix ˆB. Then, ˆcj = (γ1/γ2) 1 k ||ˆβ j|| p 2kq−p , (4) for all j = 1, · · · , d, is optimal to Problem (1). Proof. This analytical formula can be directly derived from Lemma 1 and Lemma 2. When we set ˆσj = (ˆcj)k and ˆαt j = ˆcj ˆβt j in Problem (3), we obtain ˆcj =  µ1µ−1 2 ||ˆβ j||p/q q 2kq−p . In the proof of Lemma 2, we obtain that µ1 = γ 2kq−p kq 1 γ p−kq kq 2 and µ2 = γ2. Substituting these formula into the formula of c yields the formula (4). Based on the derivation, for each pair of {p, q} and λ in Problem (2), there exists an equivalent problem (1) with determined values of k, γ1 and γ2, and vice versa. Note that if q = p/2, the regularization term on αj in Problem (2) becomes the standard p-norm. In particular, if {p, q} = {2, 1} in Problem (2) as used in the methods of [15] and [1], the ℓ2-norm regularizer is applied to αj. Then, this problem is equivalent to Problem (1) when k = 2 and λ = 2√γ1γ2, the same formulation in [2]. If {p, q} = {1, 1}, the square root of ℓ1-norm regularizer is applied to αj. Our theorem 1 shows that this problem is equivalent to the multi-level LASSO MTFL formulation [14] which is Problem (1) with k = 1 and λ = 2√γ1γ2. 4 4 Probabilistic Interpretation In this section we show the proposed multiplicative formalism is related to the maximum a posteriori (MAP) solution of a probabilistic model. Let p(A|∆) be the prior distribution of the weight matrix A = [α1, . . . , αT ] = [α1⊤, . . . , αd⊤]⊤∈Rd×T , where ∆denote the parameter of the prior. Then the a posteriori distribution of A can be calculated via Bayes rule as p(A|X, y, ∆) ∝p(A|∆) QT t=1 p(yt|Xt, αt). Denote z ∼GN(µ, ρ, q) the univariate generalized normal distribution, with the density function p(z) = 1 2ρΓ(1+1/q) exp(−|z−µ|q ρq ), in which ρ > 0, q > 0, and Γ(·) is the Gamma function [7]. Now let each element of A, αt j, follow a generalized normal prior, αt j ∼GN(0, δj, q). Then with the i.i.d. assumption, the prior takes the form (also refer to [22] for a similar treatment) p(A|∆) ∝ d Y j=1 T Y t=1 1 δj exp  −|αt j|q δq j  = d Y j=1 1 δT j exp  −∥αj∥q q δq j  , (5) where ∥·∥q denote vector q-norm. With an appropriately chosen likelihood function p(yt|Xt, αt) ∝ exp(−L(αt, Xt, yt)), finding the MAP solution is equivalent to solving the following problem: minA,∆J = PT t=1 L(αt, Xt, yt) + Pd j=1  ∥αj∥q q δq j + T ln δj  . By setting the derivative of J with respect to δj to zero, we obtain: min A J = XT t=1 L(αt, Xt, yt) + T Xd j=1 ln ∥αj∥q. (6) Now let us look at the multiplicative nature of αt j with different q ∈[1, ∞]. When q = 1, we have: d X j=1 ln ∥αj∥1 = d X j=1 ln T X t=1 |αt j| ! = d X j=1 ln T X t=1 |cjβt j| ! = d X j=1 ln |cj| + ln T X t=1 |βt j| ! . (7) Because of ln z ≤z −1 for any z > 0, we can optimize an upper bound of J in (6). We then have minA J1 = PT t=1 L(αt, Xt, yt) + T Pd j=1 |cj| + T Pd j=1 PT t=1 |βt j|, which is equivalent to the multiplicative formulation (1) where {p, k} = {1, 1}. For q > 1, we have: d X j=1 ln ∥αj∥q = 1 q d X j=1 ln T X t=1 |cjβt j|q ! ≤1 q d X j=1 ln max{|c1|, . . . , |cd|}q · T X t=1 |βt j|q ! (8) = d X j=1 ln ∥c∥∞+ 1 q d X j=1 ln T X t=1 |βt j|q ≤d∥c∥∞+ 1 q T X t=1 ∥βt∥q q −(d + d q ). (9) Since vector norms satisfy ∥z∥∞≤∥z∥k for any vector z and k ≥1, these inequalities lead to an upper bound of J in (6), i.e., minA Jq,k = PT t=1 L(αt, Xt, yt) + Td∥c∥k + T q PT t=1 ∥βt∥q q, which is equivalent to the general multiplicative formulation in (1). 5 Optimization Algorithm Alternating optimization algorithms have been used in both of the early methods [2, 14] to solve Problem (1) which alternate between solving two subproblems: solve for βt with fixed c; solve for c with fixed βt. The convergence property of such an alternating algorithm has been analyzed in [2] that it converges to a local minimizer. However, both subproblems in the existing methods can only be solved using iterative algorithms such as gradient descent, linear or quadratic program solvers. We design a new alternating optimization algorithm that utilizes the property that both Problems (1) and (2) are equivalent to Problem (3) used in our proof and we derive a closed-form solution for c for the second subproblem. The following theorem characterizes this result. Theorem 3 For any given values of αt:t=1,··· ,T , the optimal σ of Problem (3) when αt:t=1,··· ,T are fixed to the given values can be computed by σj = γ 1− p 2kq 1 γ 1 2 − p 2kp 2 2qqPT t=1(αt j)p, j = 1, · · · , d. 5 Proof. By the Cauchy-Schwarz inequality and the same argument used in the proof of Lemma 1, we obtain that the best σ for a given set of αt:t=1,··· ,T is σj = µ 1 2 1 µ −1 2 2 p ||αj||p/q. We also know that µ1 and µ2 are chosen in such a way that γ1 = µ kq 2kq−p 1 µ kq−p 2kq−p 2 and γ2 = µ2. This is equivalent to have µ1 = γ 2kq−p kq 1 γ p−kq kq 2 and µ2 = γ2. Substituting them into the formula of σ yields the result. Now, in the algorithm to solve Problem (1), we solve the first subproblem to obtain a new iterate βnew t , then we use the current value of c, cold, to compute the value of αnew t = diag(cold)βnew t , which is then used to compute σj according to the formula in Theorem 3. Then, c is computed as cj = k√σj, j = 1, · · · , d. The overall procedure is summarized in Algorithm 1. Algorithm 1 Alternating optimization for multiplicative MTFL Input: Xt, yt, t = 1, · · · , T, as well as γ1, γ2, p and k Initialize: cj = 1, ∀j = 1, · · · , d repeat 1. Convert Xtdiag(cs−1) →˜Xt, ∀t = 1, · · · , T for t = 1, · · · , T do Solve minβt L(βt, ˜Xt, yt) + γ1||βt||p p for βs t end for 2. Compute αs t = diag(c(s−1))βs t, and compute cs as cs j = k√σj where σj is computed according to the formula in Theorem 3. until max(|(αt j)s −(αt j)s−1|) < ϵ Output: αt, c and βt, t = 1, · · · , T Algorithm 1 can be used to solve the entire family of methods characterized by Problem (1). The first subproblem involves convex optimization if a convex loss function is chosen and p ≥1, and can be solved separately for individual tasks using single task learning. The second subproblem is analytically solved by a formula that guarantees that Problem (1) reaches a lower bound for the current αt. In this paper, the least squares and logistic regression losses are used and both of them are convex and differentiable loss functions. When convex and differentiable losses are used, theoretical results in [19] can be used to prove the convergence of the proposed algorithm. We choose to monitor the maximum norm of the A matrix to terminate the process, but it can be replaced by any other suitable termination criterion. Initialization can be important for this algorithm, and we suggest starting with c = 1, which considers all features initially in the learning process. 6 Two New Formulations The two existing methods discussed in [2, 14] use p = k in their formulations, which renders βt j and cj the same amount of shrinkage. To explore other feature sharing patterns among tasks, we propose two new formulations where p ̸= k. For the common choices of p and k, the relation between the optimal c and β can be computed according to Theorem 2, and is summarized in Table 1. 1. When the majority of the features is not relevant to any of the tasks, it requires a sparsityinducing norm on c. However, within the relevant features, many features are shared between tasks. In other words, the features used in each task are not sparse relative to all the features selected by c, which requires a non-sparsity-inducing norm on β. Hence, we use ℓ1 norm on c and ℓ2 norm on all β’s in Formulation (1). This formulation is equivalent to the joint regularization method of minαt PT t=1 L(αt, Xt, yt) + λ Pd j=1 3qPT t=1(αt j)2 where λ = 2γ 1 3 1 γ 2 3 2 . 2. When many or all features are relevant to the given tasks, it may prefer the ℓ2 norm penalty on c. However, only a limited number of features are shared between tasks, i.e., the features used by individual tasks are sparse with respect to the features selected as useful across tasks by c. We can impose the ℓ1 norm penalty on β. This formulation is equivalent to the joint regularization method of minαt PT t=1 L(αt, Xt, yt) + λ Pd j=1 3 rPT t=1 |αt j| 2 where λ = 2γ 2 3 1 γ 1 3 2 . 6 Table 1: The shrinkage effect of c with respect to β for four common choices of p and k. p k c p k c 2 2 ˆcj = q γ1γ−1 2 qPT t=1 ˆβt j 2 2 1 ˆcj = γ1γ−1 2 PT t=1 ˆβt j 2 1 1 ˆcj = γ1γ−1 2 PT t=1 ˆ |βt j| 1 2 ˆcj = q γ1γ−1 2 qPT t=1 ˆ |βt j| 7 Experiments In this section, we empirically evaluate the performance of the proposed multiplicative MTFL with the four parameter settings listed in Table 1 on synthetic and real-world data for both classification and regression problems. The first two settings (p, k) = (2, 2), (1, 1) give the same methods respectively in [2, 14], and the last two settings correspond to our new formulations. The least squares and logistic regression losses are used, respectively, for regression and classification problems. We focus on the understanding of the shrinkage effects created by the different choices of regularizers in multiplicative MTFL. These methods are referred to as MMTFL and are compared with the dirty model (DMTL) [9] and robust MTFL (rMTFL) [6] that use the additive decomposition. The first subproblem of Algorithm 1 was solved using CPLEX solvers and single task learning in the initial first subproblem served as baseline. We used respectively 25%, 33% and 50% of the available data in each data set for training and the rest data for test. We repeated the random split 15 times and reported the averaged performance. For each split, the regularization parameters of each method were tuned by a 3-fold cross validation within the training data. The regression performance was measured by the coefficient of determination, denoted as R2, which was computed as 1 minus the ratio of the sum of squared residuals and the total sum of squares. The classification performance was measured by the F1 score, which was the harmonic mean of precision and recall. Synthetic Data. We created two synthetic data sets which included 10 and 20 tasks, respectively. For each task, we created 200 examples using 100 features with pre-defined combination weights α. Each feature was generated following the N(0, 1) distribution. We added noise and computed yt = Xtαt + ϵt for each task t where the noise ϵ followed a distribution N(0, 1). We put the different tasks’ α’s together as rows in Figure 1. The values of α’s were specified in such a way for us to explore how the structure of feature sharing influences the multitask learning models when various regularizers are used. In particular, we illustrate the cases where the two newly proposed formulations outperformed other methods. (a) Synthetic data D1 (b) Synthetic data D2 Figure 1: Parameter matrix learned by different methods (darker color indicates greater values.). Synthetic Data 1 (D1). As shown in Figure 1a, 40% of components in all α’s were set to 0, and these features were irrelevant to all tasks. The rest features were used in every task’s model and hence these models were sparse with respect to all of the features, but not sparse with respect to the selected features. This was the assumption for the early joint regularized methods to work. To learn this feature sharing structure, however, we observed that the amount of shrinkage needed would be different for c and β. This case might be in favor of the ℓ1 norm penalty on c. Synthetic Data 2 (D2). The designed parameter matrix is shown in Figure 1b where tasks were split into 6 groups. Five features were irrelevant to all tasks, 10 features were used by all tasks, and each 7 of the remaining 85 features was used by only 1 or 2 groups. The neighboring groups of tasks in Figure 1b shared only 7 features besides those 10 common features. Non-neighboring tasks did not share additional features. We expected c to be non-sparse. However, each task only used very few features with respect to all available features, and hence each β should be sparse. Figure 1 shows the parameter matrices (with columns representing features for illustrative convenience) learned by different methods using 33% of the available examples in each data set. We can clearly see that MMTFL(2,1) performs the best for Synthetic data D1. This result suggests that the classic choices of using ℓ2 or ℓ1 penalty on both c and β (corresponding to early joint regularized methods) might not always be optimal. MMTFL(1,2) is superior for Synthetic data D2, where each model shows strong feature sparsity but few features can be removed if all tasks are considered. Table 2 summarizes the performance comparison where the best performance is highlighted in bold font. Note that the feature sharing patterns may not be revealed by the recent methods on clustered multitask learning that cluster tasks into groups [10, 8, 23] because no cluster structure is present in Figure 1b, for instance. Rather, the sharing pattern in Figure 1b is in the shape of staircase. Table 2: Comparison of the performance between various multitask learning models Data set STL DMTL rMTFL MMTFL(2,2) MMTFL(1,1) MMTFL(2,1) MMTFL(1,2) Synthetic data D1 (R2) 25% 0.40±0.02 0.60±0.02 0.58±0.02 0.64±0.02 0.54±0.03 0.73±0.02 0.42±0.04 33% 0.55±0.03 0.73±0.01 0.61±0.02 0.79±0.02 0.76±0.01 0.86±0.01 0.65±0.03 50% 0.60±0.02 0.75±0.01 0.66±0.01 0.86±0.01 0.88±0.01 0.90±0.01 0.84±0.01 D2 (R2) 25% 0.28±0.02 0.36±0.01 0.46±0.01 0.45±0.01 0.35±0.05 0.46±0.02 0.49±0.02 33% 0.35±0.01 0.42±0.02 0.63±0.03 0.69±0.02 0.75±0.01 0.67±0.03 0.83±0.02 50% 0.75±0.01 0.81±0.01 0.83±0.01 0.91±0 0.95±0 0.92±0.01 0.97±0 Real-world data SARCOS 25% 0.78±0.02 0.90± 0 0.90±0 0.89± 0 0.89± 0 0.90±0.01 0.87±0.01 (R2) 33% 0.78±0.02 0.88±0.11 0.89±0.1 0.90± 0 0.90± 0 0.91±0.01 0.89±0.01 50% 0.83±0.06 0.87± 0.1 0.89±0.1 0.91± 0 0.90± 0.01 0.91±0.01 0.89±0.01 USPS 25% 0.83±0.01 0.89±0.01 0.91±0.01 0.90±0.01 0.90±0.01 0.90±0.01 0.91±0.01 (F1 score) 33% 0.84±0.02 0.90±0.01 0.90±0.01 0.89±0.01 0.90±0.01 0.90±0.01 0.91±0.01 50% 0.87±0.02 0.91±0.01 0.92±0.01 0.92±0.01 0.92±0.01 0.92±0.01 0.93±0.01 Real-world Data. Two benchmark data sets, the Sarcos [1] and the USPS data sets [10], were used for regression and classification tests respectively. The Sarcos data set has 48,933 observations and each observation (example) has 21 features. Each task is to map from the 21 features to one of the 7 consecutive torques of the Sarcos robot arm. We randomly selected 2000 examples for use in each task. USPS handwritten digits data set has 2000 examples and 10 classes as the digits from 0 to 9. We first used principle component analysis to reduce the feature dimension to 87. To create binary classification tasks, we randomly chose images from the other 9 classes to be the negative examples. Table 2 provides the performance of the different methods on these two data sets, which shows the effectiveness of MMTFL(2,1) and MMTFL(1,2). 8 Conclusion In this paper, we study a general framework of multiplicative multitask feature learning. By decomposing the model parameter of each task into a product of two components: the across-task feature indicator and task-specific parameters, and applying different regularizers to the two components, we can select features for individual tasks and also search for the shared features among tasks. We have studied the theoretical properties of this framework when different regularizers are applied and found that this family of methods creates models equivalent to those of the joint regularized MTL methods but with a more general form of regularization. Further, an analytical formula is derived for the across-task component as related to the task-specific component, which shed light on the different shrinkage effects in the various regularizers. An efficient algorithm is derived to solve the entire family of methods and also tested in our experiments. Empirical results on synthetic data clearly show that there may not be a particular choice of regularizers that is universally better than other choices. We empirically show a few feature sharing patterns that are in favor of two newly-proposed choices of regularizers, which is confirmed on both synthetic and real-world data sets. Acknowledgements Jinbo Bi and her students Xin Wang and Jiangwen Sun were supported by NSF grants IIS-1320586, DBI-1356655, IIS-1407205, and IIS-1447711. 8 References [1] A. Argyriou, T. Evgeniou, and M. Pontil. Multi-task feature learning. In Proceedings of NIPS’07, pages 41–48. 2007. [2] J. Bi, T. Xiong, S. Yu, M. Dundar, and R. B. Rao. An improved multi-task learning approach with applications in medical diagnosis. In Proceedings of ECML’08, pages 117–132, 2008. [3] J. Chen, J. Zhou, and J. Ye. Integrating low-rank and group-sparse structures for robust multitask learning. In Proceedings of KDD’11, pages 42–50, 2011. [4] T. Evgeniou and M. Pontil. Regularized multi–task learning. In Proceedings of KDD’04, pages 109–117, 2004. [5] P. Gong, J. Ye, and C. Zhang. Multi-stage multi-task feature learning. In Proceedings of NIPS’12, pages 1997–2005, 2012. [6] P. Gong, J. Ye, and C. Zhang. Robust multi-task feature learning. In Proceedings of KDD’12, pages 895–903, 2012. [7] I. R. Goodman and S. Kotz. Multivariate θ-generalized normal distributions. Journal of Multivariate Analysis, 3(2):204–219, 1973. [8] L. Jacob, B. Francis, and J.-P. Vert. Clustered multi-task learning: a convex formulation. 2008. [9] A. Jalali, S. Sanghavi, C. Ruan, and P. K. Ravikumar. A dirty model for multi-task learning. In Proceedings of NIPS’10, pages 964–972, 2010. [10] Z. Kang, K. Grauman, and F. Sha. Learning with whom to share in multi-task feature learning. In Proceedings of ICML’11, pages 521–528, 2011. [11] A. Kumar and H. Daume III. Learning task grouping and overlap in multi-task learning. In Proceedings of ICML’12, 2012. [12] S. Lee, J. Zhu, and E. Xing. Adaptive multi-task lasso: with application to eQTL detection. In Proceedings of NIPS’10, pages 1306–1314. 2010. [13] J. Liu, S. Ji, and J. Ye. Multi-task feature learning via efficient ℓ1,2-norm minimization. In Proceedings of UAI’09, pages 339–348, 2009. [14] A. Lozano and G. Swirszcz. Multi-level lasso for sparse multi-task regression. In Proceedings of ICML’12, pages 361–368, 2012. [15] G. Obozinski and B. Taskar. Multi-task feature selection. In Technical report, Statistics Department, UC Berkeley, 2006. [16] A. Passos, P. Rai, J. Wainer, and H. Daume III. Flexible modeling of latent task structures in multitask learning. In Proceedings of ICML’12, pages 1103–1110, 2012. [17] A. Quattoni, X. Carreras, M. Collins, and T. Darrell. An efficient projection for l1,infinity regularization. In Proceedings of ICML’09, pages 108–115, 2009. [18] P. Rai and H. Daume. Infinite predictor subspace models for multitask learning. In International Conference on Artificial Intelligence and Statistics, pages 613–620, 2010. [19] P. Tseng. Convergence of a block coordinate descent method for nondifferentiable minimization. Journal Optimization Theory Applications, 109(3):475–494, 2001. [20] B. A. Turlach, W. N. Wenables, and S. J. Wright. Simultaneous variable selection. Technometrics, 47(3):349–363, 2005. [21] T. Xiong, J. Bi, B. Rao, and V. Cherkassky. Probabilistic joint feature selection for multi-task learning. In Proceedings of SIAM International Conference on Data Mining (SDM), pages 69–76, 2006. [22] Y. Zhang, D.-Y. Yeung, and Q. Xu. Probabilistic multi-task feature selection. In Proceedings of NIPS’10, pages 2559–2567, 2010. [23] J. Zhou, J. Chen, and J. Ye. Clustered multi-task learning via alternating structure optimization. In Proceedings of NIPS’11, pages 702–710, 2011. [24] Y. Zhou, R. Jin, and S. C. Hoi. Exclusive lasso for multi-task feature selection. In Proceedings of UAI’10, pages 988–995, 2010. 9
2014
367
5,477
Learning Distributed Representations for Structured Output Prediction Vivek Srikumar∗ University of Utah svivek@cs.utah.edu Christopher D. Manning Stanford University manning@cs.stanford.edu Abstract In recent years, distributed representations of inputs have led to performance gains in many applications by allowing statistical information to be shared across inputs. However, the predicted outputs (labels, and more generally structures) are still treated as discrete objects even though outputs are often not discrete units of meaning. In this paper, we present a new formulation for structured prediction where we represent individual labels in a structure as dense vectors and allow semantically similar labels to share parameters. We extend this representation to larger structures by defining compositionality using tensor products to give a natural generalization of standard structured prediction approaches. We define a learning objective for jointly learning the model parameters and the label vectors and propose an alternating minimization algorithm for learning. We show that our formulation outperforms structural SVM baselines in two tasks: multiclass document classification and part-of-speech tagging. 1 Introduction In recent years, many computer vision and natural language processing (NLP) tasks have benefited from the use of dense representations of inputs by allowing superficially different inputs to be related to one another [26, 9, 7, 4]. For example, even though words are not discrete units of meaning, traditional NLP models use indicator features for words. This forces learning algorithms to learn separate parameters for orthographically distinct but conceptually similar words. In contrast, dense vector representations allow sharing of statistical signal across words, leading to better generalization. Many NLP and vision problems are structured prediction problems. The output may be an atomic label (tasks like document classification) or a composition of atomic labels to form combinatorial objects like sequences (e.g. part-of-speech tagging), labeled trees (e.g. parsing) or more complex graphs (e.g. image segmentation). Despite both the successes of distributed representations for inputs and the clear similarities over the output space, it is still usual to handle outputs as discrete objects. But are structures, and the labels that constitute them, really discrete units of meaning? Consider, for example, the popular 20 Newsgroups dataset [13] which presents the multiclass classification problem of identifying a newsgroup label given the text of a posting. Labels include comp.os.mswindows.misc, sci.electronics, comp.sys.mac.hardware, rec.autos and rec.motorcycles. The usual strategy is to train a classifier that uses separate weights for each label. However, the labels themselves have meaning that is independent of the training data. From the label, we can see that comp.os.mswindows.misc, sci.electronics and comp.sys.mac.hardware are semantically closer to each other than the other two. A similar argument can be made for not just atomic labels but their compositions too. For example, a part-of-speech tagging system trained as a sequence model might have to learn separate parameters ∗This work was done when the author was at Stanford University. 1 for the JJ→NNS and JJR→NN transitions even though both encode a transition from an adjective to a noun. Here, the similarity of the transitions can be inferred from the similarity of its components. In this paper, we propose a new formulation for structured output learning called DISTRO (DIStributed STRuctred Output), which accounts for the fact that labels are not atomic units of meaning. We model label meaning by representing individual labels as real valued vectors. Doing so allows us to capture similarities between labels. To allow for arbitrary structures, we define compositionality of labels as tensor products of the label vectors corresponding to its sub-structures. We show that doing so gives us a natural extension of standard structured output learning approaches, which can be seen as special cases with one-hot label vectors. We define a learning objective that seeks to jointly learn the model parameters along with the label representations and propose an alternating algorithm for minimizing the objective for structured hinge loss. We evaluate our approach on two tasks which have semantically rich labels: multiclass classification on the newsgroup data and part-of-speech tagging for English and Basque. In all cases, we show that DISTRO outperforms the structural SVM baselines. 1.1 Related Work This paper considers the problem of using distributed representations for arbitrary structures and is related to recent work in deep learning and structured learning. Recent unsupervised representation learning research has focused on the problem of embedding inputs in vector spaces [26, 9, 16, 7]. There has been some work [22] on modeling semantic compositionality in NLP, but the models do not easily generalize to arbitrary structures. In particular, it is not easy to extend these approaches to use advances in knowledge-driven learning and inference that standard structured learning and prediction algorithms enable. Standard learning approaches for structured output allow for modeling arbitrarily complex structures (subject to inference difficulties) and structural SVMs [25] or conditional random fields [12] are commonly used. However, the output itself is treated as a discrete object and similarities between outputs are not modeled. For multiclass classification, the idea of classifying to a label set that follow a known hierarchy has been explored [6], but such a taxonomy is not always available. The idea of distributed representations for outputs has been discussed in the connectionist literature since the eighties [11, 21, 20]. In recent years, we have seen several lines of research that address the problem in the context of multiclass classification by framing feature learning as matrix factorization or sparse encoding [23, 1, 3]. As in this paper, the goal has often explicitly been to discover shared characteristics between the classes [2]. Indeed, the inference formulation we propose is very similar to inference in these lines of work. Also related is recent research in the NLP community that explores the use of tensor decompositions for higher order feature combinations [14]. The primary novelty in this paper is that in addition to representing atomic labels in a distributed manner, we model their compositions in a natural fashion to generalize standard structured prediction. 2 Preliminaries and Notation In this section, we give a very brief overview of structured prediction with the goal of introducing notation and terminology for the next sections. We represent inputs to the structured prediction problem (such as, sentences, documents or images) by x ∈X and output structures (such as labels or trees) by y ∈Y. We define the feature function Φ : X × Y →ℜn that captures the relationship between the input x and the structure y as an n dimensional vector. A linear model scores the structure y with a weight vector w ∈ℜn as wT Φ(x, y). We predict the output for an input x as arg maxy wT Φ(x, y). This problem of inference is a combinatorial optimization problem. We will use the structures in Figure 1 as running examples. In the case of multiclass classification, the output y is one of a finite set of labels (Figure 1, left). For more complex structures, the feature vector is decomposed over the parts of the structure. For example, the usual representation of a first-order linear sequence model (Figure 1, middle) decomposes the sequence into emissions and transitions and the features decompose over these [8]. In this case, each emission is associated with one label and a transition is associated with an ordered pair of labels. 2 y x Atomic part Label yp = (y) Multiclass classification y0 y1 y2 x Atomic part Label yp = (y0) Compositional part Label yp = (y0, y1) Sequence labeling. The emissions are atomic and the transitions are compositional. y0 y1 y2 x Compositional part Label yp = (y0, y1, y2) A purely compositional part Figure 1: Three examples of structures. In all cases, x represents the input and the y’s denote the outputs to be predicted. Here, each square represents a part as defined in the text and circles represent random variables for inputs and outputs (as in factor graphs). The left figure shows multiclass classification, which has an atomic part associated with exactly one label. The middle figure shows a first-order sequence labeling task that has both atomic parts (emissions) and compositional ones (transitions). The right figure shows a purely compositional part where all outputs interact. The feature functions for these structures are shown at the end of Section 3.1. In the general case, we denote the parts (or equivalently, factors in a factor graph) in the structure for input x by Γx. Each part p ∈Γx is associated with a list of discrete labels, denoted by yp = (y0 p, y1 p, · · · ). Note that the size of the list yp is a modeling choice; for example, transition parts in the first-order Markov model correspond to two consecutive labels, as shown in Figure 1. We denote the set of labels in the problem as L = {l1, l2, · · · , lM} (e.g. the set of part-of-speech tags). All the elements of the part labels yp are members of this set. For notational convenience, we denote the first element of the list yp by yp (without boldface) and the rest by y1: p . In the rest of the paper, we will refer to a part associated with a single label as atomic and all other parts where yp has more than one element as compositional. In Figure 1, we see examples of a purely atomic structure (multiclass classification), a purely compositional structure (right) and a structure that is a mix of the two (first order sequence, middle). The decomposition of the structure decomposes the feature function over the parts as Φ(x, y) = X p∈Γx Φp (x, yp) . (1) The scoring function wT φ(x, y) also decomposes along this sum. Standard definitions of structured prediction models leave the definition of the part-specific feature function Φp to be problem dependent. We will focus on this aspect in Section 3 to define our model. With definitions of a scoring function and inference, we can state the learning objective. Given a collection of N training examples of the form (xi, yi), training is the following regularized risk minimization problem: min w∈ℜn λ 2 wT w + 1 N X i L(xi, yi; w). (2) Here, L represents a loss function such as the hinge loss (for structural SVMs) or the log loss (for conditional random fields) and penalizes model errors.The hyper-parameter λ trades off between generalization and accuracy. 3 Distributed Representations for Structured Output As mentioned in Section 2, the choice of the feature function Φp for a part p is left to be problem specific. The objective is to capture the correlations between the relevant attributes of the input x and the output labels yp. Typically, this is done by conjoining the labels yp with a user-defined feature vector φp(x) that is dependent only on the input. 3 When applied to atomic parts (e.g. multiclass classification), conjoining the label with the input features effectively allocates a different portion of the weight vector for each label. For compositional parts (e.g. transitions in sequence models), this ensures that each combination of labels is associated with a different portion of the weight vector. The implicit assumption in this design is that labels and label combinations are distinct units of meaning and hence do not share any parameters across them. In this paper, we posit that in most naturally occurring problems and their associated labels, this assumption is not true. In fact, labels often encode rich semantic information with varying degrees of similarities to each other. Because structures are composed of atomic labels, the same applies to structures too. From Section 2, we see that for the purpose of inference, structures are completely defined by their feature vectors, which are decomposed along the atomic and compositional parts that form the structure. Thus, our goal is to develop a feature representation for labeled parts that exploits label similarity. More explicitly, our desiderata are: 1. First, we need to be able to represent labeled atomic parts using a feature representation that accounts for relatedness of labels in such a way that statistical strength (i.e. weights) can be shared across different labels. 2. Second, we need an operator that can construct compositional parts to build larger structures so that the above property can be extended to arbitrary structured output. 3.1 The DISTRO model In order to assign a notion of relatedness between labels, we associate a d dimensional unit vector al to each label l ∈L. We will refer to the d × M matrix comprising of all the M label vectors as A, the label matrix. We can define the feature vectors for parts, and thus entire structures, using these label vectors. To do so, we define the notion of a feature tensor function for a part p that has been labeled with a list of m labels yp. The feature tensor function is a function Ψp that maps the input x and the label list yp associated with the part to a tensor of order m+1. The tensor captures the relationships between the input and all the m labels associated with it. We recursively define the feature tensor function using the label vectors as: Ψp (x, yp, A) =  alyp ⊗φp(x), p is atomic, alyp ⊗Ψp x, y1: p , A  , p is compositional. (3) Here, the symbol ⊗denotes the tensor product operation. Unrolling the recursion in this definition shows that the feature tensor function for a part is the tensor product of the vectors for all the labels associated with that part and the feature vector associated with the input for the part. For an input x and a structure y, we use the feature tensor function to define its feature representation as ΦA (x, y) = X p∈Γx vec (Ψp (x, yp, A)) (4) Here, vec(·) denotes the vectorization operator that converts a tensor into a vector by stacking its elements. Figure 2 shows an example of the process of building the feature vector for a part that is labeled with two labels. With this definition of the feature vector, we can use the standard approach to score structures using a weight vector as wT ΦA (x, y). In our running examples from Figure 1, we have the following definitions of feature functions for each of the cases: 1. Purely atomic part, multiclass classification (left): Denote the feature vector associated with x as φ. For an atomic part, the definition of the feature tensor function in Equation (3) effectively produces a d × |φ| matrix alyφT . Thus the feature vector for the structure y is ΦA (x, y) = vec alyφT  . For this case, the score for an input x being assigned a label y can be explicitly be written as the following summation: wT ΦA (x, y) = d X i=0 |φ| X j=0 wdj+ialy,iφj 4 al1 ∈ℜd al2 ∈ℜd φp(x) ∈ℜN ⊗ ⊗ vec ( ) → vec ( ) d × d × N Feature tensor → Feature vector ∈ℜd2N Figure 2: This figure summarizes feature vector generation for a compositional part labeled with two labels l1 and l2. Each label is associated with a d dimensional label vector and the feature vector for the input is N dimensional. Vectorizing the feature tensor produces a final feature vector that is a d2N-dimensional vector. 2. Purely compositional part (right): For a compositional part, the feature tensor function produces a tensor whose elements effectively enumerate every possible combination of elements of input vector φp(x) and the associated label vectors. So, the feature vector for the structure is ΦA (x, y) = vec aly0 ⊗aly1 ⊗aly2 ⊗φp(x)  . 3. First order sequence (middle): This structure presents a combination of atomic and compositional parts. Suppose we denote the input emission features by φE,i for the ith label and the input features corresponding to the transition1 from yi to yi+1 by φT,i. With this notation, we can define the feature vector for the structure as ΦA (x, y) = X i vec alyi ⊗φE,i + X i vec  alyi ⊗alyi+1 ⊗φT,i . 3.2 Discussion Connection to standard structured prediction For a part p, a traditional structured model conjoins all its associated labels to the input feature vector to get the feature vector for that assignment of the labels. According to the definition of Equation (3), we propose that these label conjunctions should be replaced with a tensor product, which generalizes the standard method. Indeed, if the labels are represented via one-hot vectors, then we would recover standard structured prediction where each label (or group of labels) is associated with a separate section of the weight vector. For example, for multiclass classification, if each label is associated with a separate one-hot vector, then the feature tensor for a given label will be a matrix where exactly one column is the input feature vector φp(x) and all other entries are zero. This argument also extends to compositional parts. Dimensionality of label vectors If labels are represented by one-hot vectors, the dimensionality of the label vectors will be M, the number of labels in the problem. However, in DISTRO, in addition to letting the label vectors be any unit vector, we can also allow them to exist in a lower dimensional space. This presents us with a decision with regard to the dimensionality d. The choice of d is important for two reasons. First, it determines the number of parameters in the model. If a part is associated with m labels, recall that the feature tensor function produces a m + 1 order tensor formed by taking the tensor product of the m label vectors and the input features. That is, the feature vector for the part is a dm|φp(x)| dimensional vector. (See 2 for an illustration.) Smaller d thus leads to smaller weight vectors. Second, if the dimensionality of the label vectors is lower, it encourages more weights to be shared across labels. Indeed, for purely atomic and compositional parts if the labels are represented by M dimensional vectors, we can show that for any weight vector that scores these labels via the feature representation defined in Equation (4), there is another weight vector that assigns the same scores using one-hot weight vectors. 4 Learning Weights and Label Vectors In this section, we will address the problem of learning the weight vectors w and the label vectors A from data. We are given a training set with N examples of the form (xi, yi). The goal of learning 1In a linear sequence model defined as a CRF or a structural SVM, these transition input features can simply be an indicator that selects a specific portion of the weight vector. 5 is to minimize regularized risk over the training set. This leads to a training objective similar to that of structural SVMs or conditional random fields (Equation (2)). However, there are two key differences. First, the feature vectors for structures are not fixed as in structural SVMs or CRFs but are functions of the label vectors. Second, the minimization is over not just the weight vectors, but also over the label vectors that require regularization. In order to encourage the labels to share weights, we propose to impose a rank penalty over the label matrix A in the learning objective. Since the rank minimization problem is known to be computationally intractable in general [27], we use the well known nuclear norm surrogate to replace the rank [10]. This gives us the learning objective defined as f below: f(w, A) = λ1 2 wT w + λ2||A||∗+ 1 N X i L(xi, yi; w, A) (5) Here, the ||A||∗is the nuclear norm of A, defined as the sum of the singular values of the matrix. Compared to the objective in Equation (2), the loss function L is also dependent of the label matrix via the new definition of the features. In this paper, we instantiate the loss using the structured hinge loss [25]. That is, we define L to be L(xi, yi; w, A) = max y wT ΦA(xi, y) + ∆(y, yi) −wT ΦA(xi, yi)  (6) Here, ∆is the Hamming distance. This defines the DISTRO extension of the structural SVM. The goal of learning is to minimize the objective function f in terms of both its parameters w and A, where each column of A is restricted to be a unit vector by definition. However, the objective is not longer jointly convex in both w and A because of the product terms in the definition of the feature tensor. We use an alternating minimization algorithm for solving the optimization problem (Algorithm 1). If the label matrix A is fixed, then so are the feature representations of structures (from Equation (4)). Thus, for a fixed A (lines 2 and 5), the problem of minimizing f(w, A) with respect to only w is identical to the learning problem of structural SVMs. Since gradient computation and inference do not change from the usual setting, we can solve this minimization over w using stochastic subgradient descent (SGD). For fixed weight vectors (line 4), we implemented stochastic sub-gradient descent using the proximal gradient method [18] for solving for A. The supplementary material gives further details about the steps of the algorithm. Algorithm 1 Learning algorithm by alternating minimization. The goal is to solve minw,A f(w, A). The input to the problem is a training set of examples consisting of pairs of labeled inputs (xi, yi) and T, the number of iterations. 1: Initialize A0 randomly 2: Initialize w0 = minw f(w, A0) 3: for t = 1, · · · , T do 4: At ←minA f(wt−1, A) 5: wt+1 ←minw f(w, At) 6: end for 7: return (wT +1, AT ) Even though the objective function is not jointly convex in w and A, in our experiments (Section 5), we found that in all but one trial, the non-convexity of the objective did not affect performance. Because the feature functions are multilinear in w and A, multiple equivalent solutions can exist (from the perspective of the score assigned to structures) and the eventual point of convergence is dependent on the initialization. For regularizing the label matrix, we also experimented with the Frobenius norm and found that not only does the nuclear norm have an intuitive explanation (rank minimization) but also performed better. Furthermore, the proximal method itself does not add significantly to the training time because the label matrix is small. In practice, training time is affected by the density of the label vectors and sparser vectors correspond to faster training because the sparsity can be used to speed up dot product computation. Prediction is as fast as inference in standard models, however, because the only change is in feature computation via the vectorization operator, which can be performed efficiently. 6 5 Experiments We demonstrate the effectiveness of DISTRO on two tasks – document classification (purely atomic structures) and part-of-speech (POS) tagging (both atomic and compositional structures). In both cases, we compare to structural SVMs – i.e. the case of one-hot label vectors – as the baseline. We selected the hyper-parameters for all experiments by cross validation. We ran the alternating algorithm for 5 epochs for all cases with 5 epochs of SGD for both the weight and label vectors. We allowed the baseline to run for 25 epochs over the data. For the proposed method, we ran all the experiments five times with different random initializations for the label vectors and report the average accuracy. Even though the objective is not convex, we found that the learning algorithm converged quickly in almost all trials. When it did not, the objective value on the training set at the end of each alternating SGD step in the algorithm was a good indicator for ill-behaved initializations. This allowed us to discard bad initializations during training. 5.1 Atomic structures: Multiclass Classification Our first application is the problem of document classification with the 20 Newsgroups Dataset [13]. This dataset is collection of about 20,000 newsgroup posts partitioned roughly evenly among 20 newsgroups. The task is to predict the newsgroup label given the post. As observed in Section 1, some newsgroups are more closely related to each other than others. We used the ‘bydate’ version of the data with tokens as features. Table 1 reports the performance of the baseline and variants of DISTRO for newsgroup classification. The top part of the table compares the baseline to our method and we see that modeling the label semantics gives us a 2.6% increase in accuracy. In a second experiment (Table 1, bottom), we studied the effect of explicitly reducing the label vector dimensionality. We see that even with 15 dimensional vectors, we can outperform the baseline and the performance of the baseline is almost matched with 10 dimensional vectors. Recall that the size of the weight vector increases with increasing label vector dimensionality (see Figure 2). This motivates a preference for smaller label vectors. Algorithm Label Matrix Rank Average accuracy (%) Structured SVM 20 81.4 DISTRO 19 84.0 Reduced dimensionality setting DISTRO 15 83.1 DISTRO 10 80.9 Table 1: Results on 20 newsgroup classification. The top part of the table compares the baseline against the full DISTRO model. The bottom part shows the performance of two versions of DISTRO where the dimensionality of the label vectors is fixed. Even with 10-dimensional vectors, we can almost match the baseline. 5.2 Compositional Structures: Sequence classification We evaluated DISTRO for English and Basque POS tagging using first-order sequence models. English POS tagging has been long studied using the Penn Treebank data [15]. We used the standard train-test split [8, 24] – we trained on sections 0-18 of the Treebank and report performance on sections 22-24. The data is labeled with 45 POS labels. Some labels are semantically close to each other because they express variations of a base part-of-speech tag. For example, the labels NN, NNS, NNP and NNPS indicate singular and plural versions of common and proper nouns We used the Basque data from the CoNLL 2007 shared task [17] for training the Basque POS tagger. This data comes from the 3LB Treebank. There are 64 fine grained parts of speech. Interestingly, the labels themselves have a structure. For example, the labels IZE and ADJ indicate a noun and an adjective respectively. However, Basque can take internal noun ellipsis inside noun-forms, which are represented with tags like IZE IZEELI and ADJ IZEELI to indicate nouns and adjectives with internal ellipses. In both languages, many labels and transitions between labels are semantically close to each other. This observation has led, for example, to the development of the universal part-of-speech tag set 7 [19]. Clearly, the labels should not be treated as independent units of meaning and the model should be allowed to take advantage of the dependencies between labels. Language Algorithm Label Matrix Rank Average accuracy (%) English Structured SVM 45 96.2 DISTRO 5 95.1 DISTRO 20 96.7 Basque Structured SVM 64 91.5 DISTRO 58 92.4 Table 2: Results on part-of-speech tagging. The top part of the table shows results on English, where we see a 0.5% gain in accuracy. The bottom part shows Basque results where we see a nearly 1% improvement. For both languages, we extracted the following emission features: indicators for the words, their prefixes and suffixes of length 3, the previous and next words and the word shape according to the Stanford NLP pipeline2,3. Table 2 presents the results for the two languages. We evaluate using the average accuracy over all tags. In the English case, we found that the performance plateaued for any label matrix with rank greater than 20 and we see an improvement of 0.5% accuracy. For Basque, we see an improvement of 0.9% over the baseline. Note that unlike the atomic case, the learning objective for the first order Markov model is not even bilinear in the weights and the label vectors. However, in practice, we found that this did not cause any problems. In all but one run, the test performance remained consistently higher than the baseline. Moreover, the outlier converged to a much higher objective value; it could easily be identified. As an analysis experiment, we initialized the model with one-hot vectors (i.e. the baseline) and found that this gives us similar improvements as reported in the table. 6 Conclusion We have presented a new model for structured output prediction called Distributed Structured Output (DISTRO). Our model is motivated by two observations. First, distributed representations for inputs have led to performance gains by uncovering shared characteristics across inputs. Second, often, structures are composed of semantically rich labels and sub-structures. Just like inputs, similarities between components of structures can be exploited for better performance. To take advantage of similarities among structures, we have proposed to represent labels by real-valued vectors and model compositionality using tensor products between the label vectors. This not only lets semantically similar labels share parameters, but also allows construction of complex structured output that can take advantage of similarities across its component parts. We have defined the objective function for learning with DISTRO and presented a learning algorithm that jointly learns the label vectors along with the weights using alternating minimization. We presented an evaluation of our approach for two tasks – document classification, which is an instance of multiclass classification, and part-of-speech tagging for English and Basque, modeled as firstorder sequence models. Our experiments show that allowing the labels to be represented by realvalued vectors improves performance over the corresponding structural SVM baselines. Acknowledgments We thank the anonymous reviewers for their valuable comments. Stanford University gratefully acknowledges the support of the Defense Advanced Research Projects Agency (DARPA) Deep Exploration and Filtering of Text (DEFT) Program under Air Force Research Laboratory (AFRL) contract no. FA8750-13-2-0040. Any opinions, findings, and conclusion or recommendations expressed in this material are those of the authors and do not necessarily reflect the view of the DARPA, AFRL, or the US government. 2http://nlp.stanford.edu/software/corenlp.shtml 3Note that our POS systems are not state-of-the-art implementations, which typically use second order Markov models with additional features and specialized handling of unknown words. However, surprisingly, for Basque, even the baseline gives better accuracy than the second order TnT tagger[5, 19]. 8 References [1] J. Abernethy, F. Bach, T. Evgeniou, and J. Vert. Low-rank matrix factorization with attributes. arXiv preprint cs/0611124, 2006. [2] Y. Amit, M. Fink, N. Srebro, and S. Ullman. Uncovering shared structures in multiclass classification. In International Conference on Machine Learning, 2007. [3] A. Argyriou, T. Evgeniou, and M. Pontil. Multi-task feature learning. Advances in Neural Information Processing Systems, 2007. [4] Y. Bengio, A. Courville, and P. Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2013. [5] T. Brants. TnT: a statistical part-of-speech tagger. In Conference on Applied Natural Language Processing, 2000. [6] N. Cesa-Bianchi, C. Gentile, and L. Zaniboni. Hierarchical classification: combining bayes with svm. In International Conference on Machine learning, 2006. [7] A. Coates, A. Ng, and H. Lee. An analysis of single-layer networks in unsupervised feature learning. In International Conference on Artificial Intelligence and Statistics, 2011. [8] M. Collins. Discriminative training methods for hidden Markov models: Theory and experiments with perceptron algorithms. In Conference on Empirical Methods in Natural Language Processing, 2002. [9] R. Collobert, J. Weston, L. Bottou, M. Karlen, K. Kavukcuoglu, and P. Kuksa. Natural language processing (almost) from scratch. Journal for Machine Learning Research, 12, 2011. [10] M. Fazel, H. Hindi, and S. Boyd. Rank minimization and applications in system theory. In Proceedings of the American Control Conference, volume 4, 2004. [11] G. E. Hinton. Representing part-whole hierarchies in connectionist networks. In Annual Conference of the Cognitive Science Society, 1988. [12] J. Lafferty, A. McCallum, and F. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Machine Learning, 2001. [13] K. Lang. Newsweeder: Learning to filter netnews. In International Conference on Machine Learning, 1995. [14] T. Lei, Y. Xin, Y. Zhang, R. Barzilay, and T. Jaakkola. Low-rank tensors for scoring dependency structures. In Annual Meeting of the Association for Computational Linguistics, 2014. [15] M. Marcus, G. Kim, M. Marcinkiewicz, R. MacIntyre, A. Bies, M. Ferguson, K. Katz, and B. Schasberger. The Penn Treebank: Annotating Predicate Argument Structure. In Workshop on Human Language Technology, 1994. [16] T. Mikolov, K. Chen, G. Corrado, and J. Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. [17] J. Nivre, J. Hall, S. K¨ubler, R. McDonald, J. Nilsson, S. Riedel, and D. Yuret. The CoNLL 2007 shared task on dependency parsing. In CoNLL shared task session of EMNLP-CoNLL, 2007. [18] N. Parikh and S. Boyd. Proximal algorithms. Foundations and Trends in optimization, 1(3), 2013. [19] S. Petrov, D. Das, and R. McDonald. A universal part-of-speech tagset. arXiv preprint arXiv:1104.2086, 2011. [20] T. A Plate. Holographic reduced representations. IEEE Transactions on Neural Networks, 6(3), 1995. [21] P. Smolensky. Tensor product variable binding and the representation of symbolic structures in connectionist systems. Artificial intelligence, 46(1), 1990. [22] R. Socher, B. Huval, C. Manning, and A. Ng. Semantic Compositionality Through Recursive MatrixVector Spaces. In Empirical Methods in Natural Language Processing, 2012. [23] N. Srebro, J. Rennie, and T. Jaakkola. Maximum-margin matrix factorization. In Advances in Neural Information Processing Systems, 2004. [24] K. Toutanova, D. Klein, C. Manning, and Y. Singer. Feature-rich part-of-speech tagging with a cyclic dependency network. In Conference of the North American Chapter of the Association for Computational Linguistics on Human Language Technology, 2003. [25] I. Tsochantaridis, T. Joachims, T. Hofmann, and Y. Altun. Large margin methods for structured and interdependent output variables. Journal for Machine Learning Research, 2005. [26] J. Turian, L. Ratinov, and Y. Bengio. Word Representations: A Simple and General Method for SemiSupervised Learning. In Annual Meeting of the Association for Computational Linguistics, 2010. [27] L. Vandenberghe and S. Boyd. Semidefinite programming. SIAM review, 38(1), 1996. 9
2014
368
5,478
Large-scale L-BFGS using MapReduce Weizhu Chen, Zhenghao Wang, Jingren Zhou Microsoft {wzchen,zhwang,jrzhou}@microsoft.com Abstract L-BFGS has been applied as an effective parameter estimation method for various machine learning algorithms since 1980s. With an increasing demand to deal with massive instances and variables, it is important to scale up and parallelize L-BFGS effectively in a distributed system. In this paper, we study the problem of parallelizing the L-BFGS algorithm in large clusters of tens of thousands of shared-nothing commodity machines. First, we show that a naive implementation of L-BFGS using Map-Reduce requires either a significant amount of memory or a large number of map-reduce steps with negative performance impact. Second, we propose a new L-BFGS algorithm, called Vector-free L-BFGS, which avoids the expensive dot product operations in the two loop recursion and greatly improves computation efficiency with a great degree of parallelism. The algorithm scales very well and enables a variety of machine learning algorithms to handle a massive number of variables over large datasets. We prove the mathematical equivalence of the new Vector-free L-BFGS and demonstrate its excellent performance and scalability using real-world machine learning problems with billions of variables in production clusters. 1 Introduction In the big data era, many applications require solving optimization problems with billions of variables on a huge amount of training data. Problems of this scale are more common nowadays, such as Ads CTR prediction[1] and deep neural network[2]. The other trend is the wide adoption of mapreduce [3] environments built with commodity hardware. Those large-scale optimization problems are often expected to be solved in a map-reduce environment where big data are stored. When a problem is with huge number of variables, it can be solved efficiently only if the storage and computation cost are maintained effectively. Among a diverse collection of large-scale optimization methods, Limited-memory BFGS (L-BFGS)[4] is one of the frequently used optimization methods in practice[5]. In this paper, we study the L-BFGS implementation for billion-variable scale problems in a map-reduce environment. The original L-BFGS algorithm and its update procedure were proposed in 1980s. A lot of popular optimization software packages implement it as a fundamental building block. Approaches to apply it in a problem with up to millions of variables are well studied and implemented in various optimization packages [6]. However, studies about how to scale L-BFGS into billions of variables are still in their very early stages. For such a massive scale, the parameters, their gradients, and the associated L-BFGS historical states are not only too large to be stored in the memory of a single computation node, but also create too huge computation complexity for a processor or multicores to conquer it within reasonable time. Therefore, it is critical to explore an effective decomposition over both examples and models via distributed learning. Yet, to our knowledge, there is still very limited work to explore billion-variable scale L-BFGS. This directly leads to the consequence that very little work can scale various machine learning algorithms up to billion-variable scale using L-BFGS on map-reduce. 1 In this paper, we start by carefully studying the implementation of L-BFGS in map-reduce environment. We examine two typical L-BFGS implementations in map-reduce and present their scaling obstacles. Particularly, given a problem with d variables and m historical states to approximate Hessian [5], traditional implementation[6][5], either need to store 2md variables in memory or need to perform 2m map-reduce steps per iteration. This clearly creates huge overhead for the problem with billions of variables and prevents a scalable implementation in map-reduce. To conquer these limitations, we reexamine the original L-BFGS algorithm and propose a new LBFGS update procedure, called Vector-free L-BFGS (VL-BFGS), which is specifically devised for distributed learning with huge number of variables. In particular, we replace the original L-BFGS update procedure depending on vector operations, as known as two-loop recursion, by a new procedure only relying on scalar operations. The new two-loop recursion in VL-BFGS is mathematically equivalent to the original algorithm but independent on the number of variable. Meanwhile, it reduces the memory requirement from O(md) to O(m2) where d could be billion-scale but m is often less than 10. Alternatively, it only require 3 map-reduce steps compared to 2m map-reduce steps in another naive implementation. This new algorithm enables the implementation of a collection of machine learning algorithms to scale to billion variables in a map-reduce environment. We demonstrate its scalability and advantage over other approaches designed for large scale problems with billions of variables, and share our experience after deploying it into an industrial cluster with tens of thousands of machines. 2 Related Work L-BFGS [4][7] is a quasi-newton method based on the BFGS [8][9] update procedure, while maintaining a compact approximation of Hessian with modest storage requirement. Traditional implementation of L-BFGS follows [6] or [5] using the compact two-loop recursion update procedure. Although it has been applied in the industry to solve various optimization problems for decades, recent work, such as [10][11], continue to demonstrate its reliability and effectiveness over other optimization methods. In contrast to our work, theirs implemented L-BFGS on a single machine while we focus on the L-BFGS implementation in a distributed environment. In the context of distributed learning, there recently have been extensive research break-through. GraphLab [12] built a parallel distributed framework for graph computation. [13] introduced a framework to parallelize various machine learning algorithms in a multi-core environment. [14] applied the ADMM technique into distributed learning. [15] proposed a delayed version of distributed online learning. General distributed learning techniques closer to our work are the approaches based on parallel gradient calculation followed by a centralized algorithm ([7][16][17]). Different from our work, theirs built on fully connected environment such as MPI while we focus on the map-reduce environment with loose connection. Their centralized algorithm is often the bottleneck of the whole procedure and limits the scalability of the algorithm. For example, [17] clearly stated that it is impractical for their L-BFGS algorithm to run their large dataset due to huge memory consumption in the centralized algorithm although L-BFGS has been shown to be an excellent candidate for their problem. Moreover, the closest to our work lies in applying L-BFGS in the map-reduce-like environment, such as [18][2]. They are solving large-scale problems in a map-reduce adapted environment using L-BFGS. [18] run L-BFGS on a map-reduce plus AllReduce environment to demonstrate the power of large-scale learning with map-reduce. Although it has been shown to scale up to billion of data instances with trillion entries in their data matrix, the number of variables in their problem is only about 16 million due to the constraints in centralized computation of L-BFGS direction. [2] used L-BFGS to solve the deep learning problem. It introduced the parameter servers to split a global model into multiple partitions and store each partition separately. Despite their successes, from the algorithmic point of view, their two-loop recursion update procedure is still highly dependent on the number of variable. Compared with these work, our proposed two-loop recursion updating procedure is independent on the number of variables and with much better parallelism. Furthermore, the proposed algorithm can run on pure map-reduce environment while previous work [2] and [18] require special components such as AllReduce or parameter servers. In addition, it is straightforward for previous work, such as [2][18][17], to leverage our proposal to scale up their problem into another order of magnitude in terms of number of variables. 2 3 L-BFGS Algorithm Given an optimization problem with d variables, BFGS requires to store a dense d by d matrix to approximate the inverse Hessian, where L-BFGS only need to store a few vectors of length d to approximate the Hessian implicitly. Let us denote f as the objective function, g as the gradient and · as the dot product between two vectors. L-BFGS maintains the historical states of previous m (generally m = 10) updates of current position x and its gradient g = ∇f(x). In L-BFGS algorithm, the historical states are represented as the last m updates of form sk = xk+1 −xk and yk = gk+1 −gk where sk represents the position difference and yk represents the gradient difference in iteration k. Each of them is a vector of length d. All of these 2m vector with the original gradient gk will be used to calculate a new direction in line 3 of Algorithm 1. Algorithm 1: L-BFGS Algorithm Outline Input: starting point x0, integer history size m > 0, k=1; Output: the position x with a minimal objective function 1 while no converge do 2 Calculate gradient ∇f(xk) at position xk ; 3 Compute direction pk using Algorithm 2 ; 4 Compute xk+1 = xk + αkpk where αk is chosen to satisfy Wolfe conditions; 5 if k > m then 6 Discard vector pair sk−m, yk−m from memory storage;; 7 end 8 Update sk = xk+1 −xk, yk = ∇f(xk+1) −∇f(xk), k = k + 1 ; 9 end Algorithm 2: L-BFGS two-loop recursion Input: ∇f(xk), si, yi where i = k −m, ..., k −1 Output: new direction p 1 p = −∇f(xk) ; 2 for i ←k −1 to k −m do 3 αi ←si·p si·yi ; 4 p = p −αi · yi ; 5 end 6 p = ( sk−1·yk−1 yk−1·yk−1 )p 7 for i ←k −m to k −1 do 8 β = yi·p si·yi ; 9 p = p + (αi −β) · si; 10 end The core update procedure in Algorithm 1 is the line 3 to calculate a new direction pk using s and y with current gradient ∇f(xk). The most common approach for this calculation is the two-loop recursion in Algorithm 2[5][6]. It initializes the direction p with gradient and continues to update it using historical states y and s. More information about two-loop recursion could be found from [5]. 4 A Map-Reduce Implementation The main procedure in Algorithm 1 lies in Line 2, 3 and 4. The calculation of gradient in Line 2 can be straightforwardly parallelized by dividing the data into multiple partitions. In the map-reduce environment, we can use one map step to calculate the partial gradient for partial data and one reduce to aggregate them into a global gradient vector. The verification of the Wolfe condition only depends on the calculation of the objective function following the line search procedure[5]. So thus Line 4 can also be easily parallelized following the same approach as Line 2. Therefore, the challenge in the L-BFGS algorithm is Line 3. In other words,the difficulties come from the calculation of the two-loop recursion, as shown in Algorithm 2. 3 4.1 Centralized Update The simplest implementation for Algorithm 2 may be to run it in a single processor. We can easily perform this in a singleton reduce. However, the challenge is that Algorithm 2 requires 2m + 1 vectors and each of them has a length of d. This could be feasible when d is in million scale. Nevertheless, when d is in billion scale, either the storage or the computation cost becomes a significant challenge and makes it impractical to implement it in map-reduce. Given the Ads CTR prediction task [1] as an example, there are more than 1 billion of features. If we set m = 10 in a linear model, it will produce 21 ∗1 = 21 billion variables. Even if we compactly use a single-precision floating point to represent a variable, it requires 84 GB memory to store the historical states and gradient. For a map-reduce cluster built from commodity hardware and shared with other applications, this is generally unfeasible nowadays. For example, for the cluster into which we deployed the L-BFGS, its maximal memory limitation for a map-reduce step is 6 GB. 4.2 Distributed Update Due to the storage limitation in centralized update, an alternative is to store s and y into multiple partitions without overlap and use a map-reduce step to calculate every dot product, such as si·p and si ·yi in Line 3 of Algorithm 2. Yet, if each dot product within the for-loop in Algorithm 2 requires a map-reduce step to perform the calculation, this will result in at least 2m map-reduce steps in a twoloop recursion. If we call Algorithm 2 for N times(iterations) in Algorithm 1, it will lead to 2mN map-reduce steps. For example, if m = 10 and N = 100, this will produce 2000 map-reduce steps in a map-reduce job. Unfortunately, each map-reduce step will bring significant overhead due to the scheduling cost and application launching cost. For a job with thousands of map-reduce steps, both these cost often dominate the overall running time and make the useful computational time spent in algorithmic vector operations negligible. Moreover, given our current production cluster as an example, a job with such a huge number of map-reduce step is too large for execution. It will trigger a compilation timeout error before becoming too complicated for an execution engine to execute it. 5 Vector-free L-BFGS For the reasons mentioned, a feasible two-loop recursion procedure has to limit both the memory consumption and the number of map-reduce steps per iteration. To strictly limit the memory consumption in Algorithm 2, we can not store the 2m + 1 vectors with length d in memory unless d is only up to million scale. To comply with the allowable map-reduce steps per iteration, it is neither practical to perform map-reduce steps within the for-loop in Algorithm 2. Both of these assumptions motivate us to carefully re-examine Algorithm 2 and lead to the proposed algorithm in this section. 5.1 Basic Idea Before illustrating the new procedure, let us describe following three observations in Algorithm 2 that guide the design of the new procedure in Algorithm 3: 1. All inputs are invariable during Algorithm 2. 2. All operations applied on p are linear with respect to the inputs. In other words, p could be formalized as a linear combination of the inputs although its coefficients are unknown. 3. The core numeric operation is the dot product between two vectors. Observation 1 and 2 motivate us to formalize the inputs as (2m + 1) invariable base vectors. b1 = sk−m, b2 = sk−m+1, ..., bm = sk−1 (1) bm+1 = yk−m, bm+2 = yk−m+1, ..., b2m = yk−1 (2) b2m+1 = ∇f(xi) (3) So thus we can represent p as a linear combination of bi . Assume δ as the scalar coefficients in this linear combination, we can write p as: p = 2m+1 X k=1 δkbk (4) 4 Since bk are the inputs and invariants during the two-loop recursion, if we can calculate the coefficients δk, we can proceed to calculate the direction p. Following observation 3 with an re-examination of Algorithm 2, we classify the dot product operations into two categories in terms of whether p is involved in the calculation. For the first category only involving the dot product between the inputs (si, yi), a straightforward intuition is to precompute their dot products to produce a scalar, so as to replace each dot product with a scalar in the two-loop recursion. However, the second category of dot products involving p can not follow this same procedure. Because the direction p is ever-changing during the for loop, any dot products involving p can not be settled or pre-computed. Fortunately, thanks to the linear decomposition of p in observation 2 and Eqn.4, we can decompose any dot product involving p into a summation of dot products with its based vectors and corresponding coefficients. This new elegant mathematical procedure only happens after we formalize p as the linear combination of the base vectors. 5.2 The VL-BFGS Algorithm We present the algorithmic procedure in Algorithm 3. Let us denote the results of dot products between every two base vectors as a scalar matrix of (2m + 1) ∗(2m + 1) scalars. The proposed VL-BFGS algorithm only takes it as the input. Similar as the original L-BFGS algorithm, it has a two-loop recursion, but all the operations are only dependent on scalar operations. In Line 1-2, it assigns the initial values for δi. This is equivalent to Line 1 in Algorithm 2 to use opposite direction of gradient as the initial direction. The original calculation of αi in Line 6 relies on the direction vector p. It is worth noting that p is variable within the first loop in which δ is updated. So thus we can not pre-compute any dot product involving p. However, as mentioned earlier and according to observation 2 and Eqn.4, we can formalize bj · p as a summation from a list of dot products between base vectors and corresponding coefficients, as shown in Line 6 of Algorithm 3. Meanwhile, since all base vectors are invariable, their dot products can be pre-computed and replaced with scalars,which then multiply the ever-changing δl. But these are only scalar operations and they are extremely efficient. Line 7 continues to update scalar coefficient δm+j, which is equivalent to update the direction p with respect to the base vector bm+j or corresponding yj. This whole procedure is the same when we apply it to Line 14 and 15. With the new formalization of p in Eqn.4 and the Algorithm 3: Vector-free L-BFGS two-loop recursion Input: (2m + 1) ∗(2m + 1) dot product matrix between bi Output: The coefficients δi where i = 1, 2, ...2m + 1 1 for i ←1 to 2m + 1 do 2 δi = i ≤2m ? 0 : −1 3 end 4 for i = k −1 to k −m do 5 j = i −(k −m) + 1 ; 6 αi ←si·p si·yi = bj·p bj·bm+j = P2m+1 l=1 δlbl·bj bj·bm+j ; 7 δm+j = δm+j −αi ; 8 end 9 for i ←1 to 2m + 1 do 10 δi = ( bm·b2m b2m·b2m )δi 11 end 12 for i ←k −m to k −1 do 13 j = i −(k −m) + 1 ; 14 β = bm+j·p bj·bm+j = P2m+1 l=1 δlbm+j·bl bj·bm+j ; 15 δj = δj + (αi −β) 16 end invariability of yi and si during Algorithm 2, Line 4 in Algorithm 2 updating with yi (equivalent to bm+j) is mathematically equivalent to Line 7 in Algorithm 3, so as Line 9 in Algorithm 2 and Line 15 in Algorithm 3. For other lines between these two algorithms, it is easy to infer their equivalence with the consideration of Eqn.1-4. Thus, Algorithm 3 is mathematically equivalent to Algorithm 2. 5 5.3 Complexity Analysis and Comparison Using the dot product matrix of scalars as the input, the calculation in Algorithm 3 is substantially efficient, since all the calculation is based on scalars. Altogether, it only requires 8m2 multiplications between scalars in the two for-loops. This is tiny compared to any vector operation involving billionscale of variables. Thus, it is not necessary to parallelize Algorithm 3 in implementation. To integrate Algorithm 3 as the core step in Algorithm 1, there are two extra steps we need to perform before and after it. One is to calculate the dot product matrix between the (2m + 1) base vectors. Because all base vectors have the same dimension d, we can partition them using the same way and use one map-reduce step to calculate the dot product matrix. This computation is greatly parallelizable and intrinsically suitable for map-reduce. Even without the consideration of parallization, a first glance tells us it may require about 4m2 dot products. However, since all the si and yi except the first ones are unchanged in a new iteration, we can save the tiny dot product matrix and reuse most entries across iterations. With the consideration of the commutative law of multiplication since si · yj ≡yj · si, each new iteration only need to calculate 6m new dot products which involve new sk, yk and gk. Thus, the complexity is only 6md and this calculation is fully parallel in map-reduce, with each partition only calculating a small portion of 6md multiplications. The other and the final step is to calculate the new direction p based on δi and the base vectors. The complexity is another 2md multiplications, which means the overall complexity of the algorithm is 8md multiplications. Since the overall δ is just a tiny vector with 2m + 1 dimensions, we can join it with all the other base vectors, and then use the same approach as dot product calculation to produce the final direction p using Eqn.4. A single map-reduce step is sufficient for this final step. Altogether, without considering the gradient calculation which is same to all algorithms, VL-BFGS only require 3 map-reduce steps for one iteration in the update. For the centralized update approach in section 4.1, it also requires 6md multiplications in each two loop recursion. In addition to being a centralized approach, as we analyzed above, it requires (2m + 1) ∗d memory storage. This clearly limits its applications to large-scale problems. On the other hand, VL-BFGS in Algorithm 3 only requires (2m+1)2 memory storage and is independent on d. For the distributed approach in section 4.2, it requires at least 2m map-reduce step in a two-loop recursion. Given the number of iteration as N (generally N > 100), the total number of map-reduce steps is 2mN. Fortunately, the VL-BFGS only requires 3N map-reduce steps. In summary, VLBFGS algorithm enjoys a similar overall complexity but it is born with massive degree of parallelism. For problem with billion scale of variables, it is the only map-reduce friendly implementation of the three different approaches. 6 Experiment and Discussion As demonstrated above, it is clear that VL-BFGS has a better scalability property than original LBFGS. Although it is always desirable to invent an exact algorithm that could be mathematically proved to obtain a better scalability property, it is beneficial to demonstrate the value of larger number of variables with an industrial application. On the other hand, for a problem with billions of variables, there are existing practical approaches to reduce it into a smaller number of variables and then solve it with traditional approaches designed for centralized algorithm. In this section, we justify the value of learning large scale variables and simultaneously compare it with the hashing approach, and finally demonstrate the scalability advantage of VL-BFGS. 6.1 Dataset and Experimental Setting The dataset we used is from an Ads Click-through Rate (CTR) prediction problem [1] collected from an industrial search engine. The click event (click or not) is used as the label for each instance. The features include the terms from a query and an Ad keyword along with the contextual information such as Ad position, session-related information and time. We collect 30 days of data and split them into training and test set chronologically. The data from the first 20 days are used as the training set and rest 10 days are used as test set. The total training data have about 12 billions instances and another 6 billion in testing data. There are 1,038,934,683 features the number of non-zero features per instance is about 100 on average. Altogether it has about 2 trillion entries in the data matrix. 6 Table 1: Relative AUC Performance over different number of variables K Relative AUC Performance Baseline(K=1,038,934,683) 0.0% K=250 millions -0.1007388% K=100 millions -0.1902843% K= 10 millions -0.3134094% K= 1 millions -0.5701142% Table 2: Relative AUC Performance over different number of Hash bits K Relative AUC Performance Baseline(K=1,038,934,683) 0.0% K=64 millions(26 bits) -0.1063033% K=16 millions(24 bits) -0.2323647% K= 4 millions(22 bits) -0.3300788% K= 1 millions(20 bits) -0.5080904% We run logistic regression training, so thus each feature corresponds to a variable. The model is evaluated based on the testing data using Area Under ROC Curve [19], denoted as AUC. We set the historical state length m = 10 and enforce L1[20] regularizer to avoid overfitting and achieve sparsity. The regularizer parameter is tuned following the approach in [18]. We run the experiment in a shared cluster with tens of thousands of machines. Each machine has up to 12 concurrent vertices. A vertex is generally a map or reduce step with an allocation of 2 cores and 6G memory. There are more than 1000 different jobs running simultaneously but this number also varies significantly. We split the training data into 400 partitions and allocate 400 tokens for this job, which means this job can use up to 400 vertices at the same time. When we partition vectors to calculate their dot products, our strategy is to allocate up to 5 million entries in a partial vector. For example, 1 billion variables will be split into 200 partitions evenly. We use the model trained with original 1 billion features as the baseline. All the other experiments are compared with it. Since we are not allowed to exhibit the exact AUC number due to privacy consideration, we report the relative change compared with the baseline. The scale of the dataset makes any relative AUC change over 0.001% produce a p-value less than 0.01. 6.2 Value of Large Number of Variables To reduce the number of variables in the original problem, we sort the features based on their frequency in the training data. If we plan to reduce the problem to K variables, we keep the top K frequent features. The baseline without filtering is equivalent to K = 1, 038, 934, 683. We choose different K values and report the relative AUC number in Table 1. The table shows that while we reduce the number of variables, the results consistently decline significantly. When the number of variables is 1 million, the drop is more than 0.5% . This is considerably significant for the problem. Even when we increase the number of variable up to 250 million, the decline is still obvious and significant. This demonstrates that the large number of variables is really needed to learn a good model and the value of learning with billion-scale of variables. 6.3 Comparison with Hashing We follow the approach in [21][18] to calculate a new hash value for each original feature value based on a hash function in [18]. The number of hash bits ranges from 20 to 26. Experimental results compared with the baseline in terms of relative AUC performance are presented in Table 2 Consistently with previous results, all the hashing experiments result in degradation. For the experiment with 20 bits, the degradation is 0.5%. This is a substantial decline for this problem. When we increase the number of bits till 26, the gap becomes smaller but still noticeable. All of these consis7 tently demonstrate that the hashing approach will sacrifice noticeable performance. It is beneficial to train with large-scale number of raw features. 6.4 Training Time Comparison We compare the L-BFGS in section 4.1 with the proposed VL-BFGS. To enable a larger number of variable support for L-BFGS, we reduce the m parameter into 3. We conduct the experiments with varying number of feature number and report their corresponding running time. We use the original data after hashing into 1M features as the baseline and compare all the other experiments with it and report the relative training time for same number of iterations. We run each experiment 5 times and report their mean to cope with the variance in each run. The results with respect to different hash bits range from 20 to 29 and the original 1B features are shown in figure 1. When the number of features is less than 10M, the original L-BFGS has a small advantage over VL-BFGS. However, when we continue to increase the feature number, the running time of L-BFGS grows quickly while that of VL-BFGS increases slowly. On the other hand, when we increase the feature number to 512M, the L-BFGS fails with an out-of-memory exception, while VL-BFGS can easily scale to 1B features.All of these clearly show the scalability advantage of VL-BFGS over traditional L-BFGS. Figure 1: Training time over feature number. 7 Conclusion We have presented a new vector-free exact L-BFGS updating procedure called VL-BFGS. As opposed to original L-BFGS algorithm in map-reduce, the core two-loop recursion in VL-BFGS is independent on the number of variables. This enables it to be easily parallelized in map-reduce and scale up to billions of variables. We present its mathematical equivalence to original L-BFGS, show its scalability advantage over traditional L-BFGS in map-reduce with a great degree of parallelism, and perform experiments to demonstrate the value of large-scale learning with billions of variables using VL-BFGS. Although we emphasis the implementation on map-reduce in this paper, VL-BFGS can be straightforwardly utilized by other distributed frameworks to avoid their centralized problem and scale up their algorithms. In short, VL-BFGS is highly beneficial for machine learning algorithms relying on L-BFGS to scale up to another order of magnitude. 8 References [1] T. Graepel, J.Q. Candela, T. Borchert, and R. Herbrich. Web-Scale Bayesian Click-Through Rate Prediction for Sponsored Search Advertising in Microsofts Bing Search Engine. In International Conference on Machine Learning, pages 13–20. Citeseer, 2010. [2] Jeffrey Dean, G Corrado, Rajat Monga, Kai Chen, and Matthieu Devin. Large Scale Distributed Deep Networks. Advances in Neural Information Processing Systems 25, pages 1232–1240, 2012. [3] Jeffrey Dean and Sanjay Ghemawat. MapReduce : Simplified Data Processing on Large Clusters. Communications of the ACM, 51(1):1–13, 2008. [4] DC Liu and Jorge Nocedal. On the limited memory BFGS method for large scale optimization. Mathematical programming, 45(1-3):503–528, 1989. [5] J Nocedal and S J Wright. Numerical Optimization, volume 43 of Springer Series in Operations Research. Springer, 1999. [6] C Zhu, RH Byrd, P Lu, and J Nocedal. Algorithm 778: L-BFGS-B: Fortran subroutines for large-scale bound-constrained optimization. ACM Transactions on Mathematical Software, 23, pages 550–560, 1997. [7] Stephen G. Nash and Ariela Sofer. Block truncated-Newton methods for parallel optimization. Mathematical Programming, 45(1-3):529–546, 1989. [8] Jorge Nocedal. Updating quasi-Newton matrices with limited storage, 1980. [9] DF Shanno. On broyden-fletcher-goldfarb-shanno method. Journal of Optimization Theory and Applications, 1985. [10] N Schraudolph, J Yu, and S G¨unter. A stochastic quasi-Newton method for online convex optimization. Journal of Machine Learning Research, pages 436–443, 2007. [11] H Daum´e III. Notes on CG and LM-BFGS optimization of logistic regression. 2004. [12] Y Low, J Gonzalez, and A Kyrola. Graphlab: A new framework for parallel machine learning. Uncertainty in Artificial Intelligence, 2010. [13] Cheng-Tao Chu, Sang Kyun Kim, Yi-An Lin, YuanYuan Yu, Gary Bradski, Andrew Y. Ng, and Kunle Olukotun. Map-Reduce for Machine Learning on Multicore. In Advances in Neural Information Processing Systems 19, pages 281–288. MIT Press, 2007. [14] S Boyd, N Parikh, and E Chu. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends in in Machine Learning, (3):1–122, 2011. [15] J Langford, AJ Smola, and M Zinkevich. Slow learners are fast. Advances in Neural Information Processing Systems 22, pages 2331–2339, 2009. [16] C Teo, Le.Q, A Smola, and SVN Vishwanathan. A scalable modular convex solver for regularized risk minimization. ACM SIGKDD Conference on Knowledge Discovery and Data Mining, 2007. [17] S Gopal and Y Yang. Distributed training of Large-scale Logistic models. Proceedings of the 30th International Conference on Machine Learning, 28:287–297, 2013. [18] Alekh Agarwal, Oliveier Chapelle, Miroslav Dud´ık, and John Langford. A Reliable Effective Terascale Linear Learning System. Journal of Machine Learning Research, 15:1111–1133, 2014. [19] CX Ling, J Huang, and H Zhang. AUC: a statistically consistent and more discriminating measure than accuracy. IJCAI, pages 329–341, 2003. [20] Galen Andrew and Jianfeng Gao. Scalable training of l1-regularized log-linear models. Proceedings of the 24th International Conference on Machine Learning, pages 33–40, 2007. [21] K Weinberger, A Dasgupta, J Langford, Smola.A, and J Attenberg. Feature hashing for large scale multitask learning. International Conference on Machine Learning, 2009. 9
2014
369
5,479
Weakly-supervised Discovery of Visual Pattern Configurations Hyun Oh Song Yong Jae Lee* Stefanie Jegelka Trevor Darrell University of California, Berkeley *University of California, Davis Abstract The prominence of weakly labeled data gives rise to a growing demand for object detection methods that can cope with minimal supervision. We propose an approach that automatically identifies discriminative configurations of visual patterns that are characteristic of a given object class. We formulate the problem as a constrained submodular optimization problem and demonstrate the benefits of the discovered configurations in remedying mislocalizations and finding informative positive and negative training examples. Together, these lead to state-of-the-art weakly-supervised detection results on the challenging PASCAL VOC dataset. 1 Introduction The growing amount of sparsely and noisily labeled image data demands robust detection methods that can cope with a minimal amount of supervision. A prominent example of this scenario is the abundant availability of labels at the image level (i.e., whether a certain object is present or absent in the image); detailed annotations of the exact location of the object are tedious and expensive and, consequently, scarce. Learning methods that can handle image-level labels circumvent the need for such detailed annotations and therefore have the potential to effectively use the vast textually annotated visual data available on the Web. Moreover, if the detailed annotations happen to be noisy or erroneous, such weakly supervised methods can even be more robust than fully supervised ones. Motivated by these developments, recent work has explored learning methods that decreasingly rely on strong supervision. Early ideas for weakly supervised detection [11, 32] paved the way by successfully learning part-based object models, albeit on simple object-centric datasets (e.g., Caltech-101). Since then, a number of approaches [21, 26, 29] have aimed at learning models from more realistic and challenging data sets that feature large intra-category appearance variations and background clutter. These approaches typically generate multiple candidate regions and retain the ones that occur most frequently in the positively-labeled images. However, due to intra-category variations and deformations, the identified (single) patches often correspond to only a part of the object, such as a human face instead of the entire body. Such mislocalizations are a frequent problem for weakly supervised detection methods. Mislocalization and too large or too small bounding boxes are problematic in two respects. First, detection is commonly phrased as multiple instance learning (MIL) and solved by non-convex optimization methods that alternatingly guess the location of the objects as positive examples (since the true location is unknown) and train a detector based on those guesses. This procedure is heavily affected by the initial localizations. Second, the detector is often trained in stages; in each stage one adds informative “hard” negative examples to the training data. If we are not given accurate true object localizations in the training data, these hard examples must be derived from the detections inferred in earlier rounds. The higher the accuracy of the initial localizations, the more informative is the augmented training data – and this is key to the accuracy of the final learned model. In this work, we address the issue of mislocalizations by identifying characteristic, discriminative configurations of multiple patches (rather than a single one). This part-based approach is motivated 1 by the observation that automatically discovered single “discriminative” patches often correspond to object parts. In addition, while background patches (e.g., of water or sky) can also occur throughout the positive images, they will re-occur in arbitrary rather than “typical” configurations. We develop an effective method that takes as input a set of images with labels of the form “the object is present/absent”, and automatically identifies characteristic part configurations of the given object. To identify such configurations, we use two main criteria. First, useful patches are discriminative, i.e., they occur in many positively-labeled images, and rarely in the negatively labeled ones. To identify such patches, we use a discriminative covering formulation similar to [29]. Second, the patches should represent different parts, i.e., they may be close but should not overlap too much. In covering formulations, one may rule out overlaps by saying that for two overlapping regions, one “covers” the other, i.e., they are treated as identical and picking one is as good as picking both. But identity is a transitive relation, and the density of possible regions in detection would imply that all regions are identical, strongly discouraging the selection of more than one part per image. Partial covers face the problem of scale invariance. Hence, we instead formulate an independence constraint. This second criterion ensures that we select regions that may be close but are non-redundant and sufficiently non-overlapping. We show that this constrained selection problem corresponds to maximizing a submodular function subject to a matroid intersection constraint, which leads to approximation algorithms with theoretical worst-case bounds. Given candidate parts identified by these two criteria, we effectively find frequently co-occurring configurations that take into account relative position, scale, and viewpoint. We demonstrate multiple benefits of the discovered configurations. First, we observe that configurations of patches can produce more accurate spatial coverage of the full object, especially when the most discriminative pattern corresponds to an object part. Second, any overlapping region between co-occurring visual patterns is likely to cover a part (but not the full) of the object of interest. Thus, they can be used to generate mis-localized positives as informative hard negatives for training (see white boxes in Figure 3), which can further reduce localization errors at test time. In short, our main contribution is a weakly-supervised object detection method that automatically discovers frequent configurations of discriminative visual patterns to train robust object detectors. In our experiments on the challenging PASCAL VOC dataset, we find the inclusion of our discriminative, automatically detected configurations to outperform all existing state-of-the-art methods. 2 Related work Weakly-supervised object detection. Object detectors have commonly been trained in a fullysupervised manner, using tight bounding box annotations that cover the object of interest (e.g., [10]). To reduce laborious bounding box annotation costs, recent weakly-supervised approaches [3, 4, 11, 21, 26, 29, 32] use image-level object-presence labels with no information on object location. Early efforts [11, 32] focused on simple datasets that have a single prominent object in each image (e.g., Caltech-101). More recent approaches [21, 26, 29] work with the more challenging PASCAL dataset that contains multiple objects in each image and large intra-category appearance variations. Of these, Song et al. [29] achieve state-of-the-art results by finding discriminative image patches that occur frequently in the positive images but rarely in the negative images, using deep Convolutional Neural Network (CNN) features [17] and a submodular cover formulation. We build on their approach to identify discriminative patches. But, contrary to [29] which assumes patches to contain entire objects, we assume patches to contain either full objects or merely object parts, and automatically piece together those patches to produce better full-object estimates. To this end, we change the covering formulation and identify patches that are both representative and explicitly mutually different. This leads to more robust object estimates and further allows our system to intelligently select “hard negatives” (mislocalized objects), both of which improve detection performance. Visual data mining. Existing approaches discover high-level object categories [14, 7, 28], mid-level patches [5, 16, 24], or low-level foreground features [18] by grouping similar visual patterns (i.e., images, patches, or contours) according to their texture, color, shape, etc. Recent methods [5, 16] use weakly-supervised labels to discover discriminative visual patterns. We use related ideas, but formulate the problem as a submodular optimization over matroids, which leads to approximation algorithms with theoretical worst-case guarantees. Covering formulations have also been used in 2 [1, 2], but after running a trained object detector. An alternative discriminative approach is to use spectral methods [34]. Modeling co-occurring visual patterns. It is known that modeling the spatial and geometric relationship between co-occurring visual patterns (objects or object-parts) often improves visual recognition performance [8, 18, 10, 11, 19, 23, 27, 24, 32, 33]. Co-occurring patterns are usually represented as doublets [24], higher-order constellations [11, 32] or star-shaped models [10]. Among these, our work is most inspired by [11, 32], which learn part-based models with weak supervision. We use more informative deep CNN features and a different formulation, and show results on more difficult datasets. Our work is also related to [19], which discovers high-level object compositions (“visual phrases” [8]), but with ground-truth bounding box annotations. In contrast, we aim to discover part compositions to represent full objects and do so with less supervision. 3 Approach Our goal is to find a discriminative set of patches that co-occur in the same configuration in many positively-labeled images. We address this goal in two steps. First, we find a set of patches that are discriminative; i.e., they occur frequently in positive images and rarely in negative images. Second, we efficiently find co-occurring configurations of pairs of such patches. Our approach easily extends beyond pairs; for simplicity and to retain configurations that occur frequently enough, we here restrict ourselves to pairs. Discriminative candidate patches. For identifying discriminative patches, we begin with a construction similar to that of Song et al. [29]. Let P be the set of positively-labeled images. Each image I contains candidate boxes {bI,1, . . . , bI,m} found via selective search [30]. For each bI,i, we find its closest matching neighbor bI′,j in each other image I′ (regardless of the image label). The K closest of those neighbors form the neighborhood N(bI,i); the remaining ones are discarded. Discriminative patches have neighborhoods mainly within images in P, i.e., if B(P) is the set of all patches from images in P, then |N(b) ∩B(P)| ≈K. To identify a small, diverse and representative set of such patches, like [29], we construct a bipartite graph G = (U, V, E), where both U and V contain copies of B(P). Each patch b ∈V is connected to the copy of its nearest neighbors in U (i.e., N(b) ∩B(P)). These will be K or fewer, depending on whether the K nearest neighbors of b occur in B(P) or in negatively-labeled images. The most representative patches maximize the covering function F(S) = |Γ(S)|, (1) where Γ(S) = {u ∈U | (b, u) ∈E for some b ∈S} ⊆U is the neighborhood of S ⊆V in the bipartite graph. Figure 1 shows a cartoon illustration. The function F is monotone and submodular, and the C maximizing elements (for a given C) can be selected greedily [20]. However, if we aim to find part configurations, we must select multiple, jointly informative patches per image. Patches selected to merely maximize coverage can still be redundant, since the most frequently occurring ones are often highly overlapping. A straightforward modification would be to treat highly overlapping patches as identical. This identification would still admit a submodular cover model as in Equation (1). But, in our case, the candidate patches are very densely packed in the image, and, by transitivity, we would have to make all of them identical. In consequence, this would completely rule out the selection of more than one patch in an image and thereby prohibit the discovery of any co-occurring configurations. Instead, we directly constrain our selection such that no two patches b, b′ ∈V can be picked whose neighborhoods overlap by more than a fraction θ. By overlap, we mean that the patches in the neighborhoods of b, b′ overlap significantly (they need not be identical). This notion of diversity is reminiscent of NMS and similar to that in [5], but we here phrase and analyze it as a constrained submodular optimization problem. Our constraint can be expressed in terms of a different graph GC = (V, EC) with nodes V. In GC, there is an edge between b and b′ if their neighborhoods overlap prohibitively, as illustrated in Figure 1. Our family of feasible solutions is M = {S ⊆V | ∀b, b′ ∈S there is no edge (b, b′) ∈EC}. (2) In other words, M is the family of all independent sets in GC. We aim to maximize maxS⊆V F(S) s.t. S ∈M. (3) 3 V U Figure 1: Left: bipartite graph G that defines the utility function F and identifies discriminative patches; right: graph GC that defines the diversifying independence constraints M. We may pick C1 (yellow) and C3 (green) together, but not C2 (red) with any of those. This problem is NP-hard. We solve it approximately via the following greedy algorithm. Begin with S0 = ∅, and, in iteration t, add b ∈argmaxb∈V\S |Γ(b) \ Γ(St−1)|. As we add b, we delete all of b’s neighbors in GC from V. We continue until V = ∅. If the neighborhoods of any b, b′ are disjoint but contain overlapping elements (Γ(b) ∩Γ(b′) = ∅but there exist u ∈Γ(b) and u′ ∈Γ(b′) that overlap), then this algorithm amounts to the following simplified scheme: we first sort all b ∈V in non-increasing order by their degree Γ(b), i.e., their number of neighbors in B(P), and visit them in this order. We always add the currently highest b in the list to S, then delete it from the list, and with it all its immediate (overlapping) neighbors in GC. The following lemma states an approximation factor for the greedy algorithm, where ∆is the maximum degree of any node in GC. Lemma 1. The solution Sg returned by the greedy algorithm is a 1/(∆+ 2) approximation for Problem (2): F(Sg) ≥ 1 ∆+2F(S∗). If Γ(b) ∩Γ(b′) = ∅for all b, b′ ∈V, then the worst-case approximation factor is 1/(∆+ 1). The proof relies on phrasing M as an intersection of matroids. Definition 1 (Matroid). A matroid (V, Ik) consists of a ground set V and a family Ik ⊆2V of “independent sets” that satisfy three axioms: (1) ∅∈Ik; (2) downward closedness: if S ∈Ik then T ∈Ik for all T ⊆S; and (3) the exchange property: if S, T ∈Ik and |S| < |T|, then there is an element v ∈T \ S such that S ∪{v} ∈Ik. Proof. (Lemma 1) We will argue that Problem (2) is the problem of maximizing a monotone submodular function subject to the constraint that the solution lies in the intersection of ∆+1 matroids. With this insight, the approximation factor of the greedy algorithm for submodular F follows from [12] and that for non-intersecting Γ(b) from [15], since in the latter case the problem is that of finding a maximum weight vector in the intersection of ∆+ 1 matroids. It remains to argue that M is an intersection of matroids. Our matroids will be partition matroids (over the ground set V) whose independent sets are of the form Ik = {S | |S ∩e| ≤1, for all e ∈ Ek}. To define those, we partition the edges in GC into disjoint sets Ek, i.e., no two edges in Ek share a common node. The Ek can be found by an edge coloring – one Ek and Ik for each color k. By Vizing’s theorem [31], we need at most ∆+1 colors. The matroid Ik demands that for each edge e ∈Ek, we may only select one of its adjacent nodes. All matroids together say that for any edge e ∈E, we may only select one of the adjacent nodes, and that is the constraint in Equation (2), i.e. M = T∆+1 k=1 Ik. We do not ever need to explicitly compute Ek and Ik; all we need to do is check membership in the intersection, and this is equivalent to checking whether a set S is an independent set in GC, which is achieved implicitly via the deletions in the algorithm. From the constrained greedy algorithm, we obtain a set S ⊂V of discriminative patches. Together with its neighborhood Γ(b), each patch b ∈V forms a representative cluster. Figure 2 shows some example patches derived from the labels “aeroplane” and “motorbike”. The discovered patches intuitively look like “parts” of the objects, and are frequent but sufficiently different. Finding frequent configurations. The next step is to find frequent configurations of co-occurring clusters, e.g., the head patch of a person on top of the torso patch, or a bicycle with visible wheels. 4 Figure 2: Examples of discovered patch “clusters” for aeroplane, motorbike, and cat. The discovered patches intuitively look like object parts, and are frequent but sufficiently different. A “configuration” consists of patches from two clusters Ci, Cj, their relative location, and their viewpoint and scale. In practice, we give preference to pairs that by themselves are very relevant and maximize a weighted combination of co-occurrence count and coverage max{Γ(Ci), Γ(Cj)}. All possible configurations of all pairs of patches amount to too many to explicitly write down and count. Instead, we follow an efficient procedure for finding frequent configurations. Our approach is inspired by [19], but does not require any supervision. We first find configurations that occur in at least two images. To do so, we consider each pair of images I1, I2 that have at least two co-occurring clusters. For each correspondence of cluster patches across the images, we find a corresponding transform operation (translation, scale, viewpoint change). This results in a point in a 4D transform space, for each cluster correspondence. We quantize this space into B bins. Our candidate configurations will be pairs of cluster correspondences ((bI1,1, bI2,1), (bI1,2, bI2,2)) ∈(Ci×Ci)×(Cj ×Cj) that fall in the same bin, i.e., share the same transform and have the same relative location. Between a given pair of images, there can be multiple such pairs of correspondences. We keep track of those via a multi-graph GP = (P, EP ) that has a node for each image I ∈P. For each correspondence ((bI1,1, bI2,1), (bI1,2, bI2,2)), we draw an edge (I1, I2) and label it by the clusters Ci, Cj and the common relative position. As a result, there can be multiple edges (I1, Ij) in GP with different edge labels. The most frequently occurring configuration can now be read out by finding the largest connected component in GP induced by retaining only edges with the same label. We use the largest component(s) as the characteristic configurations for a given image label (object class). If the component is very small, then there is not enough information to determine co-occurrences, and we simply use the most frequent single cluster. The final single “correct” localization will be the smallest bounding box that contains the full configuration. Discovering mislocalized hard negatives. Discovering frequent configurations can not only lead to better localization estimates of the full object, but they can also be used to generate mislocalized estimates as “hard negatives” when training the object detector. We exploit this idea as follows. Let b1, b2 be a discovered configuration within a given image. These patches typically constitute co-occurring parts or a part and the full object. Our foreground estimate is the smallest box that includes both b1 and b2. Hence, any region within the foreground estimate that does not overlap simultaneously with both b1 and b2 will capture only a fragment of the foreground object. We extract the four largest such rectangular regions (see white boxes in Figure 3) as hard negative examples. Specifically, we parameterize any rectangular region with [xl, xr, yt, yb], i.e., its x-left, x-right, y-top, and y-bottom coordinate values. Let the bounding box of bi (i = 1, 2) be [xl i, xr i , yt i, yb i ], the foreground estimate be [xl f, xr f, yt f, yb f], and let xl = max(xl 1, xl 2), xr = min(xr 1, xr 2), yt = max(yt 1, yt 2), yb = min(yb 1, yb 2). We generate four hard negatives: [xl f, xl, yb f, yt f], [xr, xr f, yb f, yt f], [xl f, xr f, yt f, yt], [xl f, xr f, yb, yb f]. If either b1 or b2 is very small in size relative to the foreground, the resulting hard negatives can have high overlap with the foreground, which will introduce undesirable noise (false negatives) when training the detector. Thus, we shrink any hard negative that overlaps with the foreground estimate by more than 50%, until its overlap is 50% (we adjust the boundary that does not coincide with any of the foreground estimation boundaries). 5 Figure 3: Automatically discovered foreground estimation box (magenta), hard negative (white), and the patch (yellow) that induced the hard negative. Note that we are only showing the largest one out of (up to) four hard negatives per image. Note that simply taking arbitrary rectangular regions that overlap with the foreground estimation box by some threshold will not always generate useful hard negatives (as we show in the experiments). If the overlap threshold is too low, the selected regions will be uninformative, and if the overlap threshold is too high, the selected regions will cover too much of the foreground. Our approach selects informative hard negatives more robustly by ruling out the overlapping region between the configuration patches, which is very likely be part of the foreground object but not the full object. Mining positives and training the detector. While the discovered configurations typically lead to better foreground localization, their absolute count can be relatively low compared to the total number of positive images. This is due to inaccuracies in the initial patch discovery stage: for a frequent configuration to be discovered, both of its patches must be found accurately. Thus, we also mine additional positives from the set of remaining positive images P′ that did not produce any of the discovered configurations. To do so, we train an initial object detector, using the foreground estimates derived from our discovered configurations as positive examples, and the corresponding discovered hard negative regions as negatives. In addition, we mine negative examples in negative images as in [10]. We run the detector on all selective search regions in P′ and retain the region in each image with the highest detection score as an additional positive training example. Our final detector is trained on this augmented training data, and iteratively improved by latent SVM (LSVM) updates (see [10, 29] for details). 4 Experiments In this section, we analyze: (1) detection performance of the models trained with the discovered configurations, and (2) impact of the discovered hard negatives on detection performance. Implementation details. We employ a recent region based detection framework [13, 29] and use the same fc7 features from the CNN model [6] on region proposals [30] throughout the experiments. For discriminative patch discovery, we use K = |P|/2, θ = K/20. For correspondence detection, we discretize the 4D transform space of {x: relative horizontal shift, y: relative vertical shift, s: relative scale, p: relative aspect ratio} with ∆x = 30 px, ∆y = 30 px, ∆s = 1 px/px, ∆p = 1 px/px. We chose this binning scheme by examining a few qualitative examples so that scale and aspect ratio agreement between the two paired instances are more strict, while their translation agreement is more loose, in order to handle deformable objects. More details regarding the transform space binning can be found in [22]. Discovered configurations. Figure 5 shows the discovered configurations (solid green and yellow boxes) and foreground estimates (dashed magenta boxes) that have high degree in graph GP for all 20 classes in the PASCAL dataset. Our method consistently finds meaningful combinations such as a wheel and body of bicycles, face and torso of people, locomotive basement and upper body parts of trains/buses, and window and body frame of cars. Some failures include cases where the algorithm latches onto different objects co-occurring in consistent configurations such as the lamp and sofa combination (right column, second row from the bottom in Figure 5). Weakly-supervised object detection. Following the evaluation protocol of the PASCAL VOC dataset, we report detection results on the PASCAL test set using detection average precision. For a direct comparison with the state-of-the-art weakly-supervised object detection method [29], we do not use the extra instance level annotations such as pose, difficult, truncated and restrict the supervision to the image-level object presence annotations. Table 1 compares our detection results against two baseline methods [25, 29] on the full dataset. Our method improves detection performance on 15 of the 20 classes. It is worth noting that our method yields significant improvement on the person 6 aero bike bird boat btl bus car cat chr cow tble dog horse mbk pson plnt shp sofa train tv mAP [25] 13.4 44.0 3.1 3.1 0.0 31.2 43.9 7.1 0.1 9.3 9.9 1.5 29.4 38.3 4.6 0.1 0.4 3.8 34.2 0.0 13.9 [29] 27.6 41.9 19.7 9.1 10.4 35.8 39.1 33.6 0.6 20.9 10.0 27.7 29.4 39.2 9.1 19.3 20.5 17.1 35.6 7.1 22.7 ours1 31.9 47.0 21.9 8.7 4.9 34.4 41.8 25.6 0.3 19.5 14.2 23.0 27.8 38.7 21.2 17.6 26.9 12.8 40.1 9.2 23.4 ours2 36.3 47.6 23.3 12.3 11.1 36.0 46.6 25.4 0.7 23.5 12.5 23.5 27.9 40.9 14.8 19.2 24.2 17.1 37.7 11.6 24.6 Table 1: Detection average precision (%) on full PASCAL VOC 2007 test set. ours1: before latent updates. ours2: after latent updates w/o hard negatives neighboring hard negatives discovered hard negatives ours + SVM 22.5 22.2 23.4 ours + LSVM 23.7 23.9 24.6 Table 2: Effect of our hard negative examples on full PASCAL VOC 2007 test set. class, which is arguably the most important category in the PASCAL dataset. Figure 4 shows some example high scoring detections on the test set. Our method produces more complete detections since it is trained on better localized instances of the object-of-interest. Figure 4: Example detections on test set. Green: our method, red: [29] Impact of discovered hard negatives. To analyze the effect of our discovered hard negatives, we compare to two baselines: (1) not adding any negative examples from positives images, and (2) adding image regions around the foreground estimate, as conventionally implemented in fully supervised object detection algorithms [9, 13]. For the latter, we use the criterion from [13], where all image regions in positive images with overlap score (intersection over union with respect to any foreground region) less than 0.3 are used as “neighboring” negative image regions on positive images. Table 2 shows the effect of our hard negative examples on detection mean average precision for all classes (mAP). We also added neighboring negative examples to [29], but this decreases its mAP from 20.3% to 20.2% (before latent updates) and from 22.7% to 21.8% (after latent updates). These experiments show that adding neighboring negative regions does not lead to noticeable improvement over not adding any negative regions from positive images, while adding our automatically discovered hard negative regions improves detection performance more substantially. Conclusion. We developed a weakly-supervised object detection method that discovers frequent configurations of discriminative visual patterns. We showed that the discovered configurations provide more accurate spatial coverage of the full object and provide a way to generate useful hard negatives. Together, these lead to state-of-the-art weakly-supervised detection results on the challenging PASCAL VOC dataset. Acknowledgement. This work was supported in part by DARPA’s MSEE and SMISC programs, by NSF awards IIS-1427425, IIS-1212798, IIS-1116411, and by support from Toyota. References [1] O. Barinova, V. Lempitsky, and P. Kohli. On detection of multiple object instances using hough transforms. IEEE TPAMI, 2012. [2] Y. Chen, H. Shioi, C. Fuentes-Montesinos, L. Koh, S. Wich, and A. Krause. Active detection via adaptive submodularity. In ICML, 2014. 7 Figure 5: Example configurations that have high degree in graph GP . The solid green and yellow boxes show the discovered discriminative visual parts, and the dashed magenta box shows the bounding box that tightly fits their configuration. 8 [3] T. Deselaers, B. Alexe, and V. Ferrari. Localizing objects while learning their appearance. In ECCV, 2010. [4] T. Deselaers, B. Alexe, and V. Ferrari. Weakly supervised localization and learning with generic knowledge. IJCV, 2012. [5] C. Doersch, S. Singh, A. Gupta, J. Sivic, and A. A. Efros. What Makes Paris Look like Paris? In SIGGRAPH, 2012. [6] 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. arXiv e-prints, 2013. [7] A. Faktor and M. Irani. Clustering by Composition Unsupervised Discovery of Image Categories. In ECCV, 2012. [8] A. Farhadi and A. Sadeghi. Recognition Using Visual Phrases. In CVPR, 2011. [9] P. Felzenszwalb, D. McAllester, and D. Ramanan. A Discriminatively Trained, Multiscale, Deformable Part Model. In CVPR, 2008. [10] P. Felzenszwalb, R. Girshick, D. McAllester, and D. Ramanan. Object Detection with Discriminatively Trained Part Based Models. TPAMI, 32(9), 2010. [11] R. Fergus, P. Perona, and A. Zisserman. Object Class Recognition by Unsupervised Scale-Invariant Learning. In CVPR, 2003. [12] M. Fisher, G. Nemhauser, and L. Wolsey. An analysis of approximations for maximizing submodular set functions - II. Math. Prog. Study, 8:73–87, 1978. [13] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. arXiv e-prints, 2013. [14] K. Grauman and T. Darrell. Unsupervised learning of categories from sets of partially matching image features. In CVPR, 2006. [15] T. Jenkyns. The efficacy of the “greedy” algorithm. In Proc. of 7th South Eastern Conference on Combinatorics, Graph Theory and Computing, pages 341–350, 1976. [16] M. Juneja, A. Vedaldi, C. V. Jawahar, and A. Zisserman. Blocks that Shout: Distinctive Parts for Scene Classification. In CVPR, 2013. [17] A. Krizhevsky and I. S. G. Hinton. ImageNet Classification with Deep Convolutional Neural Networks. In NIPS, 2012. [18] Y. J. Lee and K. Grauman. Foreground Focus: Unsupervised Learning From Partially Matching Images. IJCV, 85, 2009. [19] C. Li, D. Parikh, and T. Chen. Automatic Discovery of Groups of Objects for Scene Understanding. In CVPR, 2012. [20] G. Nemhauser, L. Wolsey, and M. Fisher. An analysis of approximations for maximizing submodular set functions—I. Mathematical Programming, 14(1):265–294, 1978. [21] M. Pandey and S. Lazebnik. Scene recognition and weakly supervised object localization with deformable part-based models. In ICCV, 2011. [22] D. Parikh, C. L. Zitnick, and T. Chen. From Appearance to Context-Based Recognition: Dense Labeling in Small Images. In CVPR, 2008. [23] T. Quack, V. Ferrari, B. Leibe, and L. V. Gool. Efficient Mining of Frequent and Distinctive Feature Configurations. In ICCV, 2007. [24] S. Singh, A. Gupta, and A. A. Efros. Unsupervised Discovery of Mid-level Discriminative Patches. In ECCV, 2012. [25] P. Siva and T. Xiang. Weakly supervised object detector learning with model drift detection. In ICCV, 2011. [26] P. Siva, C. Russell, and T. Xiang. In defence of negative mining for annotating weakly labelled data. In ECCV, 2012. [27] J. Sivic and A. Zisserman. Video Data Mining Using Configurations of Viewpoint Invariant Regions. In CVPR, 2004. [28] J. Sivic, B. Russell, A. Efros, A. Zisserman, and W. Freeman. Discovering object categories in image collections. In ICCV, 2005. [29] H. O. Song, R. Girshick, S. Jegelka, J. Mairal, Z. Harchaoui, and T. Darrell. On learning to localize objects with minimal supervision. In ICML, 2014. [30] J. Uijlings, K. van de Sande, T. Gevers, and A. Smeulders. Selective search for object recognition. In IJCV, 2013. [31] V. Vizing. On an estimate of the chromatic class of a p-graph. Diskret. Analiz., 3:25–30, 1964. [32] M. Weber, M. Welling, and P. Perona. Unsupervised Learning of Models for Recognition. In ECCV, 2000. [33] Y. Zhang and T. Chen. Efficient Kernels for Identifying Unbounded-order Spatial Features. In CVPR, 2009. [34] J. Zou, D. Hsu, D. Parkes, and R. Adams. Contrastive learning using spectral methods. In NIPS, 2013. 9
2014
37
5,480
Sparse PCA via Covariance Thresholding Yash Deshpande Electrical Engineering Stanford University yashd@stanford.edu Andrea Montanari Electrical Engineering and Statistics Stanford University montanari@stanford.edu Abstract In sparse principal component analysis we are given noisy observations of a lowrank matrix of dimension n × p and seek to reconstruct it under additional sparsity assumptions. In particular, we assume here that the principal components v1, . . . , vr have at most k1, · · · , kq non-zero entries respectively, and study the high-dimensional regime in which p is of the same order as n. In an influential paper, Johnstone and Lu [JL04] introduced a simple algorithm that estimates the support of the principal vectors v1, . . . , vr by the largest entries in the diagonal of the empirical covariance. This method can be shown to succeed with high probability if kq ≤C1 p n/ log p, and to fail with high probability if kq ≥C2 p n/ log p for two constants 0 < C1, C2 < ∞. Despite a considerable amount of work over the last ten years, no practical algorithm exists with provably better support recovery guarantees. Here we analyze a covariance thresholding algorithm that was recently proposed by Krauthgamer, Nadler and Vilenchik [KNV13]. We confirm empirical evidence presented by these authors and rigorously prove that the algorithm succeeds with high probability for k of order √n. Recent conditional lower bounds [BR13] suggest that it might be impossible to do significantly better. The key technical component of our analysis develops new bounds on the norm of kernel random matrices, in regimes that were not considered before. 1 Introduction In the spiked covariance model proposed by [JL04], we are given data x1, x2, . . . , xn with xi ∈Rp of the form1: xi = r X q=1 p βq uq,i vq + zi , (1) Here v1, . . . , vr ∈Rp is a set of orthonormal vectors, that we want to estimate, while uq,i ∼ N(0, 1) and zi ∼N(0, Ip) are independent and identically distributed. The quantity βq ∈R>0 quantifies the signal-to-noise ratio. We are interested in the high-dimensional limit n, p →∞with limn→∞p/n = α ∈(0, ∞). In the rest of this introduction we will refer to the rank one case, in order to simplify the exposition, and drop the subscript q = {1, 2, . . . , r}. Our results and proofs hold for general bounded rank. The standard method of principal component analysis involves computing the sample covariance matrix G = n−1 Pn i=1 xixT i and estimates v = v1 by its principal eigenvector vPC(G). It is a well-known fact that, in the high dimensional asymptotic p/n →α > 0, this yields an inconsistent 1Throughout the paper, we follow the convention of denoting scalars by lowercase, vectors by lowercase boldface, and matrices by uppercase boldface letters. 1 estimate [JL09]. Namely ∥vPC −v∥2 ̸→0 in the high-dimensional asymptotic limit, unless α →0 (i.e. p/n →0). Even worse, Baik, Ben-Arous and P´ech´e [BBAP05] and Paul [Pau07] demonstrate a phase transition phenomenon: if β < √α the estimate is asymptotically orthogonal to the signal ⟨vPC, v⟩→0. On the other hand, for β > √α, ⟨vPC, v⟩remains strictly positive as n, p →∞. This phase transition phenomenon has attracted considerable attention recently within random matrix theory [FP07, CDMF09, BGN11, KY13]. These inconsistency results motivated several efforts to exploit additional structural information on the signal v. In two influential papers, Johnstone and Lu [JL04, JL09] considered the case of a signal v that is sparse in a suitable basis, e.g. in the wavelet domain. Without loss of generality, we will assume here that v is sparse in the canonical basis e1, ...ep. In a nutshell, [JL09] proposes the following: 1. Order the diagonal entries of the Gram matrix Gi(1),i(1) ≥Gi(2),i(2) ≥· · · ≥Gi(p),i(p), and let J ≡{i(1), i(2), . . . , i(k)} be the set of indices corresponding to the k largest entries. 2. Set to zero all the entries Gi,j of G unless i, j ∈J, and estimate v with the principal eigenvector of the resulting matrix. Johnstone and Lu formalized the sparsity assumption by requiring that v belongs to a weak ℓq-ball with q ∈(0, 1). Instead, here we consider a strict sparsity constraint where v has exactly k non-zero entries, with magnitudes bounded below by θ/ √ k for some constant θ > 0. The case of θ = 1 was studied by Amini and Wainwright in [AW09]. Within this model, it was proved that diagonal thresholding successfully recovers the support of v provided v is sparse enough, namely k ≤C p n/ log p with C = C(α, β) a constant [AW09]. (Throughout the paper we denote by C constants that can change from point to point.) This result is a striking improvement over vanilla PCA. While the latter requires a number of samples scaling as the number of parameters2 n ≳p, sparse PCA via diagonal thresholding achieves the same objective with a number of samples scaling as the number of non-zero parameters, n ≳k2 log p. At the same time, this result is not as optimistic as might have been expected. By searching exhaustively over all possible supports of size k (a method that has complexity of order pk) the correct support can be identified with high probability as soon as n ≳k log p. On the other hand, no method can succeed for much smaller n, because of information theoretic obstructions [AW09]. Over the last ten years, a significant effort has been devoted to developing practical algorithms that outperform diagonal thresholding, see e.g. [MWA05, ZHT06, dEGJL07, dBG08, WTH09]. In particular, d’Aspremont et al. [dEGJL07] developed a promising M-estimator based on a semidefinite programming (SDP) relaxation. Amini and Wainwright [AW09] carried out an analysis of this method and proved that, if (i) k ≤C(β) n/ log p, and (ii) if the SDP solution has rank one, then the SDP relaxation provides a consistent estimator of the support of v. At first sight, this appears as a satisfactory solution of the original problem. No procedure can estimate the support of v from less than k log p samples, and the SDP relaxation succeeds in doing it from –at most– a constant factor more samples. This picture was upset by a recent, remarkable result by Krauthgamer, Nadler and Vilenchik [KNV13] who showed that the rank-one condition assumed by Amini and Wainwright does not hold for √n ≲k ≲(n/ log p). This result is consistent with recent work of Berthet and Rigollet [BR13] demonstrating that sparse PCA cannot be performed in polynomial time in the regime k ≳√n, under a certain computational complexity conjecture for the so-called planted clique problem. In summary, the problem of support recovery in sparse PCA demonstrates a fascinating interplay between computational and statistical barriers. From a statistical perspective, and disregarding computational considerations, the support of v can be estimated consistently if and only if k ≲n/ log p. This can be done, for instance, by exhaustive search over all the p k  possible supports of v. (See [VL12, CMW+13] for a minimax analysis.) 2Throughout the introduction, we write f(n) ≳g(n) as a shorthand of ‘f(n) ≥C g(n) for a some constant C = C(β, α)’. Further C denotes a constant that may change from point to point. 2 From a computational perspective, the problem appears to be much more difficult. There is rigorous evidence [BR13, MW13] that no polynomial algorithm can reconstruct the support unless k ≲√n. On the positive side, a very simple algorithm (Johnstone and Lu’s diagonal thresholding) succeeds for k ≲ p n/ log p. Of course, several elements are still missing in this emerging picture. In the present paper we address one of them, providing an answer to the following question: Is there a polynomial time algorithm that is guaranteed to solve the sparse PCA problem with high probability for p n/ log p ≲k ≲√n? We answer this question positively by analyzing a covariance thresholding algorithm that proceeds, briefly, as follows. (A precise, general definition, with some technical changes is given in the next section.) 1. Form the Gram matrix G and set to zero all its entries that are in modulus smaller than τ/√n, for τ a suitably chosen constant. 2. Compute the principal eigenvector bv1 of this thresholded matrix. 3. Denote by B ⊆{1, . . . , p} be the set of indices corresponding to the k largest entries of bv1. 4. Estimate the support of v by ‘cleaning’ the set B. (Briefly, v is estimated by thresholding GbvB with bvB obtained by zeroing the entries outside B.) Such a covariance thresholding approach was proposed in [KNV13], and is in turn related to earlier work by Bickel and Levina [BL08]. The formulation discussed in the next section presents some technical differences that have been introduced to simplify the analysis. Notice that, to simplify proofs, we assume k to be known: This issue is discussed in the next two sections. The rest of the paper is organized as follows. In the next section we provide a detailed description of the algorithm and state our main results. Our theoretical results assume full knowledge of problem parameters for ease of proof. In light of this, in Section 3 we discuss a practical implementation of the same idea that does not require prior knowledge of problem parameters, and is entirely datadriven. We also illustrate the method through simulations. The complete proofs are available in the accompanying supplement, in Sections 1, 2 and 3 respectively. 2 Algorithm and main result For notational convenience, we shall assume hereafter that 2n sample vectors are given (instead of n): {xi}1≤i≤2n. These are distributed according to the model (1). The number of spikes r will be treated as a known parameter in the problem. We will make the following assumptions: A1 The number of spikes r and the signal strengths β1, . . . , βr are fixed as n, p →∞. Further β1 > β2 > . . . βr are all distinct. A2 Let Qq and kq denote the support of vq and its size respectively. We let Q = ∪qQq and k = P q kq throughout. Then the non-zero entries of the spikes satisfy |vq,i| ≥θ/ p kq for all i ∈Qq for some θ > 0. Further, for any q, q′ we assume |vq,i/vq′,i| ≤γ for every i ∈Qq ∩Qq′, for some constant γ > 1. As before, we are interested in the high-dimensional limit of n, p →∞with p/n →α. A more detailed description of the covariance thresholding algorithm for the general model (1) is given in Algorithm 1. We describe the basic intuition for the simpler rank-one case (omitting the subscript q ∈{1, 2, . . . , r}), while stating results in generality. We start by splitting the data into two halves: (xi)1≤i≤n and (xi)n<i≤2n and compute the respective sample covariance matrices G and G′ respectively. As we will see, the matrix G is used to obtain a good estimate for the spike v. This estimate, along with the (independent) second part G′, is then used to construct a consistent estimator for the supports of v. 3 Let us focus on the first phase of the algorithm, which aims to obtain a good estimate of v. We first compute bΣ = G −I. For β > √α, the principal eigenvector of G, and hence of bΣ is positively correlated with v, i.e. limn→∞⟨bv1(bΣ), v⟩> 0. However, for β < √α, the noise component in bΣ dominates and the two vectors become asymptotically orthogonal, i.e. for instance limn→∞⟨bv1(bΣ), v⟩= 0. In order to reduce the noise level, we exploit the sparsity of the spike v. Denoting by X ∈Rn×p the matrix with rows x1, ...xn, by Z ∈Rn×p the matrix with rows z1, . . .zn, and letting u = (u1, u2, . . . , un), the model (1) can be rewritten as X = p β u vT + Z . (2) Hence, letting β′ ≡β∥u∥2/n ≈β, and w ≡√βZTu/n bΣ = β′ vvT + v wT + w vT + 1 nZTZ −Ip, . (3) For a moment, let us neglect the cross terms (vwT + wvT). The ‘signal’ component β′ vvT is sparse with k2 entries of magnitude β/k, which (in the regime of interest k = √n/C) is equivalent to Cβ/√n. The ‘noise’ component ZTZ/n −Ip is dense with entries of order 1/√n. Assuming k/√n a small enough constant, it should be possible to remove most of the noise by thresholding the entries at level of order 1/√n. For technical reasons, we use the soft thresholding function η : R × R≥0 →R, η(z; τ) = sgn(z)(|z| −τ)+. We will omit the second argument wherever it is clear from context. Classical denoising theory [DJ94, Joh02] provides upper bounds the estimation error of such a procedure. Note however that these results fall short of our goal. Classical theory measures estimation error by (element-wise) ℓp norm, while here we are interested in the resulting principal eigenvector. This would require bounding, for instance, the error in operator norm. Since the soft thresholding function η(z; τ/√n) is affine when z ≫τ/√n, we would expect that the following decomposition holds approximately (for instance, in operator norm): η(bΣ) ≈η β′vvT + η  1 nZTZ −Ip  . (4) The main technical challenge now is to control the operator norm of the perturbation η(ZTZ/n−Ip). It is easy to see that η(ZTZ/n −Ip) has entries of variance δ(τ)/n, for δ(τ) →0 as τ →∞. If entries were independent with mild decay, this would imply –with high probability– η  1 nZTZ  2 ≲Cδ(τ), (5) for some constant C. Further, the first component in the decomposition (4) is still approximately rank one with norm of the order of β′ ≈β. Consequently, with standard linear algebra results on the perturbation of eigenspaces [DK70], we obtain an error bound ∥bv −v∥≲δ(τ)/C′β Our first theorem formalizes this intuition and provides a bound on the estimation error in the principal components of η(bΣ). Theorem 1. Under the spiked covariance model Eq. (1) satisfying Assumption A1, let bvq denote the qth eigenvector of η(bΣ) using threshold τ. For every α, (βq)r q=1 ∈(0, ∞), integer r and every ε > 0 there exist constants, τ = τ(ε, α, (βq)r q=1, r, θ) and 0 < c∗= c∗(ε, α, (βq)r q=1, r, θ) < ∞ such that, if P q kq = P q |supp(vq)| ≤c∗ √n), then P n min(∥bvq −vq∥, ∥bvq + vq∥) ≤ε ∀q ∈{1, . . . , r} o ≥1 −α n4 . (6) Random matrices of the type η(ZTZ/n −Ip) are called inner-product kernel random matrices and have attracted recent interest within probability theory [EK10a, EK10b, CS12]. In this literature, the asymptotic eigenvalue distribution of a matrix f(ZTZ/n) is the object of study. Here f : R →R is a kernel function and is applied entry-wise to the matrix ZTZ/n, with Z a matrix as above. Unfortunately, these results cannot be applied to our problem for the following reasons: • The results [EK10a, EK10b] are perturbative and provide conditions under which the spectrum of f(ZTZ/n) is close to a rescaling of the spectrum of (ZTZ/n) (with rescaling 4 Algorithm 1 Covariance Thresholding 1: Input: Data (xi)1≤i≤2n, parameters r, (kq)q≤r ∈N, θ, τ, ρ ∈R≥0; 2: Compute the Gram matrices G ≡Pn i=1 xixT i /n , G′ ≡P2n i=n+1 xixT i /n; 3: Compute bΣ = G −Ip (resp. bΣ′ = G′ −Ip); 4: Compute the matrix η(bΣ) by soft-thresholding the entries of bΣ: η(bΣ)ij =      bΣij − τ √n if bΣij ≥τ/√n, 0 if −τ/√n < bΣij < τ/√n, bΣij + τ √n if bΣij ≤−τ/√n, 5: Let (bvq)q≤r be the first r eigenvectors of η(bΣ); 6: Define sq ∈Rp by sq,i = bvq,iI( bvq,i ≥θ/2 p kq ); 7: Output: bQ = {i ∈[p] : ∃q s.t. |(bΣ′sq)i| ≥ρ}. factors depending on the Taylor expansion of f close to 0). We are interested instead in a non-perturbative regime in which the spectrum of f(ZTZ/n) is very different from the one of (ZTZ/n) (and the Taylor expansion is trivial). • [CS12] consider n-dependent kernels, but their results are asymptotic and concern the weak limit of the empirical spectral distribution of f(ZTZ/n). This does not yield an upper bound on the spectral norm3 of f(ZTZ/n). Our approach to prove Theorem 1 follows instead the so-called ε-net method: we develop high probability bounds on the maximum Rayleigh quotient: max y∈Sp−1⟨y, η(ZTZ/n)y⟩= max y∈Sp−1 X i,j η ⟨˜zi,˜zj⟩ n ; τ √n  yiyj, Here Sp−1 = {y ∈Rp : ∥y∥= 1} is the unit sphere and ˜zi denote the columns of Z. Since η(ZTZ/n) is not Lipschitz continuous in the underlying Gaussian variables Z, concentration does not follow immediately from Gaussian isoperimetry. We have to develop more careful (non-uniform) bounds on the gradient of η(ZTZ/n) and show that they imply concentration as required. While Theorem 1 guarantees that bv is a reasonable estimate of the spike v in ℓ2 distance (up to a sign flip), it does not provide a consistent estimator of its support. This brings us to the second phase of our algorithm. Although bv is not even expected to be sparse, it is easy to see that the largest entries of bv should have significant overlap with supp(v). Steps 6, 7 and 8 of the algorithm exploit this property to construct a consistent estimator bQ of the support of the spike v. Our second theorem guarantees that this estimator is indeed consistent. Theorem 2. Consider the spiked covariance model of Eq. (1) satisfying Assumptions A1, A2. For any α, (βq)q≤r ∈(0, ∞), θ, γ > 0 and integer r, there exist constants c∗, τ, ρ dependent on α, (βq)q≤r, γ, θ, r, such that, if P q kq = |supp(vq)| ≤c∗ √n, the Covariance Thresholding algorithm of Table 1 recovers the joint supports of vq with high probability. Explicitly, there exists a constant C > 0 such that P n bQ = ∪qsupp(vq) o ≥1 −C n4 . (7) Given the results above, it is useful to pause for a few remarks. Remark 2.1. We focus on a consistent estimation of the joint supports ∪qsupp(vq) of the spikes. In the rank-one case, this obviously corresponds to the standard support recovery. Once this is accomplished, estimating the individual supports poses no additional difficulty: indeed, since | ∪q supp(vq))| = O(√n) an extra step with n fresh samples xi restricted to bQ yields estimates for vq 3Note that [CS12] also provide a finite n bound for the spectral norm of f(ZTZ/n) via the moment method, but this bound diverges with n and does not give a result of the type of Eq. (5). 5 with ℓ2 error of order p k/n. This implies consistent estimation of supp(vq) when vq have entries bounded below as in Assumption A2. Remark 2.2. Recovering the signed supports Qq,+ = {i ∈[p] : vq,i > 0} and Qq,−= {i ∈ [p] : vq,i < 0} is possible using the same technique as recovering the supports supp(vq) above, and poses no additional difficulty. Remark 2.3. Assumption A2 requires |vq,i| ≥θ/ p kq for all i ∈Qq. This is a standard requirement in the support recovery literature [Wai09, MB06]. The second part of assumption A2 guarantees that when the supports of two spikes overlap, their entries are roughly of the same order. This is necessary for our proof technique to go through. Avoiding such an assumption altogether remains an open question. Our covariance thresholding algorithm assumes knowledge of the correct support sizes kq. Notice that the same assumption is made in earlier theoretical, e.g. in the analysis of SDP-based reconstruction by Amini and Wainwright [AW09]. While this assumption is not realistic in applications, it helps to focus our exposition on the most challenging aspects of the problem. Further, a ballpark estimate of kq (indeed P q kq) is actually sufficient, with which we use the following steps in lieu of Steps 7, 8 of Algorithm 1. 7: Define s′ q ∈Rp by s′ q,i = bvq,i if |bvq,i| > θ/(2√k0) 0 otherwise. (8) 8: Return bQ = ∪q{i ∈[p] : |(bΣ′s′ q)i| ≥ρ} . (9) The next theorem shows that this procedure is effective even if k0 overestimates P q kq by an order of magnitude. Its proof is deferred to Section 2. Theorem 3. Consider the spiked covariance model of Eq. (1). For any α, β ∈(0, ∞), let constants c∗, τ, ρ be given as in Theorem 2. Further assume k = P q |supp(vq)| ≤c∗ √n, and P q k ≤k0 ≤ 20 P q kq. Then, the Covariance Thresholding algorithm of Table 1, with the definitions in Eqs. (8) and (9), recovers the joint supports of vq successfully, i.e. P  bQ = ∪qsupp(vq)  ≥1 −C n4 . (10) 3 Practical aspects and empirical results Specializing to the rank one case, Theorems 1 and 2 show that Covariance Thresholding succeeds with high probability for a number of samples n ≳k2, while Diagonal Thresholding requires n ≳ k2 log p. The reader might wonder whether eliminating the log p factor has any practical relevance or is a purely conceptual improvement. Figure 1 presents simulations on synthetic data under the strictly sparse model, and the Covariance Thresholding algorithm of Table 1, used in the proof of Theorem 2. The objective is to check whether the log p factor has an impact at moderate p. We compare this with Diagonal Thresholding. We plot the empirical success probability as a function of k/√n for several values of p, with p = n. The empirical success probability was computed by using 100 independent instances of the problem. A few observations are of interest: (i) Covariance Thresholding appears to have a significantly larger success probability in the ‘difficult’ regime where Diagonal Thresholding starts to fail; (ii) The curves for Diagonal Thresholding appear to decrease monotonically with p indicating that k proportional to √n is not the right scaling for this algorithm (as is known from theory); (iii) In contrast, the curves for Covariance Thresholding become steeper for larger p, and, in particular, the success probability increases with p for k ≤1.1√n. This indicates a sharp threshold for k = const · √n, as suggested by our theory. In terms of practical applicability, our algorithm in Table 1 has the shortcomings of requiring knowledge of problem parameters βq, r, kq. Furthermore, the thresholds ρ, τ suggested by theory need not 6 0.5 1 1.5 2 0.2 0.4 0.6 0.8 1 k/√n Fraction of support recovered p = 625 p = 1250 p = 2500 p = 5000 0.5 1 1.5 2 0 0.2 0.4 0.6 0.8 1 k/√n Fraction of support recovered p = 625 p = 1250 p = 2500 p = 5000 0.5 1 1.5 2 0 0.2 0.4 0.6 0.8 1 k/√n Fraction of support recovered p = 625 p = 1250 p = 2500 p = 5000 Figure 1: The support recovery phase transitions for Diagonal Thresholding (left) and Covariance Thresholding (center) and the data-driven version of Section 3 (right). For Covariance Thresholding, the fraction of support recovered correctly increases monotonically with p, as long as k ≤c√n with c ≈1.1. Further, it appears to converge to one throughout this region. For Diagonal Thresholding, the fraction of support recovered correctly decreases monotonically with p for all k of order √n. This confirms that Covariance Thresholding (with or without knowledge of the support size k) succeeds with high probability for k ≤c√n, while Diagonal Thresholding requires a significantly sparser principal component. be optimal. We next describe a principled approach to estimating (where possible) the parameters of interest and running the algorithm in a purely data-dependent manner. Assume the following model, for i ∈[n] xi = µ + X q p βquq,ivq + σzi, where µ ∈Rp is a fixed mean vector, ui have mean 0 and variance 1, and zi have mean 0 and covariance Ip. Note that our focus in this section is not on rigorous analysis, but instead to demonstrate a principled approach to applying covariance thresholding in practice. We proceed as follows: Estimating µ, σ: We let bµ = Pn i=1 xi/n be the empirical mean estimate for µ. Further letting X = X −1bµT we see that pn −(P q kq)n ≈pn entries of X are mean 0 and variance σ2. We let bσ = MAD(X)/ν where MAD( · ) denotes the median absolute deviation of the entries of the matrix in the argument, and ν is a constant scale factor. Guided by the Gaussian case, we take ν = Φ−1(3/4) ≈0.6745. Choosing τ: Although in the statement of the theorem, our choice of τ depends on the SNR β/σ2, we believe this is an artifact of our analysis. Indeed it is reasonable to threshold ‘at the noise level’, as follows. The noise component of entry i, j of the sample covariance (ignoring lower order terms) is given by σ2⟨zi, zj⟩/n. By the central limit theorem, ⟨zi, zj⟩/√n d⇒N(0, 1). Consequently, σ2⟨zi, zj⟩/n ≈N(0, σ4/n), and we need to choose the (rescaled) threshold proportional to √ σ4 = σ2. Using previous estimates, we let τ = ν′ · bσ2 for a constant ν′. In simulations, a choice 3 ≲ν′ ≲4 appears to work well. Estimating r: We define bΣ = X TX/n −σ2Ip and soft threshold it to get η(bΣ) using τ as above. Our proof of Theorem 1 relies on the fact that η(bΣ) has r eigenvalues that are separated from the bulk of the spectrum4. Hence, we estimate r using br: the number of eigenvalues separated from the bulk in η(bΣ). Estimating vq: Let bvq denote the qth eigenvector of η(bΣ). Our theoretical analysis indicates that bvq is expected to be close to vq. In order to denoise bvq, we assume bvq ≈(1 −δ)vq + εq, where εq is additive random noise. We then threshold vq ‘at the noise level’ to recover a better estimate of vq. To do this, we estimate the standard deviation of the “noise” ε by c σε = MAD(vq)/ν. Here we set –again guided by the Gaussian heuristic– ν ≈0.6745. Since vq is sparse, this procedure returns a good estimate for the size of the noise deviation. We let ηH(bvq) denote the vector obtained by hard thresholding bvq: set 4The support of the bulk spectrum can be computed numerically from the results of [CS12]. 7 (ηH(bvq))i = bvq,i if |bvq,i| ≥ν′ c σεq and 0 otherwise. We then let bv∗ q = η(bvq)/ ∥η(bvq)∥and return bv∗ q as our estimate for vq. Note that –while different in several respects– this empirical approach shares the same philosophy of the algorithm in Table 1. On the other hand, the data-driven algorithm presented in this section is less straightforward to analyze, a task that we defer to future work. Figure 1 also shows results of a support recovery experiment using the ‘data-driven’ version of this section. Covariance thresholding in this form also appears to work for supports of size k ≤ const√n. Figure 2 shows the performance of vanilla PCA, Diagonal Thresholding and Covariance Thresholding on the “Three Peak” example of Johnstone and Lu [JL04]. This signal is sparse in the wavelet domain and the simulations employ the data-driven version of covariance thresholding. A similar experiment with the “box” example of Johnstone and Lu is provided in the supplement. These experiments demonstrate that, while for large values of n both Diagonal Thresholding and Covariance Thresholding perform well, the latter appears superior for smaller values of n. 0 1,000 2,000 3,000 4,000 −5 · 10−2 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 0 0.1 0.2 0.3 0 1,000 2,000 3,000 4,000 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 −5 · 10−2 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 −5 · 10−2 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 0 5 · 10−2 0.1 0 1,000 2,000 3,000 4,000 0 5 · 10−2 0.1 n = 1024 n = 1625 n = 2580 n = 4096 PCA DT CT Figure 2: The results of Simple PCA, Diagonal Thresholding and Covariance Thresholding (respectively) for the “Three Peak” example of Johnstone and Lu [JL09] (see Figure 1 of the paper). The signal is sparse in the ‘Symmlet 8’ basis. We use β = 1.4, p = 4096, and the rows correspond to sample sizes n = 1024, 1625, 2580, 4096 respectively. Parameters for Covariance Thresholding are chosen as in Section 3, with ν′ = 4.5. Parameters for Diagonal Thresholding are from [JL09]. On each curve, we superpose the clean signal (dotted). References [AW09] Arash A Amini and Martin J Wainwright, High-dimensional analysis of semidefinite relaxations for sparse principal components, The Annals of Statistics 37 (2009), no. 5B, 2877–2921. [BBAP05] Jinho Baik, G´erard Ben Arous, and Sandrine P´ech´e, Phase transition of the largest eigenvalue for nonnull complex sample covariance matrices, Annals of Probability (2005), 1643–1697. 8 [BGN11] Florent Benaych-Georges and Raj Rao Nadakuditi, The eigenvalues and eigenvectors of finite, low rank perturbations of large random matrices, Advances in Mathematics 227 (2011), no. 1, 494–521. [BL08] Peter J Bickel and Elizaveta Levina, Regularized estimation of large covariance matrices, The Annals of Statistics (2008), 199–227. [BR13] Quentin Berthet and Philippe Rigollet, Computational lower bounds for sparse pca, arXiv preprint arXiv:1304.0828 (2013). [CDMF09] Mireille Capitaine, Catherine Donati-Martin, and Delphine F´eral, The largest eigenvalues of finite rank deformation of large wigner matrices: convergence and nonuniversality of the fluctuations, The Annals of Probability 37 (2009), no. 1, 1–47. [CMW+13] T Tony Cai, Zongming Ma, Yihong Wu, et al., Sparse pca: Optimal rates and adaptive estimation, The Annals of Statistics 41 (2013), no. 6, 3074–3110. [CS12] Xiuyuan Cheng and Amit Singer, The spectrum of random inner-product kernel matrices, arXiv preprint arXiv:1202.3155 (2012). [dBG08] Alexandre d’Aspremont, Francis Bach, and Laurent El Ghaoui, Optimal solutions for sparse principal component analysis, The Journal of Machine Learning Research 9 (2008), 1269–1294. [dEGJL07] Alexandre d’Aspremont, Laurent El Ghaoui, Michael I Jordan, and Gert RG Lanckriet, A direct formulation for sparse pca using semidefinite programming, SIAM review 49 (2007), no. 3, 434– 448. [DJ94] D. L. Donoho and I. M. Johnstone, Minimax risk over lp balls, Prob. Th. and Rel. Fields 99 (1994), 277–303. [DK70] Chandler Davis and W. M. Kahan, The rotation of eigenvectors by a perturbation. iii, SIAM Journal on Numerical Analysis 7 (1970), no. 1, pp. 1–46. [EK10a] Noureddine El Karoui, On information plus noise kernel random matrices, The Annals of Statistics 38 (2010), no. 5, 3191–3216. [EK10b] , The spectrum of kernel random matrices, The Annals of Statistics 38 (2010), no. 1, 1–50. [FP07] Delphine F´eral and Sandrine P´ech´e, The largest eigenvalue of rank one deformation of large wigner matrices, Communications in mathematical physics 272 (2007), no. 1, 185–228. [JL04] Iain M Johnstone and Arthur Yu Lu, Sparse principal components analysis, Unpublished manuscript (2004). [JL09] , On consistency and sparsity for principal components analysis in high dimensions, Journal of the American Statistical Association 104 (2009), no. 486. [Joh02] IM Johnstone, Function estimation and gaussian sequence models, Unpublished manuscript 2 (2002), no. 5.3, 2. [KNV13] R. Krauthgamer, B. Nadler, and D. Vilenchik, Do semidefinite relaxations really solve sparse pca?, CoRR abs/1306:3690 (2013). [KY13] Antti Knowles and Jun Yin, The isotropic semicircle law and deformation of wigner matrices, Communications on Pure and Applied Mathematics (2013). [MB06] Nicolai Meinshausen and Peter B¨uhlmann, High-dimensional graphs and variable selection with the lasso, The Annals of Statistics (2006), 1436–1462. [MW13] Zongming Ma and Yihong Wu, Computational barriers in minimax submatrix detection, arXiv preprint arXiv:1309.5914 (2013). [MWA05] Baback Moghaddam, Yair Weiss, and Shai Avidan, Spectral bounds for sparse pca: Exact and greedy algorithms, Advances in neural information processing systems, 2005, pp. 915–922. [Pau07] Debashis Paul, Asymptotics of sample eigenstructure for a large dimensional spiked covariance model, Statistica Sinica 17 (2007), no. 4, 1617. [VL12] Vincent Q Vu and Jing Lei, Minimax rates of estimation for sparse pca in high dimensions, Proceedings of the 15th International Conference on Artificial Intelligence and Statistics (AISTATS) 2012, 2012. [Wai09] Martin J Wainwright, Sharp thresholds for high-dimensional and noisy sparsity recovery usingconstrained quadratic programming (lasso), Information Theory, IEEE Transactions on 55 (2009), no. 5, 2183–2202. [WTH09] Daniela M Witten, Robert Tibshirani, and Trevor Hastie, A penalized matrix decomposition, with applications to sparse principal components and canonical correlation analysis, Biostatistics 10 (2009), no. 3, 515–534. [ZHT06] Hui Zou, Trevor Hastie, and Robert Tibshirani, Sparse principal component analysis, Journal of computational and graphical statistics 15 (2006), no. 2, 265–286. 9
2014
370
5,481
Randomized Experimental Design for Causal Graph Discovery Huining Hu School of Computer Science, McGill University. huining.hu@mail.mcgill.ca Zhentao Li LIENS, ´Ecole Normale Sup´erieure zhentao.li@ens.fr Adrian Vetta Department of Mathematics and Statistics and School of Computer Science, McGill University. vetta@math.mcgill.ca Abstract We examine the number of controlled experiments required to discover a causal graph. Hauser and Buhlmann [1] showed that the number of experiments required is logarithmic in the cardinality of maximum undirected clique in the essential graph. Their lower bounds, however, assume that the experiment designer cannot use randomization in selecting the experiments. We show that significant improvements are possible with the aid of randomization – in an adversarial (worst-case) setting, the designer can then recover the causal graph using at most O(log log n) experiments in expectation. This bound cannot be improved; we show it is tight for some causal graphs. We then show that in a non-adversarial (average-case) setting, even larger improvements are possible: if the causal graph is chosen uniformly at random under a Erd¨os-R´enyi model then the expected number of experiments to discover the causal graph is constant. Finally, we present computer simulations to complement our theoretic results. Our work exploits a structural characterization of essential graphs by Andersson et al. [2]. Their characterization is based upon a set of orientation forcing operations. Our results show a distinction between which forcing operations are most important in worst-case and average-case settings. 1 Introduction We are given n random variables V = {V1, V2, . . . , Vn} and would like to learn the causal relations between these variables. Assume the dependencies between the variables can be represented as a directed acyclic graph G = (V, A), known as the causal graph. In seminal work, Sprites, Glymour, and Scheines [3] present methods to obtain structural information on G from passive observational data. In general, however, observational data can be used to discover only a part of the causal graph G; specifically, observation data will recover the essential graph E(G). To recover the entire causal graph G we may undertake experiments. Here, an experiment is a controlled intervention on a subset S of the variables. A controlled intervention allows us to deduce information about which variables S influences. The focus of this paper is to understand how many experiments are required to discover G. This line of research was initiated in a series of works by Eberhardt, Glymour, and Scheines (see [4, 5, 6]). First, they showed [4] that n −1 experiments suffice when interventions can only be made upon singleton variables. For general experiments, they proved [5] that ⌈log n⌉experiments are sufficient and, in the worst case necessary, to discover G. Eberhardt [7] then conjectured that ⌈log(ω(G))⌉ 1 experiments are sufficient and, in the worst case, necessary; here ω(G) is the size of a maximum clique in G.1 Hauser and Buhlmann [1] recently proved (a slight strengthening of) this conjecture. The essential mathematical concepts underlying this result can be traced back to work of Cai [8] on “separating systems” [9]; see also Hyttinen et al. [10]. Eberhardt [11] proposed the use of randomization (mixed strategies) in causal graph discovery. He proved that, if the designer is restricted to single-variable interventions, the worst case expected number of experiments required is Θ(n). Eberhardt [11] considered multi-variable interventions to be “far more complicated” to analyze, but hypothesized that O(log n) experiments may be sufficient, in that setting, in the worst-case. 1.1 Our Results The purpose of this paper is to show that the lower bounds of [5] and [1] are not insurmountable. In essence, those lower bounds are based upon the causal graph being constructed by a powerful adversary. This adversary must pre-commit to the causal graph in advance but, before doing so, it has access to the entire list of experiments S = {S1, S2, . . . } that the experiment designer will use; here Si ⊆V for all i. (This adversary also describes the “separating system” model of causal discovery. In Section 2.4 we will explain how this adversary can also be viewed as adaptive. The adversary may be given the list of experiments in order over time, but at time i it needs only commit to the arcs in δ(Si), the set of edges with exactly one end-vertex in Si.) Our first result is that we show this powerful adversary can be tricked if the experiment designer uses randomization in selecting the experiments. Specifically, suppose the designer selects the experiments {S1, S2, . . . } from a collection of probability distributions P = {P1, P2, . . . }, respectively, where distribution Pi+1 may depend upon the results of experiments 1, 2 . . . , i. Then, even if the adversary has access to the list of probability distributions P before it commits to the causal graph G, the expected number of experiments required to recover G falls significantly. Specifically, if the designer uses randomization then, in the worst case, only at most O(log log n) experiments in expectation are required. This result is given in Section 3, after we have presented the necessary background on causal graphs and experiments in Section 2. We also prove our lower bound is tight. This worst case result immediately extends to the case where the adversary is also allowed to use randomization in selecting the causal graph. Thus, the O(log log n) bound applies to mixed-strategy equilibria in the game framework [11] where multi-variable interventions are allowed. Our second result is that even more dramatic improvements are possible if the causal graph is nonadversarial. For a typical causal graph needs only a constant number of experiments are required in expectation! Specifically, if the directed acyclic graph is random, based upon an underlying Erd¨osR´enyi model, then O(1) experiments in expectation are required to discover G. We prove this result in Section 4. Our work exploits a structural characterization of essential graphs by Andersson et al. [2]. Their characterization is based upon a set of four operations. One operation is based upon acyclicity, the other three are based upon v-shapes. Our results show that the acyclicity operation is most important in improving worst-case bounds, but the v-shape operations are more important for average-case bounds. This conclusion is highlighted by our simulation results in Section 5. These simulations confirm that, by exploiting the v-shape operations, causal graph discovery is extremely quick in the non-adversarial setting. In fact, the constant in the O(1) average-case guarantee may be even better than our theoretical results suggest. Typically, it takes one or two experiments to discover a causal graph on 15000 vertices! 2 Background Suppose we want to discover an (unknown) directed acyclic graph G = (V, A) and we are given its observational data. Without experimentation, we may not be able to recover all of G from its observation data. But we can deduce a subgraph of it known as the essential graph E(G). In this section, we describe this process and explain how experiments (deterministic or randomized) can then be used to recover the rest of the graph. Throughout this paper, we assume the causal graph 1A directed graph is a clique if its underlying undirected graph is a (undirected) clique. 2 and data distribution obey the faithfulness assumption and causal sufficiency [3]. The faithfulness assumption ensures that all independence relationships revealed by the data are results of the causal structure and are not due to some coincidental combinations of parameters. Causal sufficiency means there are no latent (that is, hidden) variables. These assumptions are important as they provide a one to one mapping between data and causal structure. 2.1 Observational Equivalence First we may discover the skeleton and all the v-structures of G. To explain this, we begin with some definitions. The skeleton of G is the undirected graph on V with an undirected edge (between the same endpoints) for each arc of A. A v-shape in a graph (directed or undirected) is an ordered set (a, b, c) of three distinct vertices with exactly two edges (arcs), both incident to b. The v-structures, sometimes called immoralities [2], are the set of v-shapes (a, b, c) where ab and cb are arcs. Two directed graphs with indistinguishable by observational data are said to belong to the same Markov equivalence class. Specifically, Verma and Pearl [12] and Frydenberg [13] showed the skeleton and the set of v-structures determine which equivalence class G belongs to. Theorem 2.1. (Observational Equivalence) G and H are in the same Markov equivalence class if and only if they have the same skeletons and the same sets of v-structures. Because of this equivalence, we will think of an observational Markov equivalence class as given by the skeleton and the set of (all) v-structures. From the observational data it is straightforward [12] to obtain the basic graph B(G), a mixed graph2 obtained from the skeleton of G by orienting the edges in each v-structure. For example, to test for an edge {i, j}, simply check there is no d-separator for i and j; to test for a v-structure (i, k, j), simply check that there is no d-separator for i and j that contains k. (These tests are not polynomial time. However, this is not relevant for the question we address in this paper.) 2.2 The Essential Graph In fact, from the observational data we may orient more edges than simply those in the basic graph B(G). Specifically we can obtain the essential graph E(G). The essential graph is a mixed graph that also includes every edge orientation that is present in every directed acyclic graph that is compatible with the data. That is, an edge is oriented if and only if it has the same orientation in every graph in the equivalence class. For example, an edge {a, b} is forced to be oriented as the arc ab for the following reasons. (F1) The arc ab (and the arc cb) is forced if it belongs to a v-structure (a, b, c). (F2) There is a v-shape (b, a, c) but it is not a v-structure. Then arc ab is forced if ca is an arc. (F3) The arc ab is forced, by acyclicity, if there is already a directed path P from a to b. (F4) There is a v-shape (c1, a, c2) but it is not a v-structure. Then the arc ab is forced if there are directed paths Q1 and Q2 from c1 to b and from c2 to b, respectively. The reader can find illustrations of these forcing mechanisms in Figure 2 of the supplemental material. Andersson et al. [2] showed that these are the only ways to force an edge to become oriented. In fact, they characterize essential graphs and show only local versions of (F3) and (F4) are needed to obtain the essential graph – that is, it suffices to assume the path P has two arcs and the paths Q1 and Q2 have only one arc each. Let U(G) be the subgraph induced by the undirected edges of the essential graph E(G). For simplicity, we will generally just use the notation B, E and U. From the characterization, it can be shown that U is a chordal graph.3 We remark that this chordality property is extremely useful in quantitatively analyzing the performance of the experiments we design. In particular, the size of the maximum clique and the chromatic number can be computed in linear time. Corollary 2.2. [2] The subgraph U is chordal. 2A mixed graph contains oriented edges and unoriented edges. To avoid confusion, we refer to oriented edges as arcs. 3A graph H is chordal if every induced cycle in H contains exactly three vertices. That is, every cycle C on at least four vertices has a chord, an edge not in C that connects two vertices of the cycle. 3 2.3 Experimental Design So observation data (the null experiment) will give us the essential graph E. If we perform experiments then we may recover the entire causal graph G and, in a series of works, Eberhardt, Glymour, and Scheines [5, 4, 6] investigated the number of experiments required to achieve this. An experiment is a controlled intervention that forces a distribution, chosen by the designer, on a set S ⊂V . A key fact is that, given the existence of an edge (a, b) in G, an experiment on S can perform a directional test on (a, b) if (a, b) ∈δ(S) (that is, if exactly one endpoint of the edge is in S); see [5] for more details. Recall that we already know the skeleton of G from the observational data. Thus, we can determine the existence of every edge in G. It then follows that to recover the entire causal graph it suffices that (Ψ) Each edge undergoes one directional test. The separating systems method is based on this sufficiency condition (Ψ). Using this condition, it is known that log n experiments suffice [5]. In fact, this bound can be improved to log ω(U), where ω(U) is the size of the maximum clique in the undirected subgraph U of the essential graph E. For completeness we show this result here; see also [8] and [1]. Theorem 2.3. We can recover G using log ω(U) experiments. Proof. First use the observational data to obtain the skeleton of G. To find the orientation of each edge, take a vertex colouring c : V (U) →{0, 1, . . . , χ(U) −1}, where χ(U) is the chromatic number of U. We use this colouring to define our experiments. Specifically, for the ith experiment, select all vertices whose colour is 1 in the ith bit. That is, select Si = {v : bini(c(v)) = 1}, where bini extracts the ith bit of a number. Now, if vertices u and v are adjacent in U, they receive different colours and consequently their colours differ at some bit j. Thus, in the jth experiment, one of u, v is selected in Sj and the other is not. This gives a directional test for the edge {u, v}. Therefore, from all the experiments we find the orientation of every edge. The result follows from the fact that chordal graphs are perfect (see, for example, [14]). But (Ψ) is just a sufficiency condition for recovering the entire causal graph G; it need not be necessary to perform a directional test on every edge. Indeed, we may already know some edge orientations from the essential graph E via the forcing operations (F1), (F2), (F3) and (F4). Furthermore, the experiments we carry out will force some more edge orientations. But then we may again apply the forcing operations (F1)-(F4) incorporating these new arcs to obtain even more orientations. Let S = {S1, S2, . . . Sk}, where Si ⊆V for all 1 ≤i ≤k, be a collection of experiments, Then the experimental graph is a mixed graph that includes every edge orientation that is present in every directed acyclic graph that is compatible with the data and the experiments S. We denote the experimental graph by E+ S (G). Thus the question Eberhardt, Glymour, and Scheines pose is: how many experiments are needed to ensure that E+ S (G) = G? As before, we know how to find the experimental graph. Theorem 2.4. The experimental graph E+ S (G) is obtained by repeatedly applying rules (F1)–(F4) along with the rule: (F0) There is an experiment Si ∈S and an edge (a, b), with a ∈Si and b /∈Si. Then either the arc ab or the arc ba is forced depending upon the outcome of the experiment. We note that the proof uses the fact that arcs forced by (F0) are the union of edges across a set of cuts; without this property, a fourth forcing rule may be needed [15]. Theorem 2.4 suggests that it may be possible to improve upon the log ω(U) upper bound. Unfortunately, Hauser and Buhlmann [1] show using an adversarial argument that in the worst case there is a matching lower bound, settling a conjecture of Eberhardt [6]. 2.4 Randomized Experimental Design As discussed in the introduction, the lower bounds of [5] and [1] are generated via a powerful adversary. The adversary must pre-commit to the causal graph in advance but, before doing so, it has access to the entire list of experiments S = {S1, S2, . . . } that the experiment designer will use. For example, assume that the adversary choses a clique for G and the experiment designer selects a collection of experiments S = {S1, S2, . . . }. Given the knowledge of S then, for a worst case performance, the adversary will direct every edge in δ(S1) from S1 to V \ S1. The adversary will 4 then direct every edge in δ(S2) (that has yet to be assigned an orientation) from S2 to V \ S2, etc. It is not difficult to show that the designer will need to implement at least log n of the experiments. We remark that there is an alternative way to view the adversary. It need commit only to the essential graph in advance but otherwise may adaptively commit the rest of the graph over time. In particular, at time i, after experiment Si is conducted it must commit only to the arcs in δ(Si) and to any induced forcings. This second adversary is clearly weaker than the first, but the lower bounds of [5] and [1] still apply here. Again, though, even this form of adversary appears unnaturally strong in the context of causal graphs. In particular, given the random variables V the causal relations between them are pre-determined. They are already naturally present before the experimentation begins, and thus it seems appropriate to insist that the adversary pre commit to the graph rather than construct it adaptively. Regardless, both of these adversaries can be countered if the designer uses randomization in selecting the experiments. In particular, in randomized experimental design we allow the designer to select the experiments {S1, S2, . . . } from a collection of probability distributions P = {P1, P2, . . . }, respectively, where distribution Pi+1 may depend upon the results of experiments 1, 2 . . . , i. As an example, consider again the case in which the adversary selects a clique. Suppose now that the designer selects the first experiment S1 uniformly at random from the collection of subsets of cardinality 1 2n. Even given this knowledge, it is less obvious how the adversary should act against such a design. Indeed, in this article we show the usefulness of the randomized approach. It will allow the designer to require only O(log log n) experiments in expectation. This is the case even if the adversary has access to the entire list of probability distributions P before it commits to the causal graph G. We prove this in Section 3. Thus, by Theorem 2.3, we have that min[O(log log n), log ω(U)] experiments are sufficient. We also prove that this bound is tight; there are graphs for which min[O(log log n), log ω(U)] experiments are necessary. Still our new lower bound only applies to causal graphs selected adversarially. For a typical causal graph we can do even better. Specifically, we prove, in Section 4, that for a random causal graph a constant number of experiments is sufficient in expectation. Consequently, for a random causal graph the number of experiments required is independent of the number of vertices in the graph! This surprising result is confirmed by our simulations. For various values n of number of vertices, we construct numerous random causal graphs and compute the average and maximum number of experiments needed to discover them. Simulations confirm this number does not increase with n. Our results can be viewed in the game theoretic framework of Eberhardt [11], where the adversary selects a probability distribution (mixed strategy) over causal graphs and the experiment designer choses a distribution over which experiments to run. In this zero-sum game, the payoff to the designer is the negative of the number of experiments needed. The worst case setting corresponds to the situation where the adversary can choose any distribution over causal graphs. Thus, our result implies a worst case −Θ(log log n) bound on the value of a game with multi-variable interventions and no latent variables. Therefore, the ability to randomize turns out to be much more helpful to the designer than the adversary. Our average case O(1) bound corresponds to the situation where the adversary in the game is restricted to choose the uniform distribution over causal graphs. 3 Randomized Experimental Design 3.1 Improving the Upper Bound by Exploiting Acyclicity We now show randomization significantly reduces the number of experiments required to find the causal graph. To improve upon the log χ(U) bound, recall that (Ψ) is a sufficient but not necessary condition. In fact, we will not need to apply directional tests to every edge. Given some edge orientations we may obtain other orientations for free by acyclicity or by exploiting the characterization of [2]. Here we show that the acyclicity forcing operation (F3) on its own provides for significant speed-ups when we allow randomisation. Theorem 3.1. To orient a clique on t vertices, O(log log t) experiments suffice in expectation. Proof. Let {x1, x2, . . . , xt} be the true acyclic ordering of the clique G. Now take a random experiment S, where each vertex is independently selected in S with probability 1 2. The experiment S partitions the ordering into runs (streaks) – contiguous segments of {x1, x2, . . . , xt} where either 5 every vertex of the segment is in S or every vertex of the segment is in ¯S = V \ S. Without loss of generality the first run is in S and we denote it by R0. We denote the second run, which is in ¯S, by ¯R0, the third run by R1, the fourth run by ¯R1 etc. A well known fact (see, for example, [16]) is that, with high probability, the longest run has length Θ(log t). Take any pair of vertices u and v. We claim that edge {u, v} can be oriented provided the two vertices are in different runs. To see this first observe that the experiment will orient any edge between S and ¯S. Thus if u ∈Ri and v ∈¯Rj, or vice versa, then we may orient {u, v}. Assume u ∈Ri and v ∈Rj, where i < j. We know {i, j} must be the arc ij, but how do we conclude this from our experiment? Well, take any vertex w ∈¯Ri. Because G is a clique there are edges {u, w} and {v, w}. But these edges have already been oriented as uw and wv by the experiment. Thus, by acyclicity the arc uv is forced. A similar argument applies for u ∈¯Ri and v ∈¯Rj, where i < j. It follows that the only edges that cannot be oriented lie between vertices within the same run. Each run induces an undirected clique after the experiment, but each such clique has cardinality O(log t) with high probability. We can now independently and simultaneously apply the deterministic method of Theorem 2.3 to orient the edges in each of these cliques using O(log log t) experiments. Hence the entire graph is oriented using 1 + O(log log t) experiments. We note that if any high probability event does not occur, we simply restart with new random variables, at most doubling the number of experiments (and tripling if it happens again and so on). The expected number of experiments is then the number we get with no restart multiplied by P i ipi, which is bounded by a constant (usually approaching 1 if p is a decreasing function of t). Theorem 3.1 applies to cliques. The same guarantee, however, can be obtained for any graph. Theorem 3.2. To construct G, O(log log n) experiments suffice in expectation. Proof. Take any graph G with n vertices. Recall, we only need orient the edges of the chordal graph U. But a chordal graph contains at most n maximal cliques [14] (each of size t ≤n). Suppose we perform the randomized experiment where each vertex is independently selected in S with probability 1 2, as in Theorem 3.1. Then any vertex of a maximal clique Q is in S with probability 1 2. Thus, this experiment breaks Q into runs all of cardinality at most O(log n) with high probability.4 Since there are only n maximal cliques, applying the union bound gives that every maximal clique in U is broken up into runs of cardinality O(log n) with high probability. Therefore, since every clique is a subgraph of a maximal clique, after a single randomized experiment, the chordal graph U′ formed by the remaining undirected edges has ω = O(log n). We can now independently apply Theorem 2.3 on U′ to orient the remaining edges using O(log log n) experiments. We can also iteratively exploit the essential graph characterization [2] but in the worst case we will have no v-structures and so the expected bound above will not be improved. Combining Theorem 2.3 and Theorem 3.2 we obtain Corollary 3.3. To construct G, min[O(log log n), log ω(U)] experiments suffice in expectation. 3.2 A Matching Lower Bound The bound in Corollary 3.3 cannot be improved. In particular, the bound is tight for unions of disjoint cliques. (Due to space constraints, this proof is given in the supplemental materials.) Lemma 3.4. If G is a union of disjoint cliques, Ω(min[log log n, log ω(U)]) experiments are necessary in expectation to construct G. Observe that Lemma 3.4 explains why attempting to recursively partition the runs (used in Theorem 3.1) in sub-runs will not improve worst-case performance. Specifically, a recursive procedure may produce a large number of sub-runs and, with high probability, the trick will fail on one of them. 4Specifically, every run will have cardinality at most k · log n with probability at least 1 − 1 nk−1 . 6 4 Random Causal Graphs In this section, we go beyond worst-case analysis and consider the number of experiments needed to recover a typical causal graph. To do this, however, we must provide a model for generating a “typical” causal graph. For this task, we use the Erd¨os-R´enyi (E-R) random graph model. Under this model, we show that the expected number of experiments required to discover the causal graph is just a constant. We remark that we chose the E-R model because it is the predominant graph sampling model. We do not claim that the E-R model is the most appropriate random model for every causal graph application. However, we believe the main conclusion we draw, that the expected number of experiments to orient a typical graph is very small, applies much more generally. This is because the vast improvement we obtain for our average-case analysis (over worst-case analysis) is derived from the fact that the E-R model produces many v-shapes. Since any other realistic random graph model will also produce numerous v-shapes (or small clique number), the number of experiments required should also be small in those models. Now, recall that the standard Erd¨os-R´enyi random graph model generates an undirected graph. The model, though, extends naturally to directed, acyclic graphs as well. Specifically, our graphs Cn,p with parameters n and p are chosen according to the following distribution: (1) Pick a random permutation σ of n vertices. (2) Pick an edge (i, j) (with 1 ≤i < j ≤n) independently with probability p. (3) If (i, j) is picked, orient it from i to j if σ(i) < σ(j) and from j to i otherwise. Note that since each edge was chosen randomly, we obtain the same distribution of causal graphs if we simply fix σ to be the identity permutation. In other words, Cn,p is just a random undirected graph Gn,p in which we’ve directed all edges from lower to higher indexed vertices. Clearly, this graph is then acyclic. The main result in this section is that the expected number of experiments needed to recover the graph is constant. We prove this in the supplemental materials. Theorem 4.1. For p ≤4 5 we can recover Cn,p using at most log log 13 experiments in expectation. We remark that the probability 4 5 in Theorem 4.1 can easily be replaced by 1−δ, for any δ > 0. The resulting expected number of experiments is a constant depending upon δ. Note, also, that the result holds even if δ is a function of n tending to zero. Furthermore, we did not attempt to optimize the constant log log 13 in this bound. Theorem 4.1 illustrates an important distinction between worst-case and average-case analyses. Specifically, the bad examples for the worst-case setting are based upon clique-like structures. Cliques have no v-shapes, so to improve upon existing results we had to exploit the acyclicity operation (F3). In contrast, for the average-case, the proof of Theorem 4.1 exploits the v-structure operation (F1). The simulations in Section 5 reinforce this point: in practice, the operations (F1, F2, F4) are extremely important as v-shapes are likely to arise in typical causal graphs. 5 Simulation Results In this section, we describe the simulations we conducted in MATLAB. The results confirm the theoretical upper bounds of Theorem 4.1; indeed the results suggest that the expected number of experiments required may be even smaller than the constant produced in Theorem 4.1. For example, even in graphs with 15000 vertices, the average cardinality of the maximum clique in the simulations is only just over two! This suggests that the full power of the forcing rules (F1)-(F4) has not been completely measured by the theoretical results we presented in Sections 3 and 4. For the simulations, we first generate a random causal graph G in the E-R model. We then calculate the essential graph E(G). To do this we apply the forcing rules (F1)-(F4) from the characterization of [2]. At this point we examine properties of the U(G) the undirected subgraph of E(G). We are particularly interested in the maximum clique size in U because this information is sufficient to upper bound the number of experiments that any reasonable algorithm will require to discover G. We remark that, to speed up the simulations we represent a random graph G by a symmetric adjacency matrix M. Here, if Mi,j = 1 then there is an arc ij if i < j and an arc ji if i > j. The matrix formulation allows the forcing rules (F1)-(F4) to be implemented more quickly than standard approaches. For example, the natural way to apply the forcing rule (F1) is to search explicitly for each v-structure of which there may be O(n3). Instead we can find every edge contained in a v-structure 7 5001000 5000 15,000 0.0 2.0 4.0 6.0 8.0 10.0 n= 7.1 6.9 6.9 7 3.2 3.2 3.2 3.2 8 8 9 9 0.0 20.0 40.0 60.0 80.0 100.0 120.0 30.9 30.5 31.1 31.2 40 41 51 43 1.0E+03 1.0E+04 4.0E+05 1.0E+08 1.0e+05 4.0e+05 1.0e+07 9.0e+07 P=0.8 n 5001000 5000 15,000 0.0 2.0 4.0 6.0 8.0 10.0 n= 2.2 2.2 2.2 2. 3 3.2 3.3 3.3 3.6 5 5 5 5 0.0 20.0 40.0 60.0 80.0 100.0 120.0 7.8 7.7 7.9 8.3 18 16 21 19 1.0E+03 1.0E+04 4.0E+05 1.0E+08 6.2e+04 2.5e+05 6.2e+06 5.6e+07 P=0.5 n 5001000 5000 15,000 0.0 2.0 4.0 6.0 8.0 10.0 n= 2.2 2.2 2.2 2.2 8.3 8.4 8.2 8.1 4 3 3 4 0.0 20.0 40.0 60.0 80.0 100.0 120.0 12.4 12.3 12.2 12.5 20 21 20 19 1.0E+03 1.0E+04 4.0E+05 1.0E+08 1.2e+04 5.0e+04 1.3e+06 1.1e+07 P=0.1 n 5001000 5000 15,000 0.0 2.0 4.0 6.0 8.0 10.0 n= 2.2 2.2 2.2 2.2 n 3 3 3 3 0.0 20.0 40.0 60.0 80.0 100.0 120.0 103104 102 98 72.4 72.5 72.4 71.2 1.0E+03 1.0E+04 4.0E+05 1.0E+08 1.2e+03 5.0e+03 1.3e+05 1.1e+06 P=0.01 97.6 101.7102.0 102.1 n Figure 1: Experimental results: number of edges and size of the maximum cliques for Cn,p using matrix multiplication, which is fast under MATLAB.5 The validity of such an approach can be seen by the following theorem whose proof is left to the supplemental material. Theorem 5.1. Given the adjacency matrix M of a causal graph, we can find all edges contained in a v-structure via matrix multiplication. To speed up computation for smaller values of p and large n, we instead used sparse matrices to apply (F1) storing only a list of non-zero entries ordered by row and column and vice versa. Then matrix multiplication could be performed quickly by looking for common entries in two short lists. We ran simulations for four choices of probability p, specifically p ∈{0.8, 0.5, 0.1, 0.01}, and for four choices of graph size n, specifically n ∈{500, 1000, 5000, 15000}. For each combination pair {n, p} we ran 1000 simulations. For each random graph G, once no more forcing rules can be applied we have obtained the essential graph E(G). We then calculate |E(U)| and ω(U). Our results are summarized in Figure 1. Here average/largest refers to the average/largest over all 1000 simulations for that {n, p} combination. Observe that the lines for AVG-E(G) and AVG-E(F1) illustrate Theorem 4.1: there is a dramatic fall in the expected number of undirected edges remaining by just applying the v-structure forcing operation (F1). The AVG-E(U) and MAX-E(U) show that the number of edges fall even more when we apply all the forcing operations to obtain U. More remarkably the maximum clique size in U is tiny, AVG-ω(U) is just around two or three for all our choices of p ∈{0.8, 0.5, 0.1, 0.01}. The largest clique size we ever encountered was just nine. Since the number of experiments required is at most logarithmic in the maximum clique size, none of our simulations would ever require more than five experiments to recover the causal graph and nearly always required just one or two. Thus, the expected clique size (and hence number of experiments) required appears even smaller than the constant 13 produced in Theorem 4.1. We emphasize that the simulations do not require the use of a specific algorithm, such as the algorithms associated with the proofs of the worst-case bound (Theorem 3.2) and the average-case bound (Theorem 4.1). In particular, the simulations show that the null experiment applied in conjunction with the forcing operations (F1)-(F4) is typically sufficient to discover most of the causal graph. Since the remaining unoriented edges U have small maximum clique size, any reasonable algorithm will then be able to orient the rest of the graph using a constant number of experiments. Acknowledgement We would like to thank the anonymous referees for their remarks that helped us improve this paper. 5In theory, matrix multiplication can be carried in time O(n2.38) [17]. 8 References [1] A. Hauser and P. B¨uhlmann. Two optimal strategies for active learning of causal models from interventional data. International Journal of Approximate Reasoning, 55(4):926–939, 2013. [2] S. Andersson, D. Madigan, and M. Perlman. A characterization of Markov equivalence classes for acyclic digraphs. Annals of Statistics, 25(2):505–541, 1997. [3] P. Sprites, C. Glymour, and R. Scheines. Causation, Prediction, and Search. MIT Press, 2 edition, 2000. [4] F. Eberhardt, C. Glymour, and R. Scheines. n −1 experiments suffice to determine the causal relations among n variables. In D. Holmes and L. Jain, editors, Innovations in Machine Learning, volume 194, pages 97–112. Springer-Verlag, 2006. [5] F. Eberhardt, C. Glymour, and R. Scheines. On the number of experiments sufficient and in the worst case necessary to identify all causal relations among n variables. In Proceedings of the 21st Conference on Uncertainty in Artificial Intelligence (UAI), pages 178–184, 2005. [6] F. Eberhardt. Causation and Intervention. Ph.d. thesis, Carnegie Melon University, 2007. [7] F. Eberhardt. Almost optimal sets for causal discovery. In Proceedings of the 24th Conference on Uncertainty in Artificial Intelligence (UAI), pages 161–168, 2008. [8] M. Cai. On separating systems of graphs. Discrete Mathematics, 49(1):15–20, 1984. [9] A. R´enyi. On random generating elements of a finite boolean algebra. Acta Sci. Math. Szeged, 22(75-81):4, 1961. [10] A. Hyttinen, F. Eberhardt, and P. Hoyer. Experiment selection for causal discovery. Journal of Machine Learning Research, 14:3041–3071, 2013. [11] F. Eberhardt. Causal discovery as a game. Journal of Machine Learning Research, 6:87–96, 2010. [12] T. Verma and J. Pearl. Equivalence and synthesis in causal models. In Proceedings of the 6th Conference on Uncertainty in Artificial Intelligence (UAI), pages 255–268, 1990. [13] M. Frydenberg. The chain graph Markov property. Scandinavian Journal of Statistics, 17:333– 353, 1990. [14] F. Gavril. Algorithms for minimum coloring, maximum clique, minimum covering by cliques, and maximum independent set of a chordal graph. SIAM Journal on Computing, 2(1):180–187, 1972. [15] C. Meek. Causal inference and causal explanation with background knowledge. In Proceedings of the Eleventh conference on Uncertainty in artificial intelligence, pages 403–410. Morgan Kaufmann Publishers Inc., 1995. [16] T. Cormen, C. Leiserson, R. Rivest, and C. Stein. Introduction to Algorithms. McGraw Hill, 2 edition, 2001. [17] V. Williams. Multiplying matrices faster than Coppersmith-Winograd. In Proceedings of the44th Symposium on Theory of Computing (STOC), pages 887–898, 2012. 9
2014
371
5,482
Combinatorial Pure Exploration of Multi-Armed Bandits Shouyuan Chen1⇤ Tian Lin2 Irwin King1 Michael R. Lyu1 Wei Chen3 1The Chinese University of Hong Kong 2Tsinghua University 3Microsoft Research Asia 1{sychen,king,lyu}@cse.cuhk.edu.hk 2lint10@mails.tsinghua.edu.cn 3weic@microsoft.com Abstract We study the combinatorial pure exploration (CPE) problem in the stochastic multi-armed bandit setting, where a learner explores a set of arms with the objective of identifying the optimal member of a decision class, which is a collection of subsets of arms with certain combinatorial structures such as size-K subsets, matchings, spanning trees or paths, etc. The CPE problem represents a rich class of pure exploration tasks which covers not only many existing models but also novel cases where the object of interest has a nontrivial combinatorial structure. In this paper, we provide a series of results for the general CPE problem. We present general learning algorithms which work for all decision classes that admit offline maximization oracles in both fixed confidence and fixed budget settings. We prove problem-dependent upper bounds of our algorithms. Our analysis exploits the combinatorial structures of the decision classes and introduces a new analytic tool. We also establish a general problem-dependent lower bound for the CPE problem. Our results show that the proposed algorithms achieve the optimal sample complexity (within logarithmic factors) for many decision classes. In addition, applying our results back to the problems of top-K arms identification and multiple bandit best arms identification, we recover the best available upper bounds up to constant factors and partially resolve a conjecture on the lower bounds. 1 Introduction Multi-armed bandit (MAB) is a predominant model for characterizing the tradeoff between exploration and exploitation in decision-making problems. Although this is an intrinsic tradeoff in many tasks, some application domains prefer a dedicated exploration procedure in which the goal is to identify an optimal object among a collection of candidates and the reward or loss incurred during exploration is irrelevant. In light of these applications, the related learning problem, called pure exploration in MABs, has received much attention. Recent advances in pure exploration MABs have found potential applications in many domains including crowdsourcing, communication network and online advertising. In many of these application domains, a recurring problem is to identify the optimal object with certain combinatorial structure. For example, a crowdsourcing application may want to find the best assignment from workers to tasks such that overall productivity of workers is maximized. A network routing system during the initialization phase may try to build a spanning tree that minimizes the delay of links, or attempts to identify the shortest path between two sites. An online advertising system may be interested in finding the best matching between ads and display slots. The literature of pure exploration MAB problems lacks a framework that encompasses these kinds of problems where the object of interest has a non-trivial combinatorial structure. Our paper contributes such a framework which accounts for general combinatorial structures, and develops a series of results, including algorithms, upper bounds and lower bounds for the framework. In this paper, we formulate the combinatorial pure exploration (CPE) problem for stochastic multiarmed bandits. In the CPE problem, a learner has a fixed set of arms and each arm is associated with an unknown reward distribution. The learner is also given a collection of sets of arms called decision class, which corresponds to a collection of certain combinatorial structures. During the exploration period, in each round the learner chooses an arm to play and observes a random reward sampled from ⇤This work was done when the first two authors were interns at Microsoft Research Asia. 1 the associated distribution. The objective is when the exploration period ends, the learner outputs a member of the decision class that she believes to be optimal, in the sense that the sum of expected rewards of all arms in the output set is maximized among all members in the decision class. The CPE framework represents a rich class of pure exploration problems. The conventional pure exploration problem in MAB, whose objective is to find the single best arm, clearly fits into this framework, in which the decision class is the collection of all singletons. This framework also naturally encompasses several recent extensions, including the problem of finding the top K arms (henceforth TOPK) [18, 19, 8, 20, 31] and the multi-bandit problem of finding the best arms simultaneously from several disjoint sets of arms (henceforth MB) [12, 8]. Further, this framework covers many more interesting cases where the decision classes correspond to collections of non-trivial combinatorial structures. For example, suppose that the arms represent the edges in a graph. Then a decision class could be the set of all paths between two vertices, all spanning trees or all matchings of the graph. And, in these cases, the objectives of CPE become identifying the optimal paths, spanning trees and matchings through bandit explorations, respectively. To our knowledge, there are no results available in the literature for these pure exploration tasks. The CPE framework raises several interesting challenges to the design and analysis of pure exploration algorithms. One challenge is that, instead of solving each type of CPE task in an ad-hoc way, one requires a unified algorithm and analysis that support different decision classes. Another challenge stems from the combinatorial nature of CPE, namely that the optimal set may contain some arms with very small expected rewards (e.g., it is possible that a maximum matching contains the edge with the smallest weight); hence, arms cannot be eliminated simply based on their own rewards in the learning algorithm or ignored in the analysis. This differs from many existing approach of pure exploration MABs. Therefore, the design and analysis of algorithms for CPE demands novel techniques which take both rewards and combinatorial structures into account. Our results. In this paper, we propose two novel learning algorithms for general CPE problem: one for the fixed confidence setting and one for the fixed budget setting. Both algorithms support a wide range of decision classes in a unified way. In the fixed confidence setting, we present Combinatorial Lower-Upper Confidence Bound (CLUCB) algorithm. The CLUCB algorithm does not need to know the definition of the decision class, as long as it has access to the decision class through a maximization oracle. We upper bound the number of samples used by CLUCB. This sample complexity bound depends on both the expected rewards and the structure of decision class. Our analysis relies on a novel combinatorial construction called exchange class, which may be of independent interest for other combinatorial optimization problems. Specializing our result to TOPK and MB, we recover the best available sample complexity bounds [19, 13, 20] up to constant factors. While for other decision classes in general, our result establishes the first sample complexity upper bound. We further show that CLUCB can be easily extended to the fixed budget setting and PAC learning setting and we provide related theoretical guarantees in the supplementary material. Moreover, we establish a problem-dependent sample complexity lower bound for the CPE problem. Our lower bound shows that the sample complexity of the proposed CLUCB algorithm is optimal (to within logarithmic factors) for many decision classes, including TOPK, MB and the decision classes derived from matroids (e.g., spanning tree). Therefore our upper and lower bounds provide a nearly full characterization of the sample complexity of these CPE problems. For more general decision classes, our results show that the upper and lower bounds are within a relatively benign factor. To the best of our knowledge, there are no problem-dependent lower bounds known for pure exploration MABs besides the case of identifying the single best arm [24, 1]. We also notice that our result resolves the conjecture of Bubeck et al. [8] on the problem-dependent sample complexity lower bounds of TOPK and MB problems, for the cases of Gaussian reward distributions. In the fixed budget setting, we present a parameter-free algorithm called Combinatorial Successive Accept Reject (CSAR) algorithm. We prove a probability of error bound of the CSAR algorithm. This bound can be shown to be equivalent to the sample complexity bound of CLUCB within logarithmic factors, although the two algorithms are based on quite different techniques. Our analysis of CSAR re-uses exchange classes as tools. This suggests that exchange classes may be useful for analyzing similar problems. In addition, when applying the algorithm to back TOPK and MB, our bound recovers the best known result in the fixed budget setting due to Bubeck et al. [8] up to constant factors. 2 2 Problem Formulation In this section, we formally define the CPE problem. Suppose that there are n arms and the arms are numbered 1, 2, . . . , n. Assume that each arm e 2 [n] is associated with a reward distribution 'e. Let w = ! w(1), . . . , w(n) "T denote the vector of expected rewards, where each entry w(e) = EX⇠'e[X] denotes the expected reward of arm e. Following standard assumptions of stochastic MABs, we assume that all reward distributions have R-sub-Gaussian tails for some known constant R > 0. Formally, if X is a random variable drawn from 'e for some e 2 [n], then, for all t 2 R, one has E ⇥ exp(tX −tE[X]) ⇤ exp(R2t2/2). It is known that the family of R-sub-Gaussian tail distributions encompasses all distributions that are supported on [0, R] as well as many unbounded distributions such as Gaussian distributions with variance R2 (see e.g., [27, 28]). We define a decision class M ✓2[n] as a collection of sets of arms. Let M⇤= arg maxM2M w(M) denote the optimal member of the decision class M which maximizes the sum of expected rewards1. A learner’s objective is to identify M⇤from M by playing the following game with the stochastic environment. At the beginning of the game, the decision class M is revealed to the learner while the reward distributions {'e}e2[n] are unknown to her. Then, the learner plays the game over a sequence of rounds; in each round t, she pulls an arm pt 2 [n] and observes a reward sampled from the associated reward distribution 'pt. The game continues until certain stopping condition is satisfied. After the game finishes, the learner need to output a set Out 2 M. We consider two different stopping conditions of the game, which are known as fixed confidence setting and fixed budget setting in the literature. In the fixed confidence setting, the learner can stop the game at any round. She need to guarantee that Pr[Out = M⇤] ≥1 −δ for a given confidence parameter δ. The learner’s performance is evaluated by her sample complexity, i.e., the number of pulls used by the learner. In the fixed budget setting, the game stops after a fixed number T of rounds, where T is given before the game starts. The learner tries to minimize the probability of error, which is formally Pr[Out 6= M⇤], within T rounds. In this setting, her performance is measured by the probability of error. 3 Algorithm, Exchange Class and Sample Complexity In this section, we present Combinatorial Lower-Upper Confidence Bound (CLUCB) algorithm, a learning algorithm for the CPE problem in the fixed confidence setting, and analyze its sample complexity. En route to our sample complexity bound, we introduce the notions of exchange classes and the widths of decision classes, which play an important role in the analysis and sample complexity bound. Furthermore, the CLUCB algorithm can be extended to the fixed budget and PAC learning settings, the discussion of which is included in the supplementary material (Appendix B). Oracle. We allow the CLUCB algorithm to access a maximization oracle. A maximization oracle takes a weight vector v 2 Rn as input and finds an optimal set from a given decision class M with respect to the weight vector v. Formally, we call a function Oracle: Rn ! M a maximization oracle for M if, for all v 2 Rn, we have Oracle(v) 2 arg maxM2M v(M). It is clear that a wide range of decision classes admit such maximization oracles, including decision classes corresponding to collections of matchings, paths or bases of matroids (see later for concrete examples). Besides the access to the oracle, CLUCB does not need any additional knowledge of the decision class M. Algorithm. Now we describe the details of CLUCB, as shown in Algorithm 1. During its execution, the CLUCB algorithm maintains empirical mean ¯wt(e) and confidence radius radt(e) for each arm e 2 [n] and each round t. The construction of confidence radius ensures that |w(e) −¯wt(e)|  radt(e) holds with high probability for each arm e 2 [n] and each round t > 0. CLUCB begins with an initialization phase in which each arm is pulled once. Then, at round t ≥n, CLUCB uses the following procedure to choose an arm to play. First, CLUCB calls the oracle which finds the set Mt = Oracle( ¯ wt). The set Mt is the “best” set with respect to the empirical means ¯ wt. Then, CLUCB explores possible refinements of Mt. In particular, CLUCB uses the confidence radius to compute an adjusted expectation vector ˜ wt in the following way: for each arm e 2 Mt, ˜wt(e) is equal to to the lower confidence bound ˜wt(e) = ¯wt(e)−radt(e); and for each arm e 62 Mt, ˜wt(e) is equal to the upper confidence bound ˜wt(e) = ¯wt(e) + radt(e). Intuitively, the adjusted expectation vector ˜ wt penalizes arms belonging to the current set Mt and encourages exploring arms out of 1We define v(S) , P i2S v(i) for any vector v 2 Rn and any set S ✓[n]. In addition, for convenience, we will assume that M⇤is unique. 3 Algorithm 1 CLUCB: Combinatorial Lower-Upper Confidence Bound Require: Confidence δ 2 (0, 1); Maximization oracle: Oracle(·) : Rn ! M Initialize: Play each arm e 2 [n] once. Initialize empirical means ¯ wn and set Tn(e) 1 for all e. 1: for t = n, n + 1, . . . do 2: Mt Oracle( ¯ wt) 3: Compute confidence radius radt(e) for all e 2 [n] . radt(e) is defined later in Theorem 1 4: for e = 1, . . . , n do 5: if e 2 Mt then ˜wt(e) ¯wt(e) −radt(e) 6: else ˜wt(e) ¯wt(e) + radt(e) 7: ˜ Mt Oracle( ˜ wt) 8: if ˜wt( ˜ Mt) = ˜wt(Mt) then 9: Out Mt 10: return Out 11: pt arg maxe2( ˜ Mt\Mt)[(Mt\ ˜ Mt) radt(e) . break ties arbitrarily 12: Pull arm pt and observe the reward 13: Update empirical means ¯ wt+1 using the observed reward 14: Update number of pulls: Tt+1(pt) Tt(pt) + 1 and Tt+1(e) Tt(e) for all e 6= pt Mt. CLUCB then calls the oracle using the adjusted expectation vector ˜ wt as input to compute a refined set ˜ Mt = Oracle( ˜ wt). If ˜wt( ˜ Mt) = ˜wt(Mt) then CLUCB stops and returns Out = Mt. Otherwise, CLUCB pulls the arm that belongs to the symmetric difference between Mt and ˜ Mt and has the largest confidence radius (intuitively the largest uncertainty). This ends the t-th round of CLUCB. We note that CLUCB generalizes and unifies the ideas of several different fixed confidence algorithms dedicated to the TOPK and MB problems in the literature [19, 13, 20]. 3.1 Sample complexity Now we establish a problem-dependent sample complexity bound of the CLUCB algorithm. To formally state our result, we need to introduce several notions. Gap. We begin with defining a natural hardness measure of the CPE problem. For each arm e 2 [n], we define its gap ∆e as ∆e = ⇢w(M⇤) −maxM2M:e2M w(M) if e 62 M⇤, w(M⇤) −maxM2M:e62M w(M) if e 2 M⇤, (1) where we adopt the convention that the maximum value of an empty set is −1. We also define the hardness H as the sum of inverse squared gaps H = X e2[n] ∆−2 e . (2) We see that, for each arm e 62 M⇤, the gap ∆e represents the sub-optimality of the best set that includes arm e; and, for each arm e 2 M⇤, the gap ∆e is the sub-optimality of the best set that does not include arm e. This naturally generalizes and unifies previous definitions of gaps [1, 12, 18, 8]. Exchange class and the width of a decision class. A notable challenge of our analysis stems from the generality of CLUCB which, as we have seen, supports a wide range of decision classes M. Indeed, previous algorithms for special cases including TOPK and MB require a separate analysis for each individual type of problem. Such strategy is intractable for our setting and we need a unified analysis for all decision classes. Our solution to this challenge is a novel combinatorial construction called exchange class, which is used as a proxy for the structure of the decision class. Intuitively, an exchange class B for a decision class M can be seen as a collection of “patches” (borrowing concepts from source code management) such that, for any two different sets M, M 0 2 M, one can transform M to M 0 by applying a series of patches of B; and each application of a patch yields a valid member of M. These patches are later used by our analysis to build gadgets that interpolate between different members of the decision class and serve to bridge key quantities. Furthermore, the maximum patch size of B will play an important role in our sample complexity bound. Now we formally define the exchange class. We begin with the definition of exchange sets, which formalize the aforementioned “patches”. We define an exchange set b as an ordered pair of disjoint sets b = (b+, b−) where b+ \ b−= ; and b+, b−✓[n]. Then, we define operator ⊕such that, for any set M ✓[n] and any exchange set b = (b+, b−), we have M ⊕b , M\b−[ b+. Similarly, we also define operator such that M b , M\b+ [ b−. 4 We call a collection of exchange sets B an exchange class for M if B satisfies the following property. For any M, M 0 2 M such that M 6= M 0 and for any e 2 (M\M 0), there exists an exchange set (b+, b−) 2 B which satisfies five constraints: (a) e 2 b−, (b) b+ ✓M 0\M, (c) b−✓M\M 0, (d) (M ⊕b) 2 M and (e) (M 0 b) 2 M. Intuitively, constraints (b) and (c) resemble the concept of patches in the sense that b+ contains only the “new” elements from M 0 and b−contains only the “old” elements of M; constraints (d) and (e) allow one to transform M one step closer to M 0 by applying a patch b 2 B to yield (M ⊕ b) 2 M (and similarly for M 0 b). These transformations are the basic building blocks in our analysis. Furthermore, as we will see later in our examples, for many decision classes, there are exchange classes representing natural combinatorial structures, e.g., augmenting paths and cycles of matchings. In our analysis, the key quantity of exchange class is called width, which is defined as the size of the largest exchange set as follows width(B) = max (b+,b−)2B |b+| + |b−|. (3) Let Exchange(M) denote the family of all possible exchange classes for M. We define the width of a decision class M as the width of the thinnest exchange class width(M) = min B2Exchange(M) width(B). (4) Sample complexity. Our main result of this section is a problem-dependent sample complexity bound of the CLUCB algorithm which show that, with high probability, CLUCB returns the optimal set M⇤and uses at most ˜O ! width(M)2H " samples. Theorem 1. Given any δ 2 (0, 1), any decision class M ✓2[n] and any expected rewards w 2 Rn. Assume that the reward distribution 'e for each arm e 2 [n] has mean w(e) with an R-sub-Gaussian tail. Let M⇤= arg maxM2M w(M) denote the optimal set. Set radt(e) = R q 2 log ! 4nt3 δ " /Tt(e) for all t > 0 and e 2 [n]. Then, with probability at least 1 −δ, the CLUCB algorithm (Algorithm 1) returns the optimal set Out = M⇤and T O ! R2 width(M)2H log ! nR2H/δ "" , (5) where T denotes the number of samples used by Algorithm 1, H is defined in Eq. (2) and width(M) is defined in Eq. (4). 3.2 Examples of decision classes Now we investigate several concrete types of decision classes, which correspond to different CPE tasks. We analyze the width of these decision classes and apply Theorem 1 to obtain the sample complexity bounds. A detailed analysis and the constructions of exchange classes can be found in the supplementary material (Appendix F). We begin with the problems of top-K arm identification (TOPK) and multi-bandit best arms identification (MB). Example 1 (TOPK and MB). For any K 2 [n], the problem of finding the top K arms with the largest expected reward can be modeled by decision class MTOPK(K) = {M ✓[n] | ((M (( = K}. Let A = {A1, . . . , Am} be a partition of [n]. The problem of identifying the best arms from each group of arms A1, . . . , Am can be modeled by decision class MMB(A) = {M ✓[n] | 8i 2 [m], |M \ Ai| = 1}. Note that maximization oracles for these two decision classes are trivially the functions of returning the top k arms or the best arms of each group. Then we have width(MTOPK(K)) 2 and width(MMB(A)) 2 (see Fact 2 and 3 in the supplementary material) and therefore the sample complexity of CLUCB for solving TOPK and MB is O ! H log(nH/δ) " , which matches previous results in the fixed confidence setting [19, 13, 20] up to constant factors. Next we consider the problem of identifying the maximum matching and the problem of finding the shortest path (by negating the rewards), in a setting where arms correspond to edges. For these problems, Theorem 1 establishes the first known sample complexity bound. 5 Example 2 (Matchings and Paths). Let G(V, E) be a graph with n edges and assume there is a oneto-one mapping between edges E and arms [n]. Suppose that G is a bipartite graph. Let MMATCH(G) correspond to the set of all matchings in G. Then we have width(MMATCH(G)) |V | (In fact, we construct an exchange class corresponding to the collection of augmenting cycles and augmenting paths of G; see Fact 4). Next suppose that G is a directed acyclic graph and let s, t 2 V be two vertices. Let MPATH(G,s,t) correspond to the set of all paths from s to t. Then we have width(MPATH(G,s,t)) |V | (In fact, we construct an exchange class corresponding to the collection of disjoint pairs of paths; see Fact 5). Therefore the sample complexity bounds of CLUCB for decision classes MMATCH(G) and MPATH(G,s,t) are O ! |V |2H log(nH/δ) " . Last, we investigate the general problem of identifying the maximum-weight basis of a matroid. Again, Theorem 1 is the first sample complexity upper bound for this type of pure exploration tasks. Example 3 (Matroids). Let T = (E, I) be a finite matroid, where E is a set of size n (called ground set) and I is a family of subsets of E (called independent sets) which satisfies the axioms of matroids (see Footnote 3 in Appendix F). Assume that there is a one-to-one mapping between E and [n]. Recall that a basis of matroid T is a maximal independent set. Let MMATROID(T ) correspond to the set of all bases of T. Then we have width(MMATROID(T )) 2 (derived from strong basis exchange property of matroids; see Fact 1) and the sample complexity of CLUCB for MMATROID(T ) is O ! H log(nH/δ) " . The last example MMATROID(T ) is a general type of decision class which encompasses many pure exploration tasks including TOPK and MB as special cases, where TOPK corresponds to uniform matroids of rank K and MB corresponds to partition matroids. It is easy to see that MMATROID(T ) also covers the decision class that contains all spanning trees of a graph. On the other hand, it has been established that matchings and paths cannot be formulated as matroids since they are matroid intersections [26]. 4 Lower Bound In this section, we present a problem-dependent lower bound on the sample complexity of the CPE problem. To state our results, we first define the notion of δ-correct algorithm as follows. For any δ 2 (0, 1), we call an algorithm A a δ-correct algorithm if, for any expected reward w 2 Rn, the probability of error of A is at most δ, i.e., Pr[M⇤6= Out] δ, where Out is the output of A. We show that, for any decision class M and any expected rewards w, a δ-correct algorithm A must use at least ⌦ ! H log(1/δ) " samples in expectation. Theorem 2. Fix any decision class M ✓2[n] and any vector w 2 Rn. Suppose that, for each arm e 2 [n], the reward distribution 'e is given by 'e = N(w(e), 1), where we let N(µ, σ2) denote Gaussian distribution with mean µ and variance σ2. Then, for any δ 2 (0, e−16/4) and any δ-correct algorithm A, we have E[T] ≥1 16H log ✓1 4δ ◆ , (6) where T denote the number of total samples used by algorithm A and H is defined in Eq. (2). In Example 1 and Example 3, we have seen that the sample complexity of CLUCB is O(H log(nH/δ)) for pure exploration tasks including TOPK, MB and more generally the CPE tasks with decision classes derived from matroids, i.e., MMATROID(T ) (including spanning trees). Hence, our upper and lower bound show that the CLUCB algorithm achieves the optimal sample complexity within logarithmic factors for these pure exploration tasks. In addition, we remark that Theorem 2 resolves the conjecture of Bubeck et al. [8] that the lower bounds of sample complexity of TOPK and MB problems are ⌦ ! H log(1/δ) " , for the cases of Gaussian reward distributions. On the other hand, for general decision classes with non-constant widths, we see that there is a gap of ˜⇥(width(M)2) between the upper bound Eq. (5) and the lower bound Eq. (6). Notice that we have width(M) n for any decision class M and therefore the gap is relatively benign. Our lower bound also suggests that the dependency on H of the sample complexity of CLUCB cannot be improved up to logarithmic factors. Furthermore, we conjecture that the sample complexity lower bound might inherently depend on the size of exchange sets. In the supplementary material (Appendix C.2), we 6 provide evidences on this conjecture which is a lower bound on the sample complexity of exploration of the exchange sets. 5 Fixed Budget Algorithm In this section, we present Combinatorial Successive Accept Reject (CSAR) algorithm, which is a parameter-free learning algorithm for the CPE problem in the fixed budget setting. Then, we upper bound the probability of error CSAR in terms of gaps and width(M). Constrained oracle. The CSAR algorithm requires access to a constrained oracle, which is a function denoted as COracle : Rn ⇥2[n] ⇥2[n] ! M [ {?} and satisfies COracle(v, A, B) = ( arg maxM2MA,B v(M) if MA,B 6= ; ? if MA,B = ;, (7) where we define MA,B = {M 2 M | A ✓M, B \ M = ;} as the collection of feasible sets and ? is a null symbol. Hence we see that COracle(v, A, B) returns an optimal set that includes all elements of A while excluding all elements of B; and if there are no feasible sets, the constrained oracle COracle(v, A, B) returns the null symbol ?. In the supplementary material (Appendix G), we show that constrained oracles are equivalent to maximization oracles up to a transformation on the weight vector. In addition, similar to CLUCB, CSAR does not need any additional knowledge of M other than accesses to a constrained oracle for M. Algorithm. The idea of the CSAR algorithm is as follows. The CSAR algorithm divides the budget of T rounds into n phases. In the end of each phase, CSAR either accepts or rejects a single arm. If an arm is accepted, then it is included into the final output. Conversely, if an arm is rejected, then it is excluded from the final output. The arms that are neither accepted nor rejected are sampled for an equal number of times in the next phase. Now we describe the procedure of the CSAR algorithm for choosing an arm to accept/reject. Let At denote the set of accepted arms before phase t and let Bt denote the set of rejected arms before phase t. We call an arm e to be active if e 62 At [ Bt. In the beginning of phase t, CSAR samples each active arm for ˜Tt −˜Tt−1 times, where the definition of ˜Tt is given in Algorithm 2. Next, CSAR calls the constrained oracle to compute an optimal set Mt with respect to the empirical means ¯ wt, accepted arms At and rejected arms Bt, i.e., Mt = COracle( ¯ wt, At, Bt). It is clear that the output of COracle( ¯ wt, At, Bt) is independent from the input ¯wt(e) for any e 2 At [ Bt. Then, for each active arm e, CSAR estimates the “empirical gap” of e in the following way. If e 2 Mt, then CSAR computes an optimal set ˜ Mt,e that does not include e, i.e., ˜ Mt,e = COracle( ¯ wt, At, Bt [ {e}). Conversely, if e 62 Mt, then CSAR computes an optimal ˜ Mt,e which includes e, i.e., ˜ Mt,e = COracle( ¯ wt, At[{e}, Bt). Then, the empirical gap of e is calculated as ¯wt(Mt)−¯wt( ˜ Mt,e). Finally, CSAR chooses the arm pt which has the largest empirical gap. If pt 2 Mt then pt is accepted, otherwise pt is rejected. The pseudo-code CSAR is shown in Algorithm 2. We note that CSAR can be considered as a generalization of the ideas of the two versions of SAR algorithm due to Bubeck et al. [8], which are designed specifically for the TOPK and MB problems respectively. 5.1 Probability of error In the following theorem, we bound the probability of error of the CSAR algorithm. Theorem 3. Given any T > n, any decision class M ✓2[n] and any expected rewards w 2 Rn. Assume that the reward distribution 'e for each arm e 2 [n] has mean w(e) with an R-subGaussian tail. Let ∆(1), . . . , ∆(n) be a permutation of ∆1, . . . , ∆n (defined in Eq. (1)) such that ∆(1) . . . . . . ∆(n). Define H2 , maxi2[n] i∆−2 (i) . Then, the CSAR algorithm uses at most T samples and outputs a solution Out 2 M [ {?} such that Pr[Out 6= M⇤] n2 exp ✓ − (T −n) 18R2 ˜ log(n) width(M)2H2 ◆ , (8) where ˜ log(n) , Pn i=1 i−1, M⇤= arg maxM2M w(M) and width(M) is defined in Eq. (4). One can verify that H2 is equivalent to H up to a logarithmic factor: H2 H log(2n)H2 (see [1]). Therefore, by setting the probability of error (the RHS of Eq. (8)) to a constant, one can see that CSAR requires a budget of T = ˜O(width(M)2H) samples. This is equivalent to the sample complexity bound of CLUCB up to logarithmic factors. In addition, applying Theorem 3 back to TOPK and MB, our bound matches the previous fixed budget algorithm due to Bubeck et al. [8]. 7 Algorithm 2 CSAR: Combinatorial Successive Accept Reject Require: Budget: T > 0; Constrained oracle: COracle : Rn ⇥2[n] ⇥2[n] ! M [ {?}. 1: Define ˜ log(n) , Pn i=1 1 i 2: ˜T0 0, A1 ;, B1 ; 3: for t = 1, . . . , n do 4: ˜Tt l T −n ˜ log(n)(n−t+1) m 5: Pull each arm e 2 [n]\(At [ Bt) for ˜Tt −˜Tt−1 times 6: Update the empirical means ¯ wt for each arm e 2 [n]\(At [ Bt) . set ¯wt(e) = 0, 8e 2 At [ Bt 7: Mt COracle( ¯ wt, At, Bt) 8: if Mt = ? then 9: fail: set Out ? and return Out 10: for each e 2 [n]\(At [ Bt) do 11: if e 2 Mt then ˜ Mt,e COracle( ¯ wt, At, Bt [ {e}) 12: else ˜ Mt,e COracle( ¯ wt, At [ {e}, Bt) 13: pt arg maxe2[n]\(At[Bt) ¯wt(Mt) −¯wt( ˜ Mt,e) . define ¯wt(?) = −1; break ties arbitrarily 14: if pt 2 Mt then 15: At+1 At [ {pt}, Bt+1 Bt 16: else 17: At+1 At, Bt+1 Bt [ {pt} 18: Out An+1 19: return Out 6 Related Work The multi-armed bandit problem has been extensively studied in both stochastic and adversarial settings [22, 3, 2]. We refer readers to [5] for a survey on recent advances. Many work in MABs focus on minimizing the cumulative regret, which is an objective known to be fundamentally different from the objective of pure exploration MABs [6]. Among these work, a recent line of research considers a generalized setting called combinatorial bandits in which a set of arms (satisfying certain combinatorial constraints) are played on each round [9, 17, 25, 7, 10, 14, 23, 21]. Note that the objective of these work is to minimize the cumulative regret, which differs from ours. In the literature of pure exploration MABs, the classical problem of identifying the single best arm has been well-studied in both fixed confidence and fixed budget settings [24, 11, 6, 1, 13, 15, 16]. A flurry of recent work extend this classical problem to TOPK and MB problems and obtain algorithms with upper bounds [18, 12, 13, 19, 8, 20, 31] and worst-case lower bounds of TOPK [19, 31]. Our framework encompasses these two problems as special cases and covers a much larger class of combinatorial pure exploration problems, which have not been addressed in current literature. Applying our results back to TOPK and MB, our upper bounds match best available problem-dependent bounds up to constant factors [13, 19, 8] in both fixed confidence and fixed budget settings; and our lower bound is the first proven problem-dependent lower bound for these two problems, which are conjectured earlier by Bubeck et al. [8]. 7 Conclusion In this paper, we proposed a general framework called combinatorial pure exploration (CPE) that can handle pure exploration tasks for many complex bandit problems with combinatorial constraints, and have potential applications in various domains. We have shown a number of results for the framework, including two novel learning algorithms, their related upper bounds and a novel lower bound. The proposed algorithms support a wide range of decision classes in a unifying way and our analysis introduced a novel tool called exchange class, which may be of independent interest. Our upper and lower bounds characterize the complexity of the CPE problem: the sample complexity of our algorithm is optimal (up to a logarithmic factor) for the decision classes derived from matroids (including TOPK and MB), while for general decision classes, our upper and lower bounds are within a relatively benign factor. Acknowledgments. The work described in this paper was partially supported by the National Grand Fundamental Research 973 Program of China (No. 2014CB340401 and No. 2014CB340405), the Research Grants Council of the Hong Kong Special Administrative Region, China (Project No. CUHK 413212 and CUHK 415113), and Microsoft Research Asia Regional Seed Fund in Big Data Research (Grant No. FY13-RES-SPONSOR-036). 8 References [1] J.-Y. Audibert, S. Bubeck, and R. Munos. Best arm identification in multi-armed bandits. In COLT, 2010. [2] P. Auer, N. Cesa-Bianchi, and P. Fischer. Finite-time analysis of the multiarmed bandit problem. Machine learning, 47(2-3):235–256, 2002. [3] P. Auer, N. Cesa-Bianchi, Y. Freund, and R. E. Schapire. The nonstochastic multiarmed bandit problem. SIAM Journal on Computing, 32(1):48–77, 2002. [4] C. Berge. Two theorems in graph theory. PNAS, 1957. [5] S. Bubeck and N. Cesa-Bianchi. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning, 5:1–122, 2012. [6] S. Bubeck, R. Munos, and G. Stoltz. Pure exploration in finitely-armed and continuous-armed bandits. Theoretical Computer Science, 412:1832–1852, 2010. [7] S. Bubeck, N. Cesa-bianchi, S. M. Kakade, S. Mannor, N. Srebro, and R. C. Williamson. Towards minimax policies for online linear optimization with bandit feedback. In COLT, 2012. [8] S. Bubeck, T. Wang, and N. Viswanathan. Multiple identifications in multi-armed bandits. In ICML, pages 258–265, 2013. [9] N. Cesa-Bianchi and G. Lugosi. Combinatorial bandits. JCSS, 78(5):1404–1422, 2012. [10] W. Chen, Y. Wang, and Y. Yuan. Combinatorial multi-armed bandit: General framework and applications. In ICML, pages 151–159, 2013. [11] E. Even-Dar, S. Mannor, and Y. Mansour. Action elimination and stopping conditions for the multi-armed bandit and reinforcement learning problems. JMLR, 2006. [12] V. Gabillon, M. Ghavamzadeh, A. Lazaric, and S. Bubeck. Multi-bandit best arm identification. In NIPS. 2011. [13] V. Gabillon, M. Ghavamzadeh, and A. Lazaric. Best arm identification: A unified approach to fixed budget and fixed confidence. In NIPS, 2012. [14] A. Gopalan, S. Mannor, and Y. Mansour. Thompson sampling for complex online problems. In ICML, pages 100–108, 2014. [15] K. Jamieson and R. 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. [16] K. Jamieson, M. Malloy, R. Nowak, and S. Bubeck. lil’UCB: An optimal exploration algorithm for multi-armed bandits. COLT, 2014. [17] S. Kale, L. Reyzin, and R. E. Schapire. Non-stochastic bandit slate problems. In NIPS, 2010. [18] S. Kalyanakrishnan and P. Stone. Efficient selection of multiple bandit arms: Theory and practice. In ICML, pages 511–518, 2010. [19] S. Kalyanakrishnan, A. Tewari, P. Auer, and P. Stone. PAC subset selection in stochastic multi-armed bandits. In ICML, pages 655–662, 2012. [20] E. Kaufmann and S. Kalyanakrishnan. Information complexity in bandit subset selection. In COLT, 2013. [21] B. Kveton, Z. Wen, A. Ashkan, H. Eydgahi, and B. Eriksson. Matroid bandits: Fast combinatorial optimization with learning. In UAI, 2014. [22] T. L. Lai and H. Robbins. Asymptotically efficient adaptive allocation rules. Advances in applied mathematics, 6(1):4–22, 1985. [23] T. Lin, B. Abrahao, R. Kleinberg, J. Lui, and W. Chen. Combinatorial partial monitoring game with linear feedback and its application. In ICML, 2014. [24] S. Mannor and J. N. Tsitsiklis. The sample complexity of exploration in the multi-armed bandit problem. The Journal of Machine Learning Research, 5:623–648, 2004. [25] G. Neu, A. Gy¨orgy, and C. Szepesv´ari. The online loop-free stochastic shortest-path problem. In COLT, pages 231–243, 2010. [26] J. G. Oxley. Matroid theory. Oxford university press, 2006. [27] D. Pollard. Asymptopia. Manuscript, Yale University, Dept. of Statist., New Haven, Connecticut, 2000. [28] O. Rivasplata. Subgaussian random variables: An expository note. 2012. [29] S. M. Ross. Stochastic processes, volume 2. John Wiley & Sons New York, 1996. [30] N. Spring, R. Mahajan, and D. Wetherall. Measuring ISP topologies with rocketfuel. ACM SIGCOMM Computer Communication Review, 32(4):133–145, 2002. [31] Y. Zhou, X. Chen, and J. Li. Optimal PAC multiple arm identification with applications to crowdsourcing. In ICML, 2014. 9
2014
372
5,483
Deep Learning Face Representation by Joint Identification-Verification Yi Sun1 Yuheng Chen2 Xiaogang Wang3,4 Xiaoou Tang1,4 1Department of Information Engineering, The Chinese University of Hong Kong 2SenseTime Group 3Department of Electronic Engineering, The Chinese University of Hong Kong 4Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences sy011@ie.cuhk.edu.hk chyh1990@gmail.com xgwang@ee.cuhk.edu.hk xtang@ie.cuhk.edu.hk Abstract The key challenge of face recognition is to develop effective feature representations for reducing intra-personal variations while enlarging inter-personal differences. In this paper, we show that it can be well solved with deep learning and using both face identification and verification signals as supervision. The Deep IDentification-verification features (DeepID2) are learned with carefully designed deep convolutional networks. The face identification task increases the inter-personal variations by drawing DeepID2 features extracted from different identities apart, while the face verification task reduces the intra-personal variations by pulling DeepID2 features extracted from the same identity together, both of which are essential to face recognition. The learned DeepID2 features can be well generalized to new identities unseen in the training data. On the challenging LFW dataset [11], 99.15% face verification accuracy is achieved. Compared with the best previous deep learning result [20] on LFW, the error rate has been significantly reduced by 67%. 1 Introduction Faces of the same identity could look much different when presented in different poses, illuminations, expressions, ages, and occlusions. Such variations within the same identity could overwhelm the variations due to identity differences and make face recognition challenging, especially in unconstrained conditions. Therefore, reducing the intra-personal variations while enlarging the inter-personal differences is a central topic in face recognition. It can be traced back to early subspace face recognition methods such as LDA [1], Bayesian face [16], and unified subspace [22, 23]. For example, LDA approximates inter- and intra-personal face variations by using two scatter matrices and finds the projection directions to maximize the ratio between them. More recent studies have also targeted the same goal, either explicitly or implicitly. For example, metric learning [6, 9, 14] maps faces to some feature representation such that faces of the same identity are close to each other while those of different identities stay apart. However, these models are much limited by their linear nature or shallow structures, while inter- and intra-personal variations are complex, highly nonlinear, and observed in high-dimensional image space. In this work, we show that deep learning provides much more powerful tools to handle the two types of variations. Thanks to its deep architecture and large learning capacity, effective features for face recognition can be learned through hierarchical nonlinear mappings. We argue that it is essential to learn such features by using two supervisory signals simultaneously, i.e. the face identification and verification signals, and the learned features are referred to as Deep IDentification-verification features (DeepID2). Identification is to classify an input image into a large number of identity 1 classes, while verification is to classify a pair of images as belonging to the same identity or not (i.e. binary classification). In the training stage, given an input face image with the identification signal, its DeepID2 features are extracted in the top hidden layer of the learned hierarchical nonlinear feature representation, and then mapped to one of a large number of identities through another function g(DeepID2). In the testing stage, the learned DeepID2 features can be generalized to other tasks (such as face verification) and new identities unseen in the training data. The identification supervisory signal tends to pull apart the DeepID2 features of different identities since they have to be classified into different classes. Therefore, the learned features would have rich identity-related or inter-personal variations. However, the identification signal has a relatively weak constraint on DeepID2 features extracted from the same identity, since dissimilar DeepID2 features could be mapped to the same identity through function g(·). This leads to problems when DeepID2 features are generalized to new tasks and new identities in test where g is not applicable anymore. We solve this by using an additional face verification signal, which requires that every two DeepID2 feature vectors extracted from the same identity are close to each other while those extracted from different identities are kept away. The strong per-element constraint on DeepID2 features can effectively reduce the intra-personal variations. On the other hand, using the verification signal alone (i.e. only distinguishing a pair of DeepID2 feature vectors at a time) is not as effective in extracting identityrelated features as using the identification signal (i.e. distinguishing thousands of identities at a time). Therefore, the two supervisory signals emphasize different aspects in feature learning and should be employed together. To characterize faces from different aspects, complementary DeepID2 features are extracted from various face regions and resolutions, and are concatenated to form the final feature representation after PCA dimension reduction. Since the learned DeepID2 features are diverse among different identities while consistent within the same identity, it makes the following face recognition easier. Using the learned feature representation and a recently proposed face verification model [3], we achieved the highest 99.15% face verification accuracy on the challenging and extensively studied LFW dataset [11]. This is the first time that a machine provided with only the face region achieves an accuracy on par with the 99.20% accuracy of human to whom the entire LFW face image including the face region and large background area are presented to verify. In recent years, a great deal of efforts have been made for face recognition with deep learning [5, 10, 18, 26, 8, 21, 20, 27]. Among the deep learning works, [5, 18, 8] learned features or deep metrics with the verification signal, while DeepFace [21] and our previous work DeepID [20] learned features with the identification signal and achieved accuracies around 97.45% on LFW. Our approach significantly improves the state-of-the-art. The idea of jointly solving the classification and verification tasks was applied to general object recognition [15], with the focus on improving classification accuracy on fixed object classes instead of hidden feature representations. Our work targets on learning features which can be well generalized to new classes (identities) and the verification task. 2 Identification-verification guided deep feature learning We learn features with variations of deep convolutional neural networks (deep ConvNets) [12]. The convolution and pooling operations in deep ConvNets are specially designed to extract visual features hierarchically, from local low-level features to global high-level ones. Our deep ConvNets take similar structures as in [20]. It contains four convolutional layers, with local weight sharing [10] in the third and fourth convolutional layers. The ConvNet extracts a 160-dimensional DeepID2 feature vector at its last layer (DeepID2 layer) of the feature extraction cascade. The DeepID2 layer to be learned are fully-connected to both the third and fourth convolutional layers. We use rectified linear units (ReLU) [17] for neurons in the convolutional layers and the DeepID2 layer. An illustration of the ConvNet structure used to extract DeepID2 features is shown in Fig. 1 given an RGB input of size 55 × 47. When the size of the input region changes, the map sizes in the following layers will change accordingly. The DeepID2 feature extraction process is denoted as f = Conv(x, θc), where Conv(·) is the feature extraction function defined by the ConvNet, x is the input face patch, f is the extracted DeepID2 feature vector, and θc denotes ConvNet parameters to be learned. 2 Figure 1: The ConvNet structure for DeepID2 feature extraction. DeepID2 features are learned with two supervisory signals. The first is face identification signal, which classifies each face image into one of n (e.g., n = 8192) different identities. Identification is achieved by following the DeepID2 layer with an n-way softmax layer, which outputs a probability distribution over the n classes. The network is trained to minimize the cross-entropy loss, which we call the identification loss. It is denoted as Ident(f, t, θid) = − n X i=1 pi log ˆpi = −log ˆpt , (1) where f is the DeepID2 feature vector, t is the target class, and θid denotes the softmax layer parameters. pi is the target probability distribution, where pi = 0 for all i except pt = 1 for the target class t. ˆpi is the predicted probability distribution. To correctly classify all the classes simultaneously, the DeepID2 layer must form discriminative identity-related features (i.e. features with large inter-personal variations). The second is face verification signal, which encourages DeepID2 features extracted from faces of the same identity to be similar. The verification signal directly regularize DeepID2 features and can effectively reduce the intra-personal variations. Commonly used constraints include the L1/L2 norm and cosine similarity. We adopt the following loss function based on the L2 norm, which was originally proposed by Hadsell et al.[7] for dimensionality reduction, Verif(fi, fj, yij, θve) = ( 1 2 ∥fi −fj∥2 2 if yij = 1 1 2 max 0, m −∥fi −fj∥2 2 if yij = −1 , (2) where fi and fj are DeepID2 feature vectors extracted from the two face images in comparison. yij = 1 means that fi and fj are from the same identity. In this case, it minimizes the L2 distance between the two DeepID2 feature vectors. yij = −1 means different identities, and Eq. (2) requires the distance larger than a margin m. θve = {m} is the parameter to be learned in the verification loss function. Loss functions based on the L1 norm could have similar formulations [15]. The cosine similarity was used in [17] as Verif(fi, fj, yij, θve) = 1 2 (yij −σ(wd + b))2 , (3) where d = fi·fj ∥fi∥2∥fj∥2 is the cosine similarity between DeepID2 feature vectors, θve = {w, b} are learnable scaling and shifting parameters, σ is the sigmoid function, and yij is the binary target of whether the two compared face images belong to the same identity. All the three loss functions are evaluated and compared in our experiments. Our goal is to learn the parameters θc in the feature extraction function Conv(·), while θid and θve are only parameters introduced to propagate the identification and verification signals during training. In the testing stage, only θc is used for feature extraction. The parameters are updated by stochastic gradient descent. The identification and verification gradients are weighted by a hyperparameter λ. Our learning algorithm is summarized in Tab. 1. The margin m in Eq. (2) is a special case, which cannot be updated by gradient descent since this will collapse it to zero. Instead, m is fixed and updated every N training pairs (N ≈200, 000 in our experiments) such that it is the threshold of 3 Table 1: The DeepID2 feature learning algorithm. input: training set χ = {(xi, li)}, initialized parameters θc, θid, and θve, hyperparameter λ, learning rate η(t), t ←0 while not converge do t ←t + 1 sample two training samples (xi, li) and (xj, lj) from χ fi = Conv(xi, θc) and fj = Conv(xj, θc) ∇θid = ∂Ident(fi,li,θid) ∂θid + ∂Ident(fj,lj,θid) ∂θid ∇θve = λ · ∂Verif(fi,fj,yij,θve) ∂θve , where yij = 1 if li = lj, and yij = −1 otherwise. ∇fi = ∂Ident(fi,li,θid) ∂fi + λ · ∂Verif(fi,fj,yij,θve) ∂fi ∇fj = ∂Ident(fj,lj,θid) ∂fj + λ · ∂Verif(fi,fj,yij,θve) ∂fj ∇θc = ∇fi · ∂Conv(xi,θc) ∂θc + ∇fj · ∂Conv(xj,θc) ∂θc update θid = θid −η(t) · ∇θid, θve = θve −η(t) · ∇θve, and θc = θc −η(t) · ∇θc. end while output θc Figure 2: Patches selected for feature extraction. The Joint Bayesian [3] face verification accuracy (%) using features extracted from each individual patch is shown below. the feature distances ∥fi −fj∥to minimize the verification error of the previous N training pairs. Updating m is not included in Tab. 1 for simplicity. 3 Face Verification To evaluate the feature learning algorithm described in Sec. 2, DeepID2 features are embedded into the conventional face verification pipeline of face alignment, feature extraction, and face verification. We first use the recently proposed SDM algorithm [24] to detect 21 facial landmarks. Then the face images are globally aligned by similarity transformation according to the detected landmarks. We cropped 400 face patches, which vary in positions, scales, color channels, and horizontal flipping, according to the globally aligned faces and the position of the facial landmarks. Accordingly, 400 DeepID2 feature vectors are extracted by a total of 200 deep ConvNets, each of which is trained to extract two 160-dimensional DeepID2 feature vectors on one particular face patch and its horizontally flipped counterpart, respectively, of each face. To reduce the redundancy among the large number of DeepID2 features and make our system practical, we use the forward-backward greedy algorithm [25] to select a small number of effective and complementary DeepID2 feature vectors (25 in our experiment), which saves most of the feature extraction time during test. Fig. 2 shows all the selected 25 patches, from which 25 160-dimensional DeepID2 feature vectors are extracted and are concatenated to a 4000-dimensional DeepID2 feature vector. The 4000-dimensional vector is further compressed to 180 dimensions by PCA for face verification. We learned the Joint Bayesian model [3] for face verification based on the extracted DeepID2 features. Joint Bayesian has been successfully used to model the joint probability of two faces being the same or different persons [3, 4]. 4 4 Experiments We report face verification results on the LFW dataset [11], which is the de facto standard test set for face verification in unconstrained conditions. It contains 13, 233 face images of 5749 identities collected from the Internet. For comparison purposes, algorithms typically report the mean face verification accuracy and the ROC curve on 6000 given face pairs in LFW. Though being sound as a test set, it is inadequate for training, since the majority of identities in LFW have only one face image. Therefore, we rely on a larger outside dataset for training, as did by all recent highperformance face verification algorithms [4, 2, 21, 20, 13]. In particular, we use the CelebFaces+ dataset [20] for training, which contains 202, 599 face images of 10, 177 identities (celebrities) collected from the Internet. People in CelebFaces+ and LFW are mutually exclusive. DeepID2 features are learned from the face images of 8192 identities randomly sampled from CelebFaces+ (referred to as CelebFaces+A), while the remaining face images of 1985 identities (referred to as CelebFaces+B) are used for the following feature selection and learning the face verification models (Joint Bayesian). When learning DeepID2 features on CelebFaces+A, CelebFaces+B is used as a validation set to decide the learning rate, training epochs, and hyperparameter λ. After that, CelebFaces+B is separated into a training set of 1485 identities and a validation set of 500 identities for feature selection. Finally, we train the Joint Bayesian model on the entire CelebFaces+B data and test on LFW using the selected DeepID2 features. We first evaluate various aspect of feature learning from Sec. 4.1 to Sec. 4.3 by using a single deep ConvNet to extract DeepID2 features from the entire face region. Then the final system is constructed and compared with existing best performing methods in Sec. 4.4. 4.1 Balancing the identification and verification signals We investigates the interactions of identification and verification signals on feature learning, by varying λ from 0 to +∞. At λ = 0, the verification signal vanishes and only the identification signal takes effect. When λ increases, the verification signal gradually dominates the training process. At the other extreme of λ →+∞, only the verification signal remains. The L2 norm verification loss in Eq. (2) is used for training. Figure 3 shows the face verification accuracy on the test set by comparing the learned DeepID2 features with L2 norm and the Joint Bayesian model, respectively. It clearly shows that neither the identification nor the verification signal is the optimal one to learn features. Instead, effective features come from the appropriate combination of the two. This phenomenon can be explained from the view of inter- and intra-personal variations, which could be approximated by LDA. According to LDA, the inter-personal scatter matrix is Sinter = Pc i=1 ni · (¯xi −¯x) (¯xi −¯x)⊤, where ¯xi is the mean feature of the i-th identity, ¯x is the mean of the entire dataset, and ni is the number of face images of the i-th identity. The intra-personal scatter matrix is Sintra = Pc i=1 P x∈Di (x −¯xi) (x −¯xi)⊤, where Di is the set of features of the i-th identity, ¯xi is the corresponding mean, and c is the number of different identities. The inter- and intra-personal variances are the eigenvalues of the corresponding scatter matrices, and are shown in Fig. 5. The corresponding eigenvectors represent different variation patterns. Both the magnitude and diversity of feature variances matter in recognition. If all the feature variances concentrate on a small number of eigenvectors, it indicates the diversity of intra- or inter-personal variations is low. The features are learned with λ = 0, 0.05, and +∞, respectively. The feature variances of each given λ are normalized by the corresponding mean feature variance. When only the identification signal is used (λ = 0), the learned features contain both diverse inter- and intra-personal variations, as shown by the long tails of the red curves in both figures. While diverse inter-personal variations help to distinguish different identities, large and diverse intra-personal variations are disturbing factors and make face verification difficult. When both the identification and verification signals are used with appropriate weighting (λ = 0.05), the diversity of the inter-personal variations keeps unchanged while the variations in a few main directions become even larger, as shown by the green curve in the left compared to the red one. At the same time, the intra-personal variations decrease in both the diversity and magnitude, as shown by the green curve in the right. Therefore, both the inter- and intra-personal variations changes in a direction that makes face verification easier. When λ further increases towards infinity, both the inter- and intra-personal variations collapse to the variations in only a few main directions, since without the identification signal, diverse features cannot be formed. With low diversity on inter5 Figure 3: Face verification accuracy by varying the weighting parameter λ. λ is plotted in log scale. Figure 4: Face verification accuracy of DeepID2 features learned by both the the face identification and verification signals, where the number of training identities (shown in log scale) used for face identification varies. The result may be further improved with more than 8192 identities. Figure 5: Spectrum of eigenvalues of the inter- and intra-personal scatter matrices. Best viewed in color. personal variations, distinguishing different identities becomes difficult. Therefore the performance degrades significantly. Figure 6 shows the first two PCA dimensions of features learned with λ = 0, 0.05, and +∞, respectively. These features come from the six identities with the largest numbers of face images in LFW, and are marked by different colors. The figure further verifies our observations. When λ = 0 (left), different clusters are mixed together due to the large intra-personal variations, although the cluster centers are actually different. When λ increases to 0.05 (middle), intra-personal variations are significantly reduced and the clusters become distinguishable. When λ further increases towards infinity (right), although the intra-personal variations further decrease, the cluster centers also begin to collapse and some clusters become significantly overlapped (as the red, blue, and cyan clusters in Fig. 6 right), making it hard to distinguish again. 4.2 Rich identity information improves feature learning We investigate how would the identity information contained in the identification supervisory signal influence the learned features. In particular, we experiment with an exponentially increasing number of identities used for identification during training from 32 to 8192, while the verification signal is generated from all the 8192 training identities all the time. Fig. 4 shows how the verification accuracies of the learned DeepID2 features (derived from the L2 norm and Joint Bayesian) vary on the test set with the number of identities used in the identification signal. It shows that 6 Figure 6: The first two PCA dimensions of DeepID2 features extracted from six identities in LFW. Table 2: Comparison of different verification signals. verification signal L2 L2+ L2L1 cosine none L2 norm (%) 94.95 94.43 86.23 92.92 87.07 86.43 Joint Bayesian (%) 95.12 94.87 92.98 94.13 93.38 92.73 identifying a large number (e.g., 8192) of identities is key to learning effective DeepID2 feature representation. This observation is consistent with those in Sec. 4.1. The increasing number of identities provides richer identity information and helps to form DeepID2 features with diverse interpersonal variations, making the class centers of different identities more distinguishable. 4.3 Investigating the verification signals As shown in Sec. 4.1, the verification signal with moderate intensity mainly takes the effect of reducing the intra-personal variations. To further verify this, we compare our L2 norm verification signal on all the sample pairs with those only constrain either the positive or negative sample pairs, denoted as L2+ and L2-, respectively. That is, the L2+ only decreases the distances between DeepID2 features of the same identity, while L2- only increases the distances between DeepID2 features of different identities if they are smaller than the margin. The face verification accuracies of the learned DeepID2 features on the test set, measured by the L2 norm and Joint Bayesian respectively, are shown in Table 2. It also compares with the L1 norm and cosine verification signals, as well as no verification signal (none). The identification signal is the same (classifying the 8192 identities) for all the comparisons. DeepID2 features learned with the L2+ verification signal are only slightly worse than those learned with L2. In contrast, the L2- verification signal helps little in feature learning and gives almost the same result as no verification signal is used. This is a strong evidence that the effect of the verification signal is mainly reducing the intra-personal variations. Another observation is that the face verification accuracy improves in general whenever the verification signal is added in addition to the identification signal. However, the L2 norm is better than the other compared verification metrics. This may be due to that all the other constraints are weaker than L2 and less effective in reducing the intra-personal variations. For example, the cosine similarity only constrains the angle, but not the magnitude. 4.4 Final system and comparison with other methods Before learning Joint Bayesian, DeepID2 features are first projected to 180 dimensions by PCA. After PCA, the Joint Bayesian model is trained on the entire CelebFaces+B data and tested on the 6000 given face pairs in LFW, where the log-likelihood ratio given by Joint Bayesian is compared to a threshold optimized on the training data for face verification. Tab. 3 shows the face verification accuracy with an increasing number of face patches to extract DeepID2 features, as well as the time used to extract those DeepID2 features from each face with a single Titan GPU. We achieve 98.97% accuracy with all the 25 selected face patches. The feature extraction process is also efficient and takes only 35 ms for each face image. The face verification accuracy of each individual face patch is provided in Fig. 2. The short DeepID2 signature is extremely efficient for face identification and face image search when matching a query image with a large number of candidates. 7 Table 3: Face verification accuracy with DeepID2 features extracted from an increasing number of face patches. # patches 1 2 4 8 16 25 accuracy (%) 95.43 97.28 97.75 98.55 98.93 98.97 time (ms) 1.7 3.4 6.1 11 23 35 Table 4: Accuracy comparison with the previous best results on LFW. method accuracy (%) High-dim LBP [4] 95.17 ± 1.13 TL Joint Bayesian [2] 96.33 ± 1.08 DeepFace [21] 97.35 ± 0.25 DeepID [20] 97.45 ± 0.26 GaussianFace [13] 98.52 ± 0.66 DeepID2 99.15 ± 0.13 Figure 7: ROC comparison with the previous best results on LFW. Best viewed in color. To further exploit the rich pool of DeepID2 features extracted from the large number of patches, we repeat the feature selection algorithm for another six times, each time choosing DeepID2 features from the patches that have not been selected by previous feature selection steps. Then we learn the Joint Bayesian model on each of the seven groups of selected features, respectively. We fuse the seven Joint Bayesian scores on each pair of compared faces by further learning an SVM. In this way, we achieve an even higher 99.15% face verification accuracy. The accuracy and ROC comparison with previous state-of-the-art methods on LFW are shown in Tab. 4 and Fig. 7, respectively. We achieve the best results and improve previous results with a large margin. 5 Conclusion This paper have shown that the effect of the face identification and verification supervisory signals on deep feature representation coincide with the two aspects of constructing ideal features for face recognition, i.e., increasing inter-personal variations and reducing intra-personal variations, and the combination of the two supervisory signals lead to significantly better features than either one of them. When embedding the learned features to the traditional face verification pipeline, we achieved an extremely effective system with 99.15% face verification accuracy on LFW. The arXiv report of this paper was published in June 2014 [19]. 8 References [1] P. N. Belhumeur, J. a. P. Hespanha, and D. J. Kriegman. Eigenfaces vs. Fisherfaces: Recognition using class specific linear projection. PAMI, 19:711–720, 1997. [2] X. Cao, D. Wipf, F. Wen, G. Duan, and J. Sun. A practical transfer learning algorithm for face verification. In Proc. ICCV, 2013. [3] D. Chen, X. Cao, L. Wang, F. Wen, and J. Sun. Bayesian face revisited: A joint formulation. In Proc. ECCV, 2012. [4] D. Chen, X. Cao, F. Wen, and J. Sun. Blessing of dimensionality: High-dimensional feature and its efficient compression for face verification. In Proc. CVPR, 2013. [5] S. Chopra, R. Hadsell, and Y. LeCun. Learning a similarity metric discriminatively, with application to face verification. In Proc. CVPR, 2005. [6] M. Guillaumin, J. Verbeek, and C. Schmid. Is that you? Metric learning approaches for face identification. In Proc. ICCV, 2009. [7] R. Hadsell, S. Chopra, and Y. LeCun. Dimensionality reduction by learning an invariant mapping. In Proc. CVPR, 2006. [8] J. Hu, J. Lu, and Y.-P. Tan. Discriminative deep metric learning for face verification in the wild. In Proc. CVPR, 2014. [9] C. Huang, S. Zhu, and K. Yu. Large scale strongly supervised ensemble metric learning, with applications to face verification and retrieval. NEC Technical Report TR115, 2011. [10] G. B. Huang, H. Lee, and E. Learned-Miller. Learning hierarchical representations for face verification with convolutional deep belief networks. In Proc. CVPR, 2012. [11] G. B. Huang, M. Ramesh, T. Berg, and E. Learned-Miller. Labeled Faces in the Wild: A database for studying face recognition in unconstrained environments. Technical Report 0749, University of Massachusetts, Amherst, 2007. [12] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 1998. [13] C. Lu and X. Tang. Surpassing human-level face verification performance on LFW with GaussianFace. Technical report, arXiv:1404.3840, 2014. [14] A. Mignon and F. Jurie. PCCA: A new approach for distance learning from sparse pairwise constraints. In Proc. CVPR, 2012. [15] H. Mobahi, R. Collobert, and J. Weston. Deep learning from temporal coherence in video. In Proc. ICML, 2009. [16] B. Moghaddam, T. Jebara, and A. Pentland. Bayesian face recognition. PR, 33:1771–1782, 2000. [17] V. Nair and G. E. Hinton. Rectified linear units improve restricted Boltzmann machines. In Proc. ICML, 2010. [18] Y. Sun, X. Wang, and X. Tang. Hybrid deep learning for face verification. In Proc. ICCV, 2013. [19] Y. Sun, X. Wang, and X. Tang. Deep learning face representation by joint identificationverification. Technical report, arXiv:1406.4773, 2014. [20] Y. Sun, X. Wang, and X. Tang. Deep learning face representation from predicting 10,000 classes. In Proc. CVPR, 2014. [21] Y. Taigman, M. Yang, M. Ranzato, and L. Wolf. DeepFace: Closing the gap to human-level performance in face verification. In Proc. CVPR, 2014. [22] X. Wang and X. Tang. Unified subspace analysis for face recognition. In Proc. ICCV, 2003. [23] X. Wang and X. Tang. A unified framework for subspace face recognition. PAMI, 26:1222– 1228, 2004. [24] X. Xiong and F. De la Torre Frade. Supervised descent method and its applications to face alignment. In Proc. CVPR, 2013. [25] T. Zhang. Adaptive forward-backward greedy algorithm for learning sparse representations. IEEE Trans. Inf. Theor., 57:4689–4708, 2011. [26] Z. Zhu, P. Luo, X. Wang, and X. Tang. Deep learning identity-preserving face space. In Proc. ICCV, 2013. [27] Z. Zhu, P. Luo, X. Wang, and X. Tang. Deep learning and disentangling face representation by multi-view perceptron. In Proc. NIPS, 2014. 9
2014
373
5,484
Joint Training of a Convolutional Network and a Graphical Model for Human Pose Estimation Jonathan Tompson, Arjun Jain, Yann LeCun, Christoph Bregler New York University {tompson, ajain, yann, bregler}@cs.nyu.edu Abstract This paper proposes a new hybrid architecture that consists of a deep Convolutional Network and a Markov Random Field. We show how this architecture is successfully applied to the challenging problem of articulated human pose estimation in monocular images. The architecture can exploit structural domain constraints such as geometric relationships between body joint locations. We show that joint training of these two model paradigms improves performance and allows us to significantly outperform existing state-of-the-art techniques. 1 Introduction Despite a long history of prior work, human body pose estimation, or specifically the localization of human joints in monocular RGB images, remains a very challenging task in computer vision. Complex joint inter-dependencies, partial or full joint occlusions, variations in body shape, clothing or lighting, and unrestricted viewing angles result in a very high dimensional input space, making naive search methods intractable. Recent approaches to this problem fall into two broad categories: 1) more traditional deformable part models [27] and 2) deep-learning based discriminative models [15, 30]. Bottom-up part-based models are a common choice for this problem since the human body naturally segments into articulated parts. Traditionally these approaches have relied on the aggregation of hand-crafted low-level features such as SIFT [18] or HoG [7], which are then input to a standard classifier or a higher level generative model. Care is taken to ensure that these engineered features are sensitive to the part that they are trying to detect and are invariant to numerous deformations in the input space (such as variations in lighting). On the other hand, discriminative deep-learning approaches learn an empirical set of low and high-level features which are typically more tolerant to variations in the training set and have recently outperformed part-based models [27]. However, incorporating priors about the structure of the human body (such as our prior knowledge about joint inter-connectivity) into such networks is difficult since the low-level mechanics of these networks is often hard to interpret. In this work we attempt to combine a Convolutional Network (ConvNet) Part-Detector – which alone outperforms all other existing methods – with a part-based Spatial-Model into a unified learning framework. Our translation-invariant ConvNet architecture utilizes a multi-resolution feature representation with overlapping receptive fields. Additionally, our Spatial-Model is able to approximate MRF loopy belief propagation, which is subsequently back-propagated through, and learned using the same learning framework as the Part-Detector. We show that the combination and joint training of these two models improves performance, and allows us to significantly outperform existing state-of-the-art models on the task of human body pose recognition. 1 2 Related Work For unconstrained image domains, many architectures have been proposed, including “shapecontext” edge-based histograms from the human body [20] or just silhouette features [13]. Many techniques have been proposed that extract, learn, or reason over entire body features. Some use a combination of local detectors and structural reasoning [25] for coarse tracking and [5] for persondependent tracking). In a similar spirit, more general techniques using “Pictorial Structures” such as the work by Felzenszwalb et al. [10] made this approach tractable with so called ‘Deformable Part Models (DPM)’. Subsequently a large number of related models were developed [1, 9, 31, 8]. Algorithms which model more complex joint relationships, such as Yang and Ramanan [31], use a flexible mixture of templates modeled by linear SVMs. Johnson and Everingham [16] employ a cascade of body part detectors to obtain more discriminative templates. Most recent approaches aim to model higher-order part relationships. Pishchulin [23, 24] proposes a model that augments the DPM model with Poselet [3] priors. Sapp and Taskar [27] propose a multi-modal model which includes both holistic and local cues for mode selection and pose estimation. Following the Poselets approach, the Armlets approach by Gkioxari et al. [12] employs a semi-global classifier for part configuration, and shows good performance on real-world data, however, it is tested only on arms. Furthermore, all these approaches suffer from the fact that they use hand crafted features such as HoG features, edges, contours, and color histograms. The best performing algorithms today for many vision tasks, and human pose estimation in particular ([30, 15, 29]) are based on deep convolutional networks. Toshev et al. [30] show state-of-art performance on the ‘FLIC’ [27] and ‘LSP’ [17] datasets. However, their method suffers from inaccuracy in the high-precision region, which we attribute to inefficient direct regression of pose vectors from images, which is a highly non-linear and difficult to learn mapping. Joint training of neural-networks and graphical models has been previously reported by Ning et al. [22] for image segmentation, and by various groups in speech and language modeling [4, 21]. To our knowledge no such model has been successfully used for the problem of detecting and localizing body part positions of humans in images. Recently, Ross et al. [26] use a message-passing inspired procedure for structured prediction on computer vision tasks, such as 3D point cloud classification and 3D surface estimation from single images. In contrast to this work, we formulate our message-parsing inspired network in a way that is more amenable to back-propagation and so can be implemented in existing neural networks. Heitz et al. [14] train a cascade of off-the-shelf classifiers for simultaneously performing object detection, region labeling, and geometric reasoning. However, because of the forward nature of the cascade, a later classifier is unable to encourage earlier ones to focus its effort on fixing certain error modes, or allow the earlier classifiers to ignore mistakes that can be undone by classifiers further in the cascade. Bergtholdt et al. [2] propose an approach for object class detection using a parts-based model where they are able to create a fully connected graph on parts and perform MAP-inference using A∗search, but rely on SIFT and color features to create the unary and pairwise potentials. 3 Model 3.1 Convolutional Network Part-Detector Fully-Connected Layers Image Patches 64x64 128x128 9x9x256 LCN 64x64x3 30x30x128 13x13x128 9x9x128 LCN 64x64x3 512 256 4 30x30x128 13x13x128 9x9x128 9x9x256 5x5 Conv + ReLU + Pool 5x5 Conv + ReLU + Pool 5x5 Conv + ReLU Conv + ReLU + Pool (3 Stages) LCN Figure 1: Multi-Resolution Sliding-Window With Overlapping Receptive Fields 2 The first stage of our detection pipeline is a deep ConvNet architecture for body part localization. The input is an RGB image containing one or more people and the output is a heat-map, which produces a per-pixel likelihood for key joint locations on the human skeleton. A sliding-window ConvNet architecture is shown in Fig 1. The network is slid over the input image to produce a dense heat-map output for each body-joint. Our model incorporates a multi-resolution input with overlapping receptive fields. The upper convolution bank in Fig 1 sees a standard 64x64 resolution input window, while the lower bank sees a larger 128x128 input context down-sampled to 64x64. The input images are then Local Contrast Normalized (LCN [6]) (after down-sampling with anti-aliasing in the lower resolution bank) to produce an approximate Laplacian pyramid. The advantage of using overlapping contexts is that it allows the network to see a larger portion of the input image with only a moderate increase in the number of weights. The role of the Laplacian Pyramid is to provide each bank with non-overlapping spectral content which minimizes network redundancy. Full Image 320x240px Conv + ReLU + Pool (3 stages) 98x68x128 90x60x512 90x60x256 90x60x4 9x9 Conv + ReLU 1x1 Conv + ReLU 1x1 Conv + ReLU Fully-connected equivalent model Figure 2: Efficient Sliding Window Model with Single Receptive Field An advantage of the Sliding-Window model (Fig 1) is that the detector is translation invariant. However a major drawback is that evaluation is expensive due to redundant convolutions. Recent work [11, 28] has addressed this problem by performing the convolution stages on the full input image to efficiently create dense feature maps. These dense feature maps are then processed through convolution stages to replicate the fully-connected network at each pixel. An equivalent but efficient version of the sliding window model for a single resolution bank is shown in Fig 2. Note that due to pooling in the convolution stages, the output heat-map will be a lower resolution than the input image. For our Part-Detector, we combine an efficient sliding window-based architecture with multiresolution and overlapping receptive fields; the subsequent model is shown in Fig 3. Since the large context (low resolution) convolution bank requires a stride of 1/2 pixels in the lower resolution image to produce the same dense output as the sliding window model, the bank must process four down-sampled images, each with a 1/2 pixel offset, using shared weight convolutions. These four outputs, along with the high resolution convolutional features, are processed through a 9x9 convolution stage (with 512 output features) using the same weights as the first fully connected stage (Fig 1) and then the outputs of the low resolution bank are added and interleaved with the output of high resolution bank. To improve training time we simplify the above architecture by replacing the lower-resolution stage with a single convolution bank as shown in Fig 4 and then upscale the resulting feature map. In our practical implementation we use 3 resolution banks. Note that the simplified architecture is no longer equivalent to the original sliding-window network of Fig 1 since the lower resolution convolution features are effectively decimated and replicated leading into the fully-connected stage, however we have found empirically that the performance loss is minimal. Supervised training of the network is performed using batched Stochastic Gradient Descent (SGD) with Nesterov Momentum. We use a Mean Squared Error (MSE) criterion to minimize the distance between the predicted output and a target heat-map. The target is a 2D Gaussian with a small variance and mean centered at the ground-truth joint locations. At training time we also perform random perturbations of the input images (randomly flipping and scaling the images) to increase generalization performance. 3 90x60x4 Full Image 320x240px 98x68x128 Offset 4x160x120px images Conv + ReLU + Pool (3 stages) Fully-connectioned equivalent model Conv + ReLU + Pool (3 stages) + 53x38x128 Replicate + Offset + Stride 2 + + + (1, 1) (2, 1) (1, 2) (2, 2) 9x9 Conv + ReLU ... ... 90x60x512 Interleaved 9x9 Conv + ReLU 9x9 Conv + ReLU 9x9 Conv + ReLU Figure 3: Efficient Sliding Window Model with Overlapping Receptive Fields Full Image 320x240px 98x68x128 Half-res Image 160x120px Conv + ReLU + Pool (3 stages) Fully-connectioned equivalent model 90x60x512 Conv + ReLU + Pool (3 stages) 53x38x128 9x9 Conv + ReLU 45x30x128 90x60x512 + Point-wise Upscale 90x60x4 9x9 Conv + ReLU 9x9 Conv + ReLU Figure 4: Approximation of Fig 3 3.2 Higher-Level Spatial-Model The Part-Detector (Section 3.1) performance on our validation set predicts heat-maps that contain many false positives and poses that are anatomically incorrect; for instance when a peak for face detection is unusually far from a peak in the corresponding shoulder detection. Therefore, in spite of the improved Part-Detector context, the feed forward network still has difficulty learning an implicit model of the constraints of the body parts for the full range of body poses. We use a higher-level Spatial-Model to constrain joint inter-connectivity and enforce global pose consistency. The expectation of this stage is to not increase the performance of detections that are already close to the ground-truth pose, but to remove false positive outliers that are anatomically incorrect. Similar to Jain et al. [15], we formulate the Spatial-Model as an MRF-like model over the distribution of spatial locations for each body part. However, the biggest drawback of their model is that the body part priors and the graph structure are explicitly hand crafted. On the other hand, we learn the prior model and implicitly the structure of the spatial model. Unlike [15], we start by connecting every body part to itself and to every other body part in a pair-wise fashion in the spatial model to create a fully connected graph. The Part-Detector (Section 3.1) provides the unary potentials for each body part location. The pair-wise potentials in the graph are computed using convolutional priors, which model the conditional distribution of the location of one body part to another. For instance, given that body part B is located at the center pixel, the convolution prior PA|B (i, j) is the likelihood of the body part A occurring in pixel location (i, j). For a body part A, we calculate the final marginal likelihood ¯pA as: ¯pA = 1 Z Y v∈V pA|v ∗pv + bv→A  (1) where v is the joint location, pA|v is the conditional prior described above, bv→a is a bias term used to describe the background probability for the message from joint v to A, and Z is the partition 4 function. Evaluation of Eq 1 is analogous to a single round of sum-product belief propagation. Convergence to a global optimum is not guaranteed given that our spatial model is not tree structured. However, as it can been seen in our results (Fig 8b), the inferred solution is sufficiently accurate for all poses in our datasets. The learned pair-wise distributions are purely uniform when any pairwise edge should to be removed from the graph structure. Fig 5 shows a practical example of how the Spatial-Model is able to remove an anatomically incorrect strong outlier from the face heat-map by incorporating the presence of a strong shoulder detection. For simplicity, only the shoulder and face joints are shown, however, this example can be extended to incorporate all body part pairs. If the shoulder heat-map shown in Fig 5 had an incorrect false-negative (i.e. no detection at the correct shoulder location), the addition of the background bias bv→A would prevent the output heat-map from having no maxima in the detected face region. x x * * f|f f|s Face Unary Shoulder Unary Face Shoulder Face Unary Shoulder Unary * * s|f s|s = = = = Shoulder Face Face Face Face Shoulder Shoulder Shoulder Figure 5: Didactic Example of Message Passing Between the Face and Shoulder Joints Fig 5 contains the conditional distributions for face and shoulder parts learned on the FLIC [27] dataset. For any part A the distribution PA|A is the identity map, and so the message passed from any joint to itself is its unary distribution. Since the FLIC dataset is biased towards front-facing poses where the right shoulder is directly to the lower right of the face, the model learns the correct spatial distribution between these body parts and has high probability in the spatial locations describing the likely displacement between the shoulder and face. For datasets that cover a larger range of the possible poses (for instance the LSP [17] dataset), we would expect these distributions to be less tightly constrained, and therefore this simple Spatial-Model will be less effective. For our practical implementation we treat the distributions above as energies to avoid the evaluation of Z. There are 3 reasons why we do not include the partition function. Firstly, we are only concerned with the maximum output value of our network, and so we only need the output energy to be proportional to the normalized distribution. Secondly, since both the part detector and spatial model parameters contain only shared weight (convolutional) parameters that are equal across pixel positions, evaluation of the partition function during back-propagation will only add a scalar constant to the gradient weight, which would be equivalent to applying a per-batch learning-rate modifier. Lastly, since the number of parts is not known a priori (since there can be unlabeled people in the image), and since the distributions pv describe the part location of a single person, we cannot normalize the Part-Model output. Our final model is a modification to Eq 1: ¯eA = exp X v∈V  log SoftPlus eA|v  ∗ReLU (ev) + SoftPlus (bv→A)  ! (2) where: SoftPlus (x) = 1/β log (1 + exp (βx)) , 1/2 ≤β ≤2 ReLU (x) = max (x, ϵ) , 0 < ϵ ≤0.01 Note that the above formulation is no longer exactly equivalent to an MRF, but still satisfactorily encodes the spatial constraints of Eq 1. The network-based implementation of Eq 2 is shown in Fig 6. Eq 2 replaces the outer multiplication of Eq 1 with a log space addition to improve numerical stability and to prevent coupling of the convolution output gradients (the addition in log space means that the partial derivative of the loss function with respect to the convolution output is not dependent on the output of any other stages). The inclusion of the SoftPlus and ReLU stages on the weights, biases and input heat-map maintains a strictly greater than zero convolution output, which prevents numerical issues for the values leading into the Log stage. Finally, a SoftPlus stage is used to 5 maintain continuous and non-zero weight and bias gradients during training. With this modified formulation, Eq 2 is trained using back-propagation and SGD. + + W11 Conv b W SoftPlus b11 SoftPlus log W12 Conv b W SoftPlus b12 SoftPlus log exp exp ReLU ReLU W21 Conv b W SoftPlus b21 SoftPlus log W SoftPlus b22 SoftPlus log Conv b W 22 Figure 6: Single Round Message Passing Network The convolution sizes are adjusted so that the largest joint displacement is covered within the convolution window. For our 90x60 pixel heat-map output, this results in large 128x128 convolution kernels to account for a joint displacement radius of 64 pixels (note that padding is added on the heat-map input to prevent pixel loss). Therefore for such large kernels we use FFT convolutions based on the GPU implementation by Mathieu et al. [19]. The convolution weights are initialized using the empirical histogram of joint displacements created from the training examples. This initialization improves learned performance, decreases training time and improves optimization stability. During training we randomly flip and scale the heat-map inputs to improve generalization performance. 3.3 Unified Model Since our Spatial-Model (Section 3.2) is trained using back-propagation, we can combine our PartDetector and Spatial-Model stages in a single Unified Model. To do so, we first train the PartDetector separately and store the heat-map outputs. We then use these heat-maps to train a SpatialModel. Finally, we combine the trained Part-Detector and Spatial-Models and back-propagate through the entire network. This unified fine-tuning further improves performance. We hypothesize that because the SpatialModel is able to effectively reduce the output dimension of possible heat-map activations, the PartDetector can use available learning capacity to better localize the precise target activation. 4 Results The models from Sections 3.1 and 3.2 were implemented within the Torch7 [6] framework (with custom GPU implementations for the non-standard stages above). Training the Part-Detector takes approximately 48 hours, the Spatial-Model 12 hours, and forward-propagation for a single image through both networks takes 51ms 1. We evaluated our architecture on the FLIC [27] and extended-LSP [17] datasets. These datasets consist of still RGB images with 2D ground-truth joint information generated using Amazon Mechanical Turk. The FLIC dataset is comprised of 5003 images from Hollywood movies with actors in predominantly front-facing standing up poses (with 1016 images used for testing), while the extended-LSP dataset contains a wider variety of poses of athletes playing sport (10442 training and 1000 test images). The FLIC dataset contains many frames with more than a single person, while the joint locations from only one person in the scene are labeled. Therefore an approximate torso bounding box is provided for the single labeled person in the scene. We incorporate this data by including an extra “torso-joint heat-map” to the input of the Spatial-Model so that it can learn to select the correct feature activations in a cluttered scene. 1We use a 12 CPU workstation with an NVIDIA Titan GPU 6 The FLIC-full dataset contains 20928 training images, however many of these training set images contain samples from the 1016 test set scenes and so would allow unfair overtraining on the FLIC test set. Therefore, we propose a new dataset - called FLIC-plus (http://cims.nyu.edu/∼tompson/flic plus.htm) - which is a 17380 image subset from the FLIC-plus dataset. To create this dataset, we produced unique scene labels for both the FLIC test set and FLICplus training sets using Amazon Mechanical Turk. We then removed all images from the FLIC-plus training set that shared a scene with the test set. Since 253 of the sample images from the original 3987 FLIC training set came from the same scene as a test set sample (and were therefore removed by the above procedure), we added these images back so that the FLIC-plus training set is a superset of the original FLIC training set. Using this procedure we can guarantee that the additional samples in FLIC-plus are sufficiently independent to the FLIC test set samples. For evaluation of the test-set performance we use the measure suggested by Sapp et. al. [27]. For a given normalized pixel radius (normalized by the torso height of each sample) we count the number of images in the test-set for which the distance of the predicted UV joint location to the ground-truth location falls within the given radius. Fig 7a and 7b show our model’s performance on the the FLIC test-set for the elbow and wrist joints respectively and trained using both the FLIC and FLIC-plus training sets. Performance on the LSP dataset is shown in Fig 7c and 8a. For LSP evaluation we use person-centric (or non-observercentric) coordinates for fair comparison with prior work [30, 8]. Our model outperforms existing state-of-the-art techniques on both of these challenging datasets with a considerable margin. Ours (FLIC) Ours (FLIC−plus) Toshev et. al. Jain et. al. MODEC Eichner et. al. Yang et. al. Sapp et. al. 0 2 4 6 8 10 12 14 16 18 20 0 10 20 30 40 50 60 70 80 90 100 Normalized distance error (pixels) Detection rate (a) FLIC: Elbow 0 2 4 6 8 10 12 14 16 18 20 0 10 20 30 40 50 60 70 80 90 100 Normalized distance error (pixels) Detection rate (b) FLIC: Wrist 0 2 4 6 8 10 12 14 16 18 20 0 10 20 30 40 50 60 70 80 90 100 Normalized distance error (pixels) Detection rate Ours: wrist Ours: elbow Toshev et al.: wrist Toshev et al.: elbow Dantone et al.: wrist Dantone et al.: elbow Pishchulin et al.: wrist Pishchulin et al.: elbow (c) LSP: Wrist and Elbow Figure 7: Model Performance Fig 8b illustrates the performance improvement from our simple Spatial-Model. As expected the Spatial-Model has little impact on accuracy for low radii threshold, however, for large radii it increases performance by 8 to 12%. Unified training of both models (after independent pre-training) adds an additional 4-5% detection rate for large radii thresholds. 0 2 4 6 8 10 12 14 16 18 20 0 10 20 30 40 50 60 70 80 90 100 Normalized distance error (pixels) Detection rate Ours: ankle Ours: knee Toshev et al.: ankle Toshev et al.: knee Dantone et al.: ankle Dantone et al.: knee Pishchulin et al.: ankle Pishchulin et al.: knee (a) LSP: Ankle and Knee 0 2 4 6 8 10 12 14 16 18 20 0 10 20 30 40 50 60 70 80 90 100 Normalized distance error (pixels) Detection rate Part−Model Part and Spatial−Model Joint Training (b) FLIC: Wrist 0 2 4 6 8 10 12 14 16 18 20 0 10 20 30 40 50 60 70 80 90 100 Normalized distance error (pixels) Detection rate 1 Bank 2 Banks 3 Banks (c) FLIC: Wrist Figure 8: (a) Model Performance (b) With and Without Spatial-Model (c) Part-Detector Performance Vs Number of Resolution Banks (FLIC subset) 7 The impact of the number of resolution banks is shown in Fig 8c). As expected, we see a big improvement when multiple resolution banks are added. Also note that the size of the receptive fields as well as the number and size of the pooling stages in the network also have a large impact on the performance. We tune the network hyper-parameters using coarse meta-optimization to obtain maximal validation set performance within our computational budget (less than 100ms per forwardpropagation). Fig 9 shows the predicted joint locations for a variety of inputs in the FLIC and LSP test-sets. Our network produces convincing results on the FLIC dataset (with low joint position error), however, because our simple Spatial-Model is less effective for a number of the highly articulated poses in the LSP dataset, our detector results in incorrect joint predictions for some images. We believe that increasing the size of the training set will improve performance for these difficult cases. Figure 9: Predicted Joint Positions, Top Row: FLIC Test-Set, Bottom Row: LSP Test-Set 5 Conclusion We have shown that the unification of a novel ConvNet Part-Detector and an MRF inspired SpatialModel into a single learning framework significantly outperforms existing architectures on the task of human body pose recognition. Training and inference of our architecture uses commodity level hardware and runs at close to real-time frame rates, making this technique tractable for a wide variety of application areas. For future work we expect to further improve upon these results by increasing the complexity and expressiveness of our simple spatial model (especially for unconstrained datasets like LSP). 6 Acknowledgments The authors would like to thank Mykhaylo Andriluka for his support. This research was funded in part by the Office of Naval Research ONR Award N000141210327. References [1] M. Andriluka, S. Roth, and B. Schiele. Pictorial structures revisited: People detection and articulated pose estimation. In CVPR, 2009. 8 [2] M. Bergtholdt, J. Kappes, S. Schmidt, and C. Schn¨orr. A study of parts-based object class detection using complete graphs. IJCV, 2010. [3] L. Bourdev and J. Malik. Poselets: Body part detectors trained using 3d human pose annotations. In ICCV, 2009. [4] H. Bourlard, Y. Konig, and N. Morgan. Remap: recursive estimation and maximization of a posteriori probabilities in connectionist speech recognition. In EUROSPEECH, 1995. [5] P. Buehler, A. Zisserman, and M. Everingham. Learning sign language by watching TV (using weakly aligned subtitles). CVPR, 2009. [6] R. Collobert, K. Kavukcuoglu, and C. Farabet. Torch7: A matlab-like environment for machine learning. In BigLearn, NIPS Workshop, 2011. [7] N. Dalal and B. Triggs. Histograms of oriented gradients for human detection. In CVPR, 2005. [8] M. Dantone, J. Gall, C. Leistner, and L. Van Gool. Human pose estimation using body parts dependent joint regressors. In CVPR’13. [9] M. Eichner and V. Ferrari. Better appearance models for pictorial structures. In BMVC, 2009. [10] P. Felzenszwalb, D. McAllester, and D. Ramanan. A discriminatively trained, multiscale, deformable part model. In CVPR, 2008. [11] A. Giusti, D. Ciresan, J. Masci, L. Gambardella, and J. Schmidhuber. Fast image scanning with deep max-pooling convolutional neural networks. In CoRR, 2013. [12] G. Gkioxari, P. Arbelaez, L. Bourdev, and J. Malik. Articulated pose estimation using discriminative armlet classifiers. In CVPR’13. [13] K. Grauman, G. Shakhnarovich, and T. Darrell. Inferring 3d structure with a statistical image-based shape model. In ICCV, 2003. [14] G. Heitz, S. Gould, A. Saxena, and D. Koller. Cascaded classification models: Combining models for holistic scene understanding. 2008. [15] A. Jain, J. Tompson, M. Andriluka, G. Taylor, and C. Bregler. Learning human pose estimation features with convolutional networks. In ICLR, 2014. [16] S. Johnson and M. Everingham. Learning Effective Human Pose Estimation from Inaccurate Annotation. In CVPR’11. [17] S. Johnson and M. Everingham. Clustered pose and nonlinear appearance models for human pose estimation. In BMVC, 2010. [18] D. Lowe. Object recognition from local scale-invariant features. In ICCV, 1999. [19] M. Mathieu, M. Henaff, and Y. LeCun. Fast training of convolutional networks through ffts. In CoRR, 2013. [20] G. Mori and J. Malik. Estimating human body configurations using shape context matching. ECCV, 2002. [21] F. Morin and Y. Bengio. Hierarchical probabilistic neural network language model. In Proceedings of the Tenth International Workshop on Artificial Intelligence and Statistics, 2005. [22] F. Ning, D. Delhomme, Y. LeCun, F. Piano, L. Bottou, and P. Barbano. Toward automatic phenotyping of developing embryos from videos. IEEE TIP, 2005. [23] L. Pishchulin, M. Andriluka, P. Gehler, and B. Schiele. Poselet conditioned pictorial structures. In CVPR’13. [24] L. Pishchulin, M. Andriluka, P. Gehler, and B. Schiele. Strong appearance and expressive spatial models for human pose estimation. In ICCV’13. [25] D. Ramanan, D. Forsyth, and A. Zisserman. Strike a pose: Tracking people by finding stylized poses. In CVPR, 2005. [26] S. Ross, D. Munoz, M. Hebert, and J.A Bagnell. Learning message-passing inference machines for structured prediction. In CVPR, 2011. [27] B. Sapp and B. Taskar. Modec: Multimodal decomposable models for human pose estimation. In CVPR, 2013. [28] P. Sermanet, D. Eigen, X. Zhang, M. Mathieu, R. Fergus, and Y. LeCun. Overfeat: Integrated recognition, localization and detection using convolutional networks. In ICLR, 2014. [29] J. Tompson, M. Stein, Y. LeCun, and K. Perlin. Real-time continuous pose recovery of human hands using convolutional networks. In TOG, 2014. [30] A. Toshev and C. Szegedy. Deeppose: Human pose estimation via deep neural networks. In CVPR, 2014. [31] Yi Yang and Deva Ramanan. Articulated pose estimation with flexible mixtures-of-parts. In CVPR’11. 9
2014
374
5,485
Permutation Diffusion Maps (PDM) with Application to the Image Association Problem in Computer Vision Deepti Pachauri†, Risi Kondor§, Gautam Sargur†, Vikas Singh‡† †Dept. of Computer Sciences, University of Wisconsin–Madison ‡Dept. of Biostatistics & Medical Informatics, University of Wisconsin–Madison §Dept. of Computer Science and Dept. of Statistics, The University of Chicago pachauri@cs.wisc.edu risi@uchicago.edu gautam@cs.wisc.edu vsingh@biostat.wisc.edu Abstract Consistently matching keypoints across images, and the related problem of finding clusters of nearby images, are critical components of various tasks in Computer Vision, including Structure from Motion (SfM). Unfortunately, occlusion and large repetitive structures tend to mislead most currently used matching algorithms, leading to characteristic pathologies in the final output. In this paper we introduce a new method, Permutations Diffusion Maps (PDM), to solve the matching problem, as well as a related new affinity measure, derived using ideas from harmonic analysis on the symmetric group. We show that just by using it as a preprocessing step to existing SfM pipelines, PDM can greatly improve reconstruction quality on difficult datasets. 1 Introduction Structure from motion (SfM) is the task of jointly reconstructing 3D scenes and camera poses from a set of images. Keypoints or features extracted from each image provide correspondences between pairs of images, making it possible to estimate the relative camera pose. This gives rise to an association graph in which two images are connected by an edge if they share a sufficient number of corresponding keypoints, and the edge itself is labeled by the estimated matching between the two sets of keypoints. Starting with these putative image to image associations, one typically uses the socalled bundle adjustment procedure to simultaneously solve for the global camera pose parameters and 3-D scene locations, incrementally minimizing the sum of squares of the re-projection error. Despite their popularity, large scale bundle adjustment methods have well known limitations. In particular, given the highly nonlinear nature of the objective function, they can get stuck in bad local minima. Therefore, starting with a good initial matching (i.e., an informative image association graph) is critical. Several papers have studied this behavior in detail [1], and conclude that if one starts the numerical optimization from an incorrect “seed” (i.e., a subgraph of the image associations), the downstream optimization is unlikely to ever recover. Similar challenges arise commonly in other fields, ranging from machine learning [2] to computational biology. For instance, consider the de novo genome assembly problem in computational biology [3]. The goal here is to reconstruct the original DNA sequence from fragments without a reference genome. Because the genome may have many repeated structures, the alignment problem becomes very hard. In general, reconstruction algorithms start with two maximally overlapping sequences and proceed by selecting the next fragment using a similar criterion. This procedure runs into the same type of issues as described above [4]. It will be useful to have a model that reasons globally over all pairwise information to provide a more robust metric for association. The efficacy of global reasoning will largely depend on the richness of the representation used for encoding pu1 tative pairwise information. The choice of representation is specific to the underlying application, so in this paper, to make our presentation as concrete as possible, we restrict ourselves to describing and evaluating our global association algorithm in the context of the structure from motion problem. In large scale structure from motion, several authors [5, 6, 7] have recentely identified situations where setting up a good image association graph is particularly difficult, and therefore a direct application of bundle adjustment yields highly unsatisfactory results. For example, consider a scene with a large number of duplicate structures (Fig. 1). The preprocessing (a) (b) Figure 1: HOUSE sequence. (a) Representative images. (b) Folded reconstruction by traditional SfM pipeline [8, 9]. step in a standard pipeline will match visual features and set up the associations accordingly. A key underlying assumption in most (if not all) approaches is that we observe only a single instance of any structure. This assumption is problematic where scenes have numerous architectural components or recurring patterns, such as windows, bricks, and so on. In Figure 1(a) views that look exactly the same do not necessarily represent the same physical structure. Some (or all) points in one image are actually occluded in the other image. Typical SfM methods will not work well when initialized with such image associations, regardless of which type of solver we use. In our example, the resulting reconstruction will be folded (Figure 1(b)). In other cases [5], we get errors ranging from phantom walls to severely superimposed structures yielding nonsensical reconstructions. Related Work. The issue described above is variously known in the literature as the SfM disambiguation problem or the data/image association problem in structure from motion. Some of the strategies that have been proposed to mitigate it impose additional conditions, such as in [10, 11, 12, 13, 14, 15], but this also breaks down in the presence of large coherent sets of incorrectly matched pairs. One creative solution in recent work is to use metadata alongside images. “Geotags” or GIS data when available have been shown to be very effective in deriving a better initialization for bundle adjustment or as a post-processing step to stitch together different components of a reconstruction. In [6], the authors suggest using image timestamps to impose a natural association among images, which is valuable when the images are acquired by a single camera in a temporal sequence but difficult to deploy otherwise. Separate from the metadata approach, in controlled scenes with relatively less occlusion, missing correspondences yield important local cues to infer potentially incorrect image pairs [6, 7]. Very recently, [5] formalized the intuition that incorrect feature correspondences result in anomalous structures in the so-called visibility graph of the features. By looking at a measure of local track quality (from local clustering), one can reason about which associations are likely to be erroneous. This works well when the number of points is very large, but the authors of [5] acknowledge that for datasets like those shown in Fig. 1, it may not help much. In contrast to the above approaches, a number of recent algorithms for the association (or disambiguation) problem argue for global geometric reasoning. In [16], the authors used the number of point correspondences as a measure of certainty, which was then globally optimized to find a maximum-weight set of consistent pairwise associations. The authors in [17] seek consistency of epipopolar geometry constraints for triplets, whereas [18] expands it over larger consistent cliques. The procedure in [16] takes into account loops of associations concurrently with a minimal spanning tree over image to image matches. In summary, the bulk of prior work suggests that locally based statistics over chained transformations will run into problems if the inconsistencies are more global in nature. However, even if the objectives used are global, approximate inference is not known to be robust to coherent noise which is exactly what we face in the presence of duplicate structures [19]. This paper. If we take the idea of reasoning globally about association consistency using triples or higher order loops to an extreme, it implies deriving the likelihood of a specific image to image association conditioned on all other associations. The maximum likelihood expression does not fac2 tor out easily and explicit enumeration quickly becomes intractable. Our approach will make the group structure of image to image relationships explicit. We will also operate on the association graph derived from image pairs but with a key distinguishing feature. The association relationships will now be denoted in terms of a ‘certificate’, that is, the transformation which justifies the relationship. The transformation may denote the pose parameters derived from the correspondences or the matching (between features) itself. Other options are possible — as long as this transformation is a group action from one set to the other. If so, we can carry over the intuition of consistency over larger cliques of images desired in existing works and rewrite those ideas as invariance properties of functions defined on the group. As an example, when the transformation is a matching, each edge in the graph is a permutation, i.e., a member of the symmetric group, Sn. It follows then that a special form of the Laplacian of this graph, derived from the representation theory of the group under consideration, encodes the symmetries of the functions on the group. The key contribution of this paper is to show that the global inference desired in many existing works falls out nicely as a diffusion process using such a Laplacian. We show promising results demonstrating that for various difficult datasets with large repetitive patterns, results from a simple decomposition procedure are, in fact, competitive with those obtained using sophisticated optimization schemes with/without metadata. Finally, we note that the proposed algorithm can either be used standalone to derive meaningful inputs to a bundle adjustment procedure or as a pre-conditioner to other approaches (especially, ones that incorporate timestamps and/or GPS data). 2 Synchronization Consider a collection of m images {I1, I2, . . . , Im} of the same object or scene taken from different viewpoints and possibly under different conditions, and assume that a keypoint detector has detected exactly n landmarks (keypoints) {xi 1, xi 2, . . . , xi n} in each Ii. Given two images Ii and Ij, the landmark matching problem consists of finding pairs of landmarks xi p ∼xj p in the two images which correspond to the same physical feature. This is a critical component of several classical computer vision tasks, including structure from motion. Assuming that both images contain exactly the same n landmarks, the matching between Ii and Ij can be described by a permutation τji : {1, 2, . . . , n} →{1, 2, . . . , n} under which xi p ∼xjτji(p). An initial guess for the τji matchings is usually provided by local image features, such as SIFT descriptors. However, these matchings individually are very much prone to error, especially in the presence of occlusion and repetitive structures. A major clue to correcting these errors is the constraint that matchings must be consistent, i.e., if τji tells us that xi p corresponds to xj q, and τkj tells us that xj q corresponds to xk r, then the permutation τki between Ii and Ik must assign xi p to xk r. Mathematically, this is a reflection of the fact that if we define the product of two permutations σ1 and σ2 in the usual way as σ3 = σ2σ1 ⇐⇒ σ3(i) = σ2(σ1(i)) i = 1, 2, . . . , n, then the n! different permutations of {1, 2, . . . , n} form a group. This group is called the symmetric group of order n and denoted Sn. In group theoretic notation, the consistency conditions require that for any Ii, Ij, Ik, the relative matchings between them satisfy τkjτji = τki. An equivalent condition is that to each Ii we can associate a base permutation σi so that τji = σjσ−1 i for any (i, j) pair. Thus, the problem of finding a consistent set of τji’s reduces to that of finding just m base permutations σ1, . . . , σm. Problems of this general form, where given some (finite or continuous) group G, one must estimate a matrix (gji)m j,i=1 of group elements obeying consistency relations, are called synchronization problems. Starting with the seminal work of Singer et al. [20] on synchronization over the rotation group for aligning images in cryo-EM, followed by synchronization over the Euclidean group [21], and most recently synchronization over Sn for matching landmarks [22][23], problems of this form have recently generated considerable interest. 2.1 Vector Diffusion Maps In the context of synchronizing three dimensional rotations for cryo-EM, Singer and Wu [24] have proposed a particularly elegant formalism, called Vector Diffusion Maps, which conceives of syn3 chronization as diffusing the base rotation Qi from each image to its neighbors. However, unlike in ordinary diffusion, as Qi diffuses to Ij, the observed Oji relative rotation of Ij to Ii changes Qi to OjiQi. If all the (Oji)i,j observations were perfectly synchronized, then no matter what path i →i1 →i2 →. . . →j we took from i to j, the resulting rotation Oj,ip . . . Oi2,i1Oi1,iQi would be the same. However, if some (in many practical cases, the majority) of the Oji’s are incorrect, then different paths from one vertex to another contribute different rotations that need to be averaged out. A natural choice for the loss that describes the extent to which the Q1, . . . , Qm imputed base rotations (playing the role of the σi’s in the permutation case) satisfy the Oji observations is E(Q1, . . . , Qm) = m X i,j=1 wij∥Qj −OjiQi ∥2 Frob = m X i,j=1 wij∥QjQ⊤ i −Oji ∥2 Frob, (1) where the wij edge weight descibes our confidence in the rotation Oji. A crucial observation is that this loss can be rewritten in the form E(Q1, . . . , Qm) = V ⊤LV , where V =    Q1 ... Qm   , L =    di I −w21 O21 . . . −wm1 Om1 ... ... ... −w1m O1m −w2m O2m . . . dm I   , (2) and di = P j̸=i wij. Note that since wij = wji, and Oij = O−1 ji = O⊤ ji, the matrix L is symmetric. Furthermore, the above is exactly analogous to the way in which in spectral graph theory, (see, e.g.,[25]) the functional E(f) = P i,j wi,j(f(i) −f(j))2 describing the “smoothness” of a function f defined on the vertices of a graph with respect to the graph topology can be written as f ⊤Lf in terms of the usual graph Laplacian Li,j = ( −wi,j i ̸= j P k̸=i wi,k i = j . The consequence of the latter is that (constraining f to have unit norm and excluding constant functions), the function minimizing E(f) is the eigenvector of L with (second) smallest eigenvalue. Analogously, in synchronizing rotations, the steady state of the diffusion system, where (1) is minimal, can be computed by forming V from the 3 lowest eigenvalue eigenvectors of L, and then identifying Qi with V (i), by which we denote its i’th 3 × 3 block. The resulting consistent array (QjQ⊤ i )i,j of imputed relative rotations minimizes the loss (1). 3 Permutation Diffusion Its elegance notwithstanding, the vector diffusion formalism of the previous section seems ill suited for our present purposes of improving the SfM pipeline for two reasons: (1) synchronizing over Sn, which is a finite group, seems much harder than synchronizing over the continuous group of rotations; (2) rather than an actual synchronized array of matchings, what is critical to SfM is to estimate the association graph that captures the extent to which any two images are related to oneanother. The main contribution of the present paper is to show that both of these problems have natural solutions in the formalism of group representations. Our first key observation (already briefly mentioned in [26]) is that the critical step of rewriting the loss (1) in terms of the Laplacian (2) does not depend on any special properties of the rotation group other than the fact (a) rotation matrices are unitary (in fact, orthogonal) (b) if we follow one rotation by another, their matrices simply multiply. In general, for any group G, a complex valued function ρ: G →Cdρ×dρ which satisfies ρ(g2g1) = ρ(g2)ρ(g1) is called a representation of G. The representation is unitary if ρ(g−1) = (ρ(g))−1 = ρ†, where M † denotes the Hermitian conjugate (conjugate transpose) of M. Thus, we have the following proposition. Proposition 1. Let G be any compact group with identity e and ρ: G →Cdρ×dρ be a unitary representation of G. Then given an array of possibly noisy and unsynchronized group elements, (gji)i,j and corresponding positive confidence weights (wji)i,j, the synchronization loss (assuming gii = e for all i) E(h1, . . . , hm) = m X i,j=1 wji ww ρ(hjh−1 i ) −ρ(gji) ww2 Frob h1, . . . , hm ∈G 4 can be written in the form E(h1, . . . , hm) = V †LV , where V =    ρ(h1) ... ρ(hm)   , L =    di I −w21 ρ(g21) . . . −wm1 ρ(gm1) ... ... ... −w1m ρ(g1m) −w2m ρ(g2m) . . . dm I   . (3) To synchronize putative matchings between images, we instantiate this proposition with the approriate unitary representation of the symmetric group. The obvious choice is the so-called defining representation, whose elements are the familiar permutation matrices ρdef(σ) = P(σ) [P(σ)]p,q = 1 σ(q) = p 0 otherwise, since the corresponding loss function is E(σ1, . . . , σm) = m X i,j=1 wji∥P(σjσ−1 i ) −P(τji) ∥2 Frob. (4) The squared Frobenius norm in this expression simply counts the number of mismatches between the observed but noisy permutations τji and the inferred permutations σjσ−1 i . Furthermore, by the results of the previous section, letting Pi ≡P(σ(i)) and bPji ≡P(τji) for notational simplicity, (4) can be written in the form V ⊤LV with V =    P1 ... Pm   , L =    di I −w21 bP21 . . . −wm1 bPm1 ... ... ... −w1m bP1m −w2m bP2m . . . dm I   , (5) Therefore, similarly to the rotation case, synchronization over Sn can be solved by forming V from the first dρdef = n lowest eigenvectors of L, and extracting each Pσi from its i’th n × n block. Here we must take a little care because unless the τji’s are already synchronized, it is not a priori guaranteed that the resulting block will be a valid permutation matrix. Therefore, analogously to the procedure described in [22], each block V (i) must be first be multiplied by V (1)⊤, and then a linear assignment procedure used to find the estimated permutation matrix bσi. The resulting algorithm we call Synchronization by Permutation Diffusion. 4 Uncertain matches and diffusion distance The obvious limitation of our framework, as described so far, is that it assumes that each keypoint in each image has a single counterpart in every other image. This assumption is far from being satisfied in realistic scenarios due to occlusion, repetitive structures, and noisy detections. Most algorithms, including [23] and [22], deal with this problem simply by setting the Pij entry of the Laplacian matrix in (5) equal to a weighted sum of all possible permutations. For example, if landmarks number 1. . . 20 are present in both images, but landmarks 21 . . . 40 are not, then the effective Pij matrix will have a corresponding 20 × 20 block of all ones in it, rescaled by a factor of 1/20. The consequence of this approach is that each block of the V matrix derived from L by eigendecomposition will also correspond to a distribution over base permutations. In principle, this amounts to replacing the single observed matching τji by an appropriate distribution tji(τ) over possible matchings, and concomitantly replacing each σi with a distribution pi(σ). However, if some set of landmarks {u1, . . . , uk} are occluded in Ii, then each tji will be agnostic with respect to the assignment of these landmarks, and therefore pi will be invariant to what labels are assigned to them. Defining µu1...uk as any permutation that maps 1 7→u1, . . . , k 7→uk, and regarding Sk as the subgroup of permutations that permute 1, 2, . . . , k amongst themselves but leave k + 1, . . . , n fixed, any set of permutations of the form {µu1...ukγ ν | γ ∈Sk} for some ν ∈Sn is called a right Sk–coset, and is denoted µu1...ukSk ν. If {u1, . . . , uk} are occluded in Ii, then pi is constant on each µu1...ukSk ν (i.e., for any choice of ν). Whenever there is occlusion, such invariances will spontaneously appear in the V matrix formed from the eigenvectors, and since they are related to which set of landmarks are hidden or uncertain, the invariances are an important clue about the viewpoint that the image was taken from. An affinity 5 score based on this information is sometimes even more valuable than the synchronized matchings themselves. The invariance structure of pi can be read off easily from its so-called autocorrelation function ai(σ) = X µ∈Sn pi(σµ)pi(µ). (6) In particular, if σ is in the coset µu1...ukSkµ−1 u1...uk, then whatever µ is, σµ will fall in the same µu1...ukSk ν coset, so for any such σ, ai(σ) = P µ∈Sn pi(µ)2, which is the maximum value that ai can attain. However, W(i) := V (i)V (1)⊤only reveals a weighted sum bpi(ρ) := P σ∈Sn pi(σ)ρ(σ) = W(i), rather than the full function pi, so we cannot compute (6) directly. Recent years have seen the emergence of a number of applications of Fourier transforms on the symmetric group, which, given a function f : Sn →R, is defined bf(λ) = X σ∈Sn f(σ) ρλ(σ), λ ⊢n, where the ρλ are special, so-called irreducible, representations of Sn, indexed by the λ integer partitions. Due to space restrictions, we leave the details of this construction to the literature, see, e.g., [27, 28, 29]. Suffice to say that while V (i) is not exactly a Fourier component of pi, it can be expressed as a direct sum of Fourier components V (i) = C†hM λ∈Λ bpi(λ) i C for some unitary matrix C that is effectively just a basis transform. One of the properties of the Fourier transform is that if h is the cross-correlation of two functions f and g (i.e., h(σ) = P µ∈Sn f(σµ)g(µ)), then bh(λ) = bf(λ)bg(λ)†. Consequently, assuming that V (1) has been normalized to ensure that V (1)⊤V (1) = I, bai(ρ) := C†hM λ∈Λ bai(λ) i C = C†hM λ∈Λ bpi(λ) bpi(λ)†i C = (V (i)V (1))(V (i)V (1))⊤= V (i)V (i)⊤ is an easily computable matrix that captures essentially all the coset invariance structure encoded in the inferred distribution pi. To compute an affinity score between some Ii and Ij it remains to compare their coset invariance structures, for example, by computing (P σ∈Snai(σ)aj(σ))1/2. Omitting certain multiplicative constants arising in the inverse Fourier transform, again using the correlation theorem, one finds that this is equivalent to Π(i, j) = tr(V (i)V (i)⊤V (j)V (j)⊤) 1/2, which we call Permutation Diffusion Affinity (PDA). Remarkably, PDA is closely related to the notion of diffusion similarity derived in [24] for rotations, using entirely different, differential geometric tools. Our experiments show that PDA is surprisingly informative about the actual distance between image viewpoints in physical space, and, as easy it is to compute, can greatly improve the performance of the SfM pipeline. 5 Experiments In our experiments we used Permutation Diffusion Maps to infer the image association matrix of various datasets described in the literature. Geometric ambiguities due to large duplicate structures are evident in each of these datasets, in up to 50% of the matches [6], so even sophisticated SfM pipelines run into difficulties. Our approach is to precede the entire SfM engine with one simple preprocessing step. If our preprocessing step generates good image association information, an existing SfM pipeline which is a very mature software with several linear algebra toolboxes and vision libraries integrated together, can provide good reconstructions. While our primary interest is SfM, to illustrate the utility of PDM, we also present experimental results for scene summarization for a set of images [30]. Additional experiments are available on the project website http://pages.cs.wisc.edu/∼pachauri/pdm/. 6 Structure from Motion (SfM). We used PDM to generate an image match matrix which is then fed to a state-of-the-art SfM pipeline for 3D reconstruction [8, 9]. As a baseline, we provide these images to a Bundle Adjustment procedure which uses visual features for matching and already has a built-in heuristic outlier removal module. Several other papers have used a similar set of comparisons [6]. For each dataset, SIFT was used to detect and characterize landmarks [31, 32]. We compute putative pairwise matchings (τij)m i,j=1 by solving m 2  linear independent assignments [33] based on their SIFT features. Image Match Matrix: Permutation matrix representation is used for putative matchings (τij)m i,j=1. Here, n is relative large, on the order of 1000. Ideally n is the total number of distinct keypoints in the 3D scene but n is not directly observable. In the experiments, the maximum of keypoints detected across the complete dataset was used to estimate n. Eigenvector based procedure computes weighted affinity matrix. While specialized methods can be used to extract a binary image matrix (such that it optimizes a specified criteria), we used a simple thresholding procedure. 3D reconstruction: We used binary match matrix as an input to a SfM library [8, 9]. Note that we only provide this library the image association hypotheses, leaving all other modules unchanged. With (potentially) good image association information, the SfM modules can sample landmarks more densely and perform bundle adjustment, leaving everything else unchanged. The baseline 3D reconstruction is performed using the same SfM pipeline without intervention. The HOUSE sequence has three instances of similar looking houses, see Figure 1. The diffusion process accumulates evidence and eventually provides strongly connected images in the data association matrix, see Figure 2(a). Warm colors correspond to high affinity between pairs of images. The binary match matrix was obtained by applying a threshold on the weighted matrix, see Figure 2(b). We used this matrix to define the image matching for feature tracks. This means that features are only matched between images that are connected in our match matrix. The SfM pipeline was given these image matches as a hypotheses to explain how the images are “connected”. The resulting reconstruction correctly gives three houses, see Figure 2(c). The same SfM pipeline when allowed to track features automatically with an outlier removal heuristic, resulted in a folded reconstruction, see Figure 1(b). One may ask if more specialized heuristics will do better, such as time stamps, as suggested in [6]. However, experimental results in [5] and others, strongly suggest that these datasets still remain challenging. (a) (b) (c) Figure 2: House sequence: (a) Weighted image association matrix. (b) Binary image match matrix. (c) PDM dense reconstruction. The CUP dataset has multiple images of a 180 degree symmetric cup from all sides, Figure 3(a). PDM reveals a strongly connected component along the diagonal for this dataset, shown in warm colors in Figure 3(b). Our global reasoning over the space of permutations substantially mitigates coherent errors. The binary match matrix was obtained by thresholding the weighted matrix, see Figure 3(c). As is evident from the reconstructions, the baseline method only reconstruct a “half cup”. Due to the structural ambiguity, it also concludes that the cup has two handles, Figure 4(b). PDM reconstruction gives a perfect reconstruction of the “full cup” with one handle as expected, see Figure 4(a). The OAT dataset contains two instances of a red oat box, one on the left of the (a) (b) (c) Figure 3: (a) Representative images from CUP dataset. (b) Weighted data association matrix. (c) Binary data association matrix. 7 (a) (b) Figure 4: CUP dataset. (a) PDM dense reconstruction. (b) Baseline dense reconstruction. wheat things, and another on the right, see Figure 5(a). The PDM weighted match matrix and binary match matrix successfully discover strongly connected components, see Figure 5(b-c). The baseline method confused the two oat boxes as one, and reconstructed only a single box, see Figure 6(b). Moreover, the structural ambiguity splits the wheat thins into two pieces. On the other hand, PDM gives a nice reconstruction of the two oat boxes with the entire wheat things in the middle, Figure 6(a). Several more experiments (with videos), can be found on the project website. (a) (b) (c) Figure 5: (a) Representative images from OAT dataset. (b) Weighted data association matrix. (c) Binary data association matrix. (a) (b) Figure 6: OAT dataset. (a) PDM dense reconstruction. (b) Baseline dense reconstruction. 6 Conclusions Permutation diffusion maps can significantly improve the quality of the correspondences found in image association problems, even when a large number of the initial visual feature matches are erroneous. Our experiments on a variety of challenging datasets from the literature give strong evidence supporting the hypothesis that deploying the proposed formulation, even as a preconditioner, can significantly mitigate problems encountered in performing structure from motion on scenes with repetitive structures. The proposed model can easily generalize to other applications, outside computer vision, involving multi-matching problems. Acknowledgments This work was supported in part by NSF–1320344, NSF–1320755, and funds from the University of Wisconsin Graduate School. We thank Charles Dyer and Li Zhang for useful discussions and suggestions. References [1] D. Crandall, A. Owens, N. Snavely, and D. P. Huttenlocher. Discrete-continuous optimization for largescale structure from motion. In CVPR, 2011. [2] A. Nguyen, M. Ben-Chen, K. Welnicka, Y. Ye, and L. Guibas. An optimization approach to improving collections of shape maps. In Computer Graphics Forum, volume 30, 2011. 8 [3] R. Li, H. Zhu, et al. De novo assembly of human genomes with massively parallel short read sequencing. Genome research, 20, 2010. [4] M. Pop, S. L. Salzberg, and M. Shumway. Genome sequence assembly: Algorithms and issues. IEEE Computer, 35, 2002. [5] K. Wilson and N. Snavely. Network principles for SfM: Disambiguating repeated structures with local context. In ICCV, 2013. [6] R. Roberts, S. Sinha, R. Szeliski, and D. Steedly. Structure from motion for scenes with large duplicate structures. In CVPR, 2011. [7] N. Jiang, P. Tan, and L. F. Cheong. Seeing double without confusion: Structure-from-motion in highly ambiguous scenes. In CVPR, 2012. [8] C. Wu. Towards linear-time incremental structure from motion. In 3DTV-Conference, International Conference on, 2013. [9] C. Wu, S. Agarwal, B. Curless, and S. M. Seitz. Multicore bundle adjustment. In CVPR, 2011. [10] F. Schaffalitzky and A. Zisserman. Multi-view matching for unordered image sets, or ”how do I organize my holiday snaps?”. In ECCV. 2002. [11] N. Snavely, S. M. Seitz, and R. Szeliski. Photo tourism: exploring photo collections in 3D. In ACM transactions on graphics (TOG), volume 25, 2006. [12] D. Martinec and T. Pajdla. Robust rotation and translation estimation in multiview reconstruction. In CVPR, 2007. [13] M. Havlena, A. Torii, J. Knopp, and T. Pajdla. Randomized structure from motion based on atomic 3d models from camera triplets. In CVPR, 2009. [14] S. N. Sinha, D. Steedly, and R. Szeliski. A multi-stage linear approach to structure from motion. In Trends and Topics in Computer Vision. 2012. [15] O. Ozyesil, A. Singer, and R. Basri. Camera motion estimation by convex programming. CoRR, 2013. [16] O. Enqvist, F. Kahl, and C. Olsson. Non-sequential structure from motion. In ICCV Workshops, 2011. [17] C. Zach, A. Irschara, and H. Bischof. What can missing correspondences tell us about 3d structure and motion? In CVPR, 2008. [18] C. Zach, M. Klopschitz, and M. Pollefeys. Disambiguating visual relations using loop constraints. In CVPR, 2010. [19] V. M. Govindu. Robustness in motion averaging. In Computer Vision–ACCV 2006, pages 457–466. Springer, 2006. [20] A. Singer and Y. Shkolnisky. Three-dimensional structure determination from common lines in cryo-EM by eigenvectors and semidefinite programming. SIAM Journal on Imaging Sciences, 4, 2011. [21] M. Cucuringu, Y. Lipman, and A. Singer. Sensor network localization by eigenvector synchronization over the Euclidean group. ACM Transactions on Sensor Networks (TOSN), 8, 2012. [22] D. Pachauri, R. Kondor, and V. Singh. Solving the multi-way matching problem by permutation synchronization. NIPS, 2013. [23] Qi-Xing Huang and Leonidas Guibas. Consistent shape maps via semidefinite programming. Computer Graphics Forum, 2013. [24] A. Singer and H.-T. Wu. Vector diffusion maps and the connection Laplacian. Communications of Pure and Applied Mathematics, 2011. [25] F. R. K. Chung. Spectral graph theory (cbms regional conference series in mathematics, no. 92). 1996. [26] A Singer. Angular synchronization by eigenvectors and semidefinite programming. Applied and computational harmonic analysis, 30, 2011. [27] J. Huang, C. Guestrin, and L. Guibas. Fourier theoretic probabilistic inference over permutations. JMLR, 2009. [28] R. Kondor. A Fourier space algorithm for solving quadratic assignment problems. In SODA, 2010. [29] D. Rockmore, P. Kostelec, W. Hordijk, and P. F. Stadler. Fast fourier transforms for fitness landscapes. Appl. and Comp. Harmonic Anal., 2002. [30] S. Zhu, L. Zhang, and B. M Smith. Model evolution: An incremental approach to non-rigid structure from motion. In CVPR, 2010. [31] D.G. Lowe. Distinctive image features from scale-invariant keypoints. IJCV, 60, 2004. [32] K. Mikolajczyk and C. Schmid. Scale & affine invariant interest point detectors. IJCV, 60, 2004. [33] H.W. Kuhn. The Hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2, 1955. 9
2014
375
5,486
Structure learning of antiferromagnetic Ising models Guy Bresler1 David Gamarnik2 Devavrat Shah1 Laboratory for Information and Decision Systems Department of EECS1 and Sloan School of Management2 Massachusetts Institute of Technology {gbresler,gamarnik,devavrat}@mit.edu Abstract In this paper we investigate the computational complexity of learning the graph structure underlying a discrete undirected graphical model from i.i.d. samples. Our first result is an unconditional computational lower bound of Ω(pd/2) for learning general graphical models on p nodes of maximum degree d, for the class of so-called statistical algorithms recently introduced by Feldman et al. [1]. The construction is related to the notoriously difficult learning parities with noise problem in computational learning theory. Our lower bound suggests that the ÂO(pd+2) runtime required by Bresler, Mossel, and Sly’s [2] exhaustive-search algorithm cannot be significantly improved without restricting the class of models. Aside from structural assumptions on the graph such as it being a tree, hypertree, tree-like, etc., many recent papers on structure learning assume that the model has the correlation decay property. Indeed, focusing on ferromagnetic Ising models, Bento and Montanari [3] showed that all known low-complexity algorithms fail to learn simple graphs when the interaction strength exceeds a number related to the correlation decay threshold. Our second set of results gives a class of repelling (antiferromagnetic) models that have the opposite behavior: very strong interaction allows efficient learning in time ÂO(p2). We provide an algorithm whose performance interpolates between ÂO(p2) and ÂO(pd+2) depending on the strength of the repulsion. 1 Introduction Graphical models have had tremendous impact in a variety of application domains. For unstructured high-dimensional distributions, such as in social networks, biology, and finance, an important first step is to determine which graphical model to use. In this paper we focus on the problem of structure learning: Given access to n independent and identically distributed samples ‡(1), . . . ‡(n) from an undirected graphical model representing a discrete random vector ‡ = (‡1, . . . , ‡p), the goal is to find the graph G underlying the model. Two basic questions are 1) How many samples are required? and 2) What is the computational complexity? In this paper we are mostly interested in the computational complexity of structure learning. We first consider the problem of learning a general discrete undirected graphical model of bounded degree. 1 1.1 Learning general graphical models Several algorithms based on exhaustively searching over possible node neighborhoods have appeared in the last decade [4, 2, 5]. Abbeel, Koller, and Ng [4] gave algorithms for learning general graphical models close to the true distribution in Kullback-Leibler distance. Bresler, Mossel, and Sly [2] presented algorithms guaranteed to learn the true underlying graph. The algorithms in both [4] and [2] perform a search over candidate neighborhoods, and for a graph of maximum degree d, the computational complexity for recovering a graph on p nodes scales as ÂO(pd+2) (where the ÂO notation hides logarithmic factors). While the algorithms in [2] are guaranteed to reconstruct general models under basic nondegeneracy conditions using an optimal number of samples n = O(d log p) (sample complexity lower bounds were proved by Santhanam and Wainwright [6] as well as [2]), the exponent d in the ÂO(pd+2) run-time is impractically high even for constant but large graph degrees. This has motivated a great deal of work on structure learning for special classes of graphical models. But before giving up on general models, we ask the following question: Question 1: Is it possible to learn the structure of general graphical models on p nodes with maximum degree d using substantially less computation than pd? Our first result suggests that the answer to Question 1 is negative. We show an unconditional computational lower bound of p d 2 for the class of statistical algorithms introduced by Feldman et al. [1]. This class of algorithms was introduced in order to understand the apparent difficulty of the Planted Clique problem, and is based on Kearns’ statistical query model [7]. Kearns showed in his landmark paper that statistical query algorithms require exponential computation to learn parity functions subject to classification noise, and our hardness construction is related to this problem. Most known algorithmic approaches (including Markov chain Monte Carlo, semidefinite programming, and many others) can be implemented as statistical algorithms, so the lower bound is fairly convincing. We give background and prove the following theorem in Section 4. Theorem 1.1. Statistical algorithms require at least Ω(p d 2 ) computation steps in order to learn the structure of a general graphical models of degree d. If complexity pd is to be considered intractable, what shall we consider as tractable? Writing algorithm complexity in the form c(d)pf(d), for high-dimensional (large p) problems the exponent f(d) is of primary importance, and we will think of tractable algorithms as having an f(d) that is bounded by a constant independent of d. The factor c(d) is also important, and we will use it to compare algorithms with the same exponent f(d). In light of Theorem 1.1, reducing computation below pΩ(d) requires restricting the class of models. One can either restrict the graph structure or the nature of the interactions between variables. The seminal paper of Chow and Liu [8] makes a model restriction of the first type, assuming that the graph is a tree; generalizations include to polytrees [9], hypertrees [10], and others. Among the many possible assumptions of the second type, the correlation decay property is distinguished: to the best of our knowledge all existing low-complexity algorithms require the correlation decay property [3]. 1.2 Correlation decay property Informally, a graphical model is said to have the correlation decay property (CDP) if any two variables ‡s and ‡t are asymptotically independent as the graph distance between s and t increases. Exponential decay of correlations holds when the distance from independence decreases exponentially fast in graph distance, and we will mean this stronger form when referring to correlation decay. Correlation decay is known to hold for a number of pairwise graphical models in the so-called high-temperature regime, including Ising, hard-core lattice gas, Potts (multinomial) model, and others (see, e.g., [11, 12, 13, 14, 15, 16]). 2 Bresler, Mossel, and Sly [2] observed that it is possible to efficiently learn models with (exponential) decay of correlations, under the additional assumption that neighboring variables have correlation bounded away from zero (as is true, e.g., for the ferromagnetic Ising model in the high temperature regime). The algorithm they proposed for this setting pruned the candidate set of neighbors for each node to roughly size O(d) by retaining only those variables with sufficiently high correlations, and then within this set performed the exhaustive search over neighborhoods mentioned before, resulting in a computational cost of dO(d) ÂO(p2). The greedy algorithms of Netrapali et al. [17] and Ray et al. [18] also require the correlation decay property and perform a similar pruning step by retaining only nodes with high pairwise correlation; they then use a different method to select the true neighborhood. A number of papers consider the problem of reconstructing Ising models on graphs with few short cycles, beginning with Anandkumar et al. [19]. Their results apply to the case of Ising models on sparsely connected graphs such as the Erd¨os-Renyi random graph G(p, d p). They additionally require the interaction parameters to be either generic or ferromagnetic. Ferromagnetic models have the benefit that neighbors always have a non-negligible correlation because the dependencies cannot cancel, but in either case the results still require the CDP to hold. Wu et al. [20] remove the assumption of generic parameters in [19], but again require the CDP. Other algorithms for structure learning are based on convex optimization, such as Ravikumar et al.’s [21] approach using regularized node-wise logistic regression. While this algorithm does not explicitly require the CDP, Bento and Montanari [3] found that the logistic regression algorithm of [21] provably fails to learn certain ferromagnetic Ising model on simple graphs without correlation decay. Other convex optimization-based algorithms such as [22, 23, 24] require similar incoherence or restricted isometry-type conditions that are difficult to verify, but likely also require correlation decay. Since all known algorithms for structure learning require the CDP, we ask the following question (paraphrasing Bento and Montanari): Question 2: Is low-complexity structure learning possible for models which do not exhibit the CDP, on general bounded degree graphs? Our second main result answers this question affirmatively by showing that a broad class of repelling models on general graphs can be learned using simple algorithms, even when the underlying model does not exhibit the CDP. 1.3 Repelling models The antiferromagnetic Ising model has a negative interaction parameter, whereby neighboring nodes prefer to be in opposite states. Other popular antiferromagnetic models include the Potts or coloring model, and the hard-core model. Antiferromagnetic models have the interesting property that correlations between neighbors can be zero due to cancellations. Thus algorithms based on pruning neighborhoods using pairwise correlations, such as the algorithm in [2] for models with correlation decay, does not work for anti-ferromagnetic models. To our knowledge there are no previous results that improve on the pd computational complexity for structure learning of antiferromagnetic models on general graphs of maximum degree d. Our first learning algorithm, described in Section 2, is for the hard-core model. Theorem 1.2 (Informal). It is possible to learn strongly repelling models, such as the hardcore model, with run-time ÂO(p2). We extend this result to weakly repelling models (equivalent to the antiferromagnetic Ising model parameterized in a nonstandard way, see Section 3). Here — is a repelling strength and h is an external field. Theorem 1.3 (Informal). Suppose — Ø (d ≠–)(h + ln 2) for an integer 0 Æ – < d. Then it is possible to learn a repelling model with interaction —, with run-time ÂO(p2+–). 3 The computational complexity of the algorithm interpolates between ÂO(p2), achievable for strongly repelling models, and ÂO(pd+2), achievable for general models using exhaustive search. The complexity depends on the repelling strength of the model, rather than structural assumptions on the graph as in [19, 20]. We remark that the strongly repelling models exhibit long-range correlations, yet the algorithmic task of graph structure learning is possible using a local procedure. The focus of this paper is on structure learning, but the problem of parameter estimation is equally important. It turns out that the structure learning problem is strictly more challenging for the models we consider: once the graph is known, it is not difficult to estimate the parameters with low computational complexity (see, e.g., [4]). 2 Learning the graph of a hard-core model We warm up by considering the hard-core model. The analysis in this section is straightforward, but serves as an example to highlight the fact that correlation decay is not a necessary condition for structure learning. Given a graph G = (V, E) on |V | = p nodes, denote by I(G) ™{0, 1}p the set of independent set indicator vectors ‡, for which at least one of ‡i or ‡j is zero for each edge {i, j} œ E(G). The hardcore model with fugacity ⁄ > 0 assigns nonzero probability only to vectors in I(G), with P(‡) = ⁄|‡| Z , ‡ œ I(G) . (2.1) Here |‡| is the number of entries of ‡ equal to one and Z = q ‡œI(G) ⁄|‡| is the normalizing constant called the partition function. If ⁄ > 1 then more mass is assigned to larger independent sets. (We use indicator vectors to define the model in order to be consistent with the antiferromagnetic Ising model in the next section.) Our goal is to learn the graph G = (V, E) underlying the model (2.1) given access to independent samples ‡(1), . . . , ‡(n). The following simple algorithm reconstructs G efficiently. Algorithm 1 simpleHC(‡(1), . . . , ‡(n)) 1: FOR each i, j, k: 2: IF ‡(k) i = ‡(k) j = 1, THEN S = S fi{i, j} 3: OUTPUT ˆE = Sc The idea behind the algorithm is very simple. If {i, j} belongs to the edge set E(G), then for every sample ‡(k) either ‡(k) i = 0 or ‡(k) j = 0 (or both). Thus for every i, j and k such that ‡(k) i = ‡(k) j = 1 we can safely declare {i, j} not to be an edge. To show correctness of the algorithm it is therefore sufficient to argue that for every non-edge {i, j} there is a high likelihood that such an independent set ‡(k) will be sampled. Before doing this, we observe that simpleHC actually computes the maximum-likelihood estimate for the graph G. To see this, note that an edge e = {i, j} for which ‡(k) i = ‡(k) j = 1 for some k cannot be in ˆG, since P(‡(k)| ˆG+e) = 0 for any ˆG. Thus the ML estimate contains a subset of those edges e which have not been ruled out by ‡(1), . . . , ‡(n). But adding any such edge e to the graph decreases the value of the partition function in (2.1) (the sum is over fewer independent sets), thereby increasing the likelihood of each of the samples. The sample complexity and computational complexity of simpleHC is as follows, with proof in the Supplement. Theorem 2.1. Consider the hard-core model (2.1) on a graph G = (V, E) on |V | = p nodes and with maximum degree d. The sample complexity of simpleHC is n = O((2⁄)2d≠2 log p) , (2.2) 4 i.e. with this many samples the algorithm simpleHC correctly reconstructs the graph with probability 1 ≠o(1). The computational complexity is O(np2) = O((2⁄)2d≠2p2 log p) . (2.3) We next show that the sample complexity bound in Theorem 2.1 is basically tight: Theorem 2.2 (Sample complexity lower bound). Consider the hard-core model (2.1). There is a family of graphs on p nodes with maximum degree d such that for the probability of successful reconstruction to approach one, the number of samples must scale as n = Ω 1 (2⁄)2d log p d 2 . Lemma 2.3. Suppose edge e = (i, j) /œ G, and let I be an independent set chosen according to the Gibbs distribution (2.1). Then P({i, j} ™I) Ø (9 · max{1, (2⁄)2d≠2})≠1 , “ . The Supplementary Material contains proofs for Theorem 2.2 and Lemma 2.3. 3 Learning anti-ferromagnetic Ising models In this section we consider the anti-ferromagnetic Ising model on a graph G = (V, E). We parametrize the model in such a way that each configuration has probability P(‡) = 1 Z exp ) H(‡) * , ‡ œ {0, 1}p , (3.1) where H(‡) = ≠— ÿ (i,j)œE ‡i‡j + ÿ iœV hi‡i . (3.2) Here — > 0 and {hi}iœV are real-valued parameters, and we assume that |hi| Æ h for all i. Working with configurations in {0, 1}p rather than the more typical {≠1, +1}p amounts to a reparametrization (which is without loss of generality as shown for example in Appendix 1 of [25]). Setting hi = h = ln ⁄ for all i, we recover the hard-core model with fugacity ⁄ in the limit — æ Œ, so we think of (3.2) as a “soft” independent set model. 3.1 Strongly antiferromagnetic models We start by considering the situation in which the repelling strength — is sufficiently large that we can modify the approach used for the hard-core model. We require some notation to work with conditional probabilities: for each vertex b œ V , let Bb = {‡(i) : ‡(i) b = 1} , and ˆP(‡a = 1|‡b = 1) := 1 |B||{i œ B : ‡(i) a = 1}| . Of course, E !ˆP(‡a = 1|‡b = 1) " = P(‡a = 1|‡b = 1). The algorithm, described next, determines whether each edge {a, b} is present based on comparing ˆP to a threshold. Algorithm 2 StrongRepelling Input: —, h, d, and n samples ‡(1), . . . , ‡(n) œ {0, 1}p. Output: edge set ˆE. 1: Let ” = (1 + 2deh(d≠1))≠2 2: FOR each possible edge {a, b} œ !V 2 " : 3: IF ˆP(‡a = 1|‡b = 1) Æ (1 + e—≠h)≠1 + ” THEN add edge (a, b) to ˆE 4: OUTPUT ˆE Algorithm StrongRepelling obtains the following performance. The proof of Proposition 3.1 is similar to that of Theorem 2.1, replacing Lemma 2.3 by Lemma 3.2 below. 5 Proposition 3.1. Consider the antiferromagnetic Ising model (3.2) on a graph G = (V, E) on p nodes and with maximum degree d. If — Ø d(h + ln 2) , then algorithm StrongRepelling has sample complexity n = O 1 22de2h(d+1) log p 2 , i.e. this many samples are sufficient to reconstruct the graph with probability 1 ≠o(1). The computational complexity of StrongRepelling is O(np2) = O 1 22de2h(d+1)p2 log p 2 . When the interaction parameter — Ø d(h+ln 2) it is possible to identify edges using pairwise statistics. The next lemma, proved in the Supplement, shows the desired separation. Lemma 3.2. We have the following estimates: (i) If (a, b) /œ E(G), then P(‡a = 1|‡b = 1) Ø 1 1+2deg(a)eh(deg(a)+1) . (ii) Conversely, if (a, b) œ E(G), then P(‡a = 1|‡b = 1) Æ 1 1+e—≠h . (ii) For any b œ V , P(‡b = 1) Ø 1 1+2deg(b)eh(deg(b)+1) . 3.2 Weakly antiferromagnetic models In this section we focus on learning weakly repelling models and show a trade-offbetween computational complexity and strength of the repulsion. Recall that for strongly repelling models our algorithm has run-time O(p2 log p), the same as for the hard-core model (infinite repulsion). For a subset of nodes U ™V , let G\U denote the graph obtained from G by removing nodes in U (as well as any edges incident to nodes in U). The following corollary is immediate from Lemma 3.2. Corollary 3.3. We have the conditional probability estimates for deleting subsets of nodes: (i) If (a, b) /œ E(G), then for any subset of nodes U µ V \ {a, b}, PG\U(‡a = 1|‡b = 1) Ø 1 1 + 2degG\U(a)eh(degG\U(a)+1) . (ii) Conversely, if (a, b) œ E(G), then for any subset of nodes U ™V \ {a, b} PG\U(‡a = 1|‡b = 1) Æ 1 1 + e—≠h . We can effectively remove nodes from the graph by conditioning: The family of models (3.2) has the property that conditioning on ‡i = 0 amounts to removing node i from the graph. Fact 3.4 (Self-reducibility). Let G = (V, E), and consider the model 3.2. Then for any subset of nodes U ™V , the probability law PG(‡ œ · |‡U = 0) is equal to PG\U(‡V \U œ · ). The final ingredient is to show that we can condition by restricting attention to a subset of the observed data, ‡(1), . . . , ‡(n), without throwing away too many samples. Lemma 3.5. Let U ™V be a subset of nodes and denote the subset of samples with variables ‡U equal to zero by AU = {‡(i) : ‡(i) u = 0 for all u œ U}. Then with probability at least 1 ≠exp(n/2(1 + eh)2|U|) the number |AU| of such samples is at least n 2 · (1 + eh)≠|U|. We now present the algorithm. Effectively, it reduces node degree by removing nodes (which can be done by conditioning on value zero), and then applies the strong repelling algorithm to the residual graph. 6 Algorithm 3 WeakRepelling Input: —, h, d, and n samples ‡(1), . . . , ‡(n) œ {0, 1}p. Output: edge set ˆE. 1: Let ” = (1 + 2deh(d≠1))≠2 2: FOR each possible edge (a, b) œ !V 2 " : 3: FOR each U ™V \ {a, b} of size |U| Æ Ád ≠—/(h + ln 2)Ë 4: Compute ˆPG\U(‡a = 1|‡b = 1) 5: IF minU:|U|= ˆPG\U(‡a = 1|‡b = 1) Æ (1 + e—≠h) + ” THEN add edge (a, b) to ˆE 6: OUTPUT ˆE Theorem 3.6. Let – be a nonnegative integer strictly smaller than d, and consider the antiferromagnetic Ising model 3.2 with — Ø (d ≠–)(h + ln 2) on a graph G. Algorithm WeakRepelling reconstructs the graph with probability 1 ≠o(1) as p æ Œ using n = O 1 (1 + eh)–22de2h(d+1) log p 2 i.i.d. samples, with run-time O ! np2+–" = ÂOh,d(p2+–) . 4 Statistical algorithms and proof of Theorem 1.1 We start by describing the statistical algorithm framework introduced by [1]. In this section it is convenient to work with variables taking values in {≠1, +1} rather than {0, 1}. 4.1 Background on statistical algorithms Let X = {≠1, +1}p denote the space of configurations and let D be a set of distributions over X. Let F be a set of solutions (in our case, graphs) and Z : D æ 2F be a map taking each distribution D œ D to a subset of solutions Z(D) ™F that are defined to be valid solutions for D. In our setting, since each graphical model is identifiable, there is a single graph Z(D) corresponding to each distribution D. For n > 0, the distributional search problem Z over D and F using n samples is to find a valid solution f œ Z(D) given access to n random samples from an unknown D œ D. The class of algorithms we are interested in are called unbiased statistical algorithms, defined by access to an unbiased oracle. Other related classes of algorithms are defined in [1], and similar lower bounds can be derived for those as well. Definition 4.1 (Unbiased Oracle). Let D be the true distribution. The algorithm is given access to an oracle, which when given any function h : X æ {0, 1}, takes an independent random sample x from D and returns h(x). These algorithms access the sampled data only through the oracle: unbiased statistical algorithms outsource the computation. Because the data is accessed through the oracle, it is possible to prove unconditional lower bounds using information-theoretic methods. As noted in the introduction, many algorithmic approaches can be implemented as statistical algorithms. We now define a key quantity called average correlation. The average correlation of a subset of distributions DÕ ™D relative to a distribution D is denoted fl(DÕ, D), fl(DÕ, D) := 1 |DÕ|2 ÿ D1,D2œDÕ ---=D1 D ≠1, D2 D ≠1 > D ---- , (4.1) where Èf, gÍD := Ex≥D[f(x)g(x)] and the ratio D1/D represents the ratio of probability mass functions, so (D1/D)(x) = D1(x)/D(x). We quote the definition of statistical dimension with average correlation from [1], and then state a lower bound on the number of queries needed by any statistical algorithm. 7 Definition 4.2 (Statistical dimension). Fix “ > 0, ÷ > 0, and search problem Z over set of solutions F and class of distributions D over X. We consider pairs (D, DD) consisting of a “reference distribution” D over X and a finite set of distributions DD ™D with the following property: for any solution f œ F, the set Df = DD \ Z≠1(f) has size at least (1 ≠÷) · |DD|. Let ¸(D, DD) be the largest integer ¸ so that for any subset DÕ ™Df with |DÕ| Ø |Df|/¸, the average correlation is |fl(DÕ, D)| < “ (if there is no such ¸ one can take ¸ = 0). The statistical dimension with average correlation “ and solution set bound ÷ is defined to be the largest ¸(D, DD) for valid pairs (D, DD) as described, and is denoted by SDA(Z, “, ÷). Theorem 4.3 ([1]). Let X be a domain and Z a search problem over a set of solutions F and a class of distributions D over X. For “ > 0 and ÷ œ (0, 1), let ¸ = SDA(Z, “, ÷). Any (possibly randomized) unbiased statistical algorithm that solves Z with probability ” requires at least m calls to the Unbiased Oracle for m = min ; ¸(” ≠÷) 2(1 ≠÷), (” ≠÷)2 12“ < . In particular, if ÷ Æ 1/6, then any algorithm with success probability at least 2/3 requires at least min{¸/4, 1/48“} samples from the Unbiased Oracle. In order to show that a graphical model on p nodes of maximum degree d requires computation pΩ(d) in this computational model, we therefore would like to show that SDA(Z, “, ÷) = pΩ(d) with “ = p≠Ω(d). 4.2 Soft parities For any subset S µ [p] of cardinality |S| = d, let ‰S(x) = r iœS xi be the parity of variables in S. Define a probability distribution by assigning mass to x œ {≠1, +1}p according to pS(x) = 1 Z exp(c · ‰S(x)) . (4.2) Here c is a constant, and the partition function is Z = ÿ x exp(c · ‰S(x)) = 2p≠1(ec + e≠c) . (4.3) Our family of distributions D is given by these soft parities over subsets S µ [p], and |D| = !p d " . The following lemma, proved in the supplementary material, computes correlations between distributions. Lemma 4.4. Let U denote the uniform distribution on {≠1, +1}p. For S ”= T, the correlation È pS U ≠1, pT U ≠1Í is exactly equal to zero for any value of c. If S = T, the correlation È pS U ≠1, pS U ≠1Í = 1 ≠ 4 (ec+e≠c)2 Æ 1. Lemma 4.5. For any set DÕ ™D of size at least |D|/pd/2, the average correlation satisfies fl(DÕ, U) Æ ddp≠d/2 . Proof. By the preceding lemma, the only contributions to the sum (4.1) comes from choosing the same set S in the sum, of which there are a fraction 1/|DÕ|. Each such correlation is at most one by Lemma 4.4, so flÆ 1/|DÕ| Æ pd/2/|D| = pd/2/ !p d " Æ dd/pd/2. Here we used the estimate !n k " Ø ( n k )k. Proof of Theorem 1.1. Let ÷ = 1/6 and “ = ddp≠d/2, and consider the set of distributions D given by soft parities as defined above. With reference distribution D = U, the uniform distribution, Lemma 4.5 implies that SDA(Z, “, ÷) of the structure learning problem over distribution (4.2) is at least ¸ = pd/2/dd. The result follows from Theorem 4.3. Acknowledgments This work was supported in part by NSF grants CMMI-1335155 and CNS-1161964, and by Army Research Office MURI Award W911NF-11-1-0036. 8 References [1] V. Feldman, E. Grigorescu, L. Reyzin, S. Vempala, and Y. Xiao, “Statistical algorithms and a lower bound for detecting planted cliques,” in STOC, pp. 655–664, ACM, 2013. [2] G. Bresler, E. Mossel, and A. Sly, “Reconstruction of Markov random fields from samples: Some observations and algorithms,” Approximation, Randomization and Combinatorial Optimization, pp. 343–356, 2008. [3] J. Bento and A. Montanari, “Which graphical models are difficult to learn?,” in NIPS, 2009. [4] P. Abbeel, D. Koller, and A. Y. Ng, “Learning factor graphs in polynomial time and sample complexity,” The Journal of Machine Learning Research, vol. 7, pp. 1743–1788, 2006. [5] I. Csisz´ar and Z. Talata, “Consistent estimation of the basic neighborhood of markov random fields,” The Annals of Statistics, pp. 123–145, 2006. [6] N. P. Santhanam and M. J. Wainwright, “Information-theoretic limits of selecting binary graphical models in high dimensions,” Info. Theory, IEEE Trans. on, vol. 58, no. 7, pp. 4117– 4134, 2012. [7] M. Kearns, “Efficient noise-tolerant learning from statistical queries,” Journal of the ACM (JACM), vol. 45, no. 6, pp. 983–1006, 1998. [8] C. Chow and C. Liu, “Approximating discrete probability distributions with dependence trees,” Information Theory, IEEE Transactions on, vol. 14, no. 3, pp. 462–467, 1968. [9] S. Dasgupta, “Learning polytrees,” in Proceedings of the Fifteenth conference on Uncertainty in artificial intelligence, pp. 134–141, Morgan Kaufmann Publishers Inc., 1999. [10] N. Srebro, “Maximum likelihood bounded tree-width markov networks,” in Proceedings of the Seventeenth conference on Uncertainty in artificial intelligence, pp. 504–511, Morgan Kaufmann Publishers Inc., 2001. [11] R. L. Dobrushin, “Prescribing a system of random variables by conditional distributions,” Theory of Probability &amp; Its Applications, vol. 15, no. 3, pp. 458–486, 1970. [12] R. L. Dobrushin and S. B. Shlosman, “Constructive criterion for the uniqueness of gibbs field,” in Statistical physics and dynamical systems, pp. 347–370, Springer, 1985. [13] J. Salas and A. D. Sokal, “Absence of phase transition for antiferromagnetic potts models via the dobrushin uniqueness theorem,” Journal of Statistical Physics, vol. 86, no. 3-4, pp. 551–579, 1997. [14] D. Gamarnik, D. A. Goldberg, and T. Weber, “Correlation decay in random decision networks,” Mathematics of Operations Research, vol. 39, no. 2, pp. 229–261, 2013. [15] D. Gamarnik and D. Katz, “Correlation decay and deterministic fptas for counting listcolorings of a graph,” in Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, pp. 1245–1254, Society for Industrial and Applied Mathematics, 2007. [16] D. Weitz, “Counting independent sets up to the tree threshold,” in Proceedings of the thirtyeighth annual ACM symposium on Theory of computing, pp. 140–149, ACM, 2006. [17] P. Netrapalli, S. Banerjee, S. Sanghavi, and S. Shakkottai, “Greedy learning of markov network structure,” in 48th Allerton Conference, pp. 1295–1302, 2010. [18] A. Ray, S. Sanghavi, and S. Shakkottai, “Greedy learning of graphical models with small girth,” in 50th Allerton Conference, 2012. [19] A. Anandkumar, V. Tan, F. Huang, and A. Willsky, “High-dimensional structure estimation in Ising models: Local separation criterion,” Ann. of Stat., vol. 40, no. 3, pp. 1346–1375, 2012. [20] R. Wu, R. Srikant, and J. Ni, “Learning loosely connected Markov random fields,” Stochastic Systems, vol. 3, no. 2, pp. 362–404, 2013. [21] P. Ravikumar, M. Wainwright, and J. Lafferty, “High-dimensional Ising model selection using ¸1-regularized logistic regression,” The Annals of Statistics, vol. 38, no. 3, pp. 1287–1319, 2010. [22] S.-I. Lee, V. Ganapathi, and D. Koller, “Efficient structure learning of markov networks using l 1-regularization,” in Advances in neural Information processing systems, pp. 817–824, 2006. [23] A. Jalali, C. C. Johnson, and P. D. Ravikumar, “On learning discrete graphical models using greedy methods.,” in NIPS, pp. 1935–1943, 2011. [24] A. Jalali, P. Ravikumar, V. Vasuki, S. Sanghavi, and U. ECE, “On learning discrete graphical models using group-sparse regularization,” in Inter. Conf. on AI and Statistics (AISTATS), vol. 14, 2011. [25] A. Sinclair, P. Srivastava, and M. Thurley, “Approximation algorithms for two-state antiferromagnetic spin systems on bounded degree graphs,” Journal of Statistical Physics, vol. 155, no. 4, pp. 666–686, 2014. 9
2014
376
5,487
Clustered factor analysis of multineuronal spike data Lars Buesing1, Timothy A. Machado1,2, John P. Cunningham1 and Liam Paninski1 1 Department of Statistics, Center for Theoretical Neuroscience & Grossman Center for the Statistics of Mind 2 Howard Hughes Medical Institute & Department of Neuroscience Columbia University, New York, NY {lars,cunningham,liam}@stat.columbia.edu Abstract High-dimensional, simultaneous recordings of neural spiking activity are often explored, analyzed and visualized with the help of latent variable or factor models. Such models are however ill-equipped to extract structure beyond shared, distributed aspects of firing activity across multiple cells. Here, we extend unstructured factor models by proposing a model that discovers subpopulations or groups of cells from the pool of recorded neurons. The model combines aspects of mixture of factor analyzer models for capturing clustering structure, and aspects of latent dynamical system models for capturing temporal dependencies. In the resulting model, we infer the subpopulations and the latent factors from data using variational inference and model parameters are estimated by Expectation Maximization (EM). We also address the crucial problem of initializing parameters for EM by extending a sparse subspace clustering algorithm to integer-valued spike count observations. We illustrate the merits of the proposed model by applying it to calcium-imaging data from spinal cord neurons, and we show that it uncovers meaningful clustering structure in the data. 1 Introduction Recent progress in large-scale techniques for recording neural activity has made it possible to study the joint firing statistics of 102 up to 105 cells at single-neuron resolution. Such data sets grant unprecedented insight into the temporal and spatial structure of neural activity and will hopefully lead to an improved understanding of neural coding and computation. These recording techniques have spurred the development of statistical analysis tools which help to make accessible the information contained in simultaneously recorded activity time-series. Amongst these tools, latent variable models prove to be particularly useful for analyzing such data sets [1, 2, 3, 4]. They aim to capture shared structure in activity across different neurons and therefore provide valuable summary statistics of high-dimensional data that can be used for exploratory data analysis as well as for visualization purposes. The majority of latent variable models, however, being relatively general purpose tools, are not designed to extract additional structure from the data. This leads to latent variables that can be hard to interpret biologically. Furthermore, additional information from other sources, such as spatial structure or genetic cell type information, cannot be readily integrated into these models. An approach to leveraging simultaneous activity recordings that is complementary to applying unstructured factor models, is to infer detailed circuit properties from the data. By modelling the detailed interactions between neurons in a local micro-circuit, multiple tools aim at inferring the existence, type, and strength of synaptic connections between neurons [5, 6]. In spite of algorithmic progress [7], the feasibility of this approach has only been demonstrated in circuits of up to three 1 neurons [8], as large scale data with ground truth connectivity is currently only rarely available. This lack of validation data sets also makes it difficult to asses the impact of model mismatch and unobserved, highly-correlated noise sources (“common input”). Here, we propose a statistical tool for analyzing multi-cell recordings that offers a middle ground between unstructured latent variable models and models for inferring detailed network connectivity. The basic goal of the model is to cluster neurons into groups based on their joint activity statistics. Clustering is a ubiquitous and valuable tool in statistics and machine learning as it often yields interpretable structure (a partition of the data), and is of particular relevance in neuroscience because neurons often can be categorized into distinct groups based on their morphology, physiology, genetic identity or stimulus-response properties. In many experimental setups, side-information allowing for a reliable supervised partitioning of the recorded neurons is not available. Hence, the main goal of the paper is to develop a method for clustering neurons based on their activity recordings. We model the firing time-series of a cluster of neurons using latent factors, assuming that different clusters are described by disjoint sets of factors. The resulting model is similar to a mixture of factor analyzers [9, 10] with Poisson observations, where each mixture component describes a subpopulation of neurons. In contrast to a mixture of factor analyzers model which assumes independent factors, we put a Markovian prior over the factors, capturing temporal dependencies of neural activity as well as interactions between different clusters over time. The resulting model, which we call mixture of Poisson linear dynamical systems (mixPLDS) model, is able to capture more structure using the cluster assignments compared to latent variable models previously applied to neural recordings, while at the same time still providing low-dimensional latent trajectories for each cluster for exploratory data analysis and visualization. In contrast to the lack of connectivity ground truth for neurons from large-scale recordings, there are indeed large-scale activity recordings available that exhibit rich and biologically interpretable clustering structure, allowing for a validation of the mixPLDS model in practice. 2 Mixture of Poisson linear dynamical systems for modelling neural subpopulations 2.1 Model definition Let ykt denote the observed spike count of neuron k = 1, . . . , K in time-bin t = 1, . . . , T. For the mixture of Poisson linear dynamical systems (mixPLDS) model, we assume that each neuron k belongs to exactly one of M groups (subpopulations, clusters), indicated by the discrete (categorical) variable sk ∈{1, . . . , M}. The sk are modelled as i.i.d.: p(s) = K Y k=1 p(sk) = K Y k=1 Disc(sk|φ0), (1) where φ0 := (φ1 0, . . . , φM 0 ) are the natural parameters of the categorical distribution. In the remainder of the paper we use the convention that the group-index m = 1, . . . , M is written as superscript. The activity of each subpopulation m at time t is modeled by a latent variable xm t ∈Rdm. We assume that these latent variables (we will also call them factors) are jointly normal and we model interactions between different groups by a linear dynamical system (LDS) prior: xt =    x1 t... xM t    = Axt−1 + ηt =    A11 · · · A1M ... ... AM1 · · · AMM       x1 t−1 ... xM t−1   + ηt, (2) where the block-matrices Aml ∈Rdm×dl capture the interactions between groups m and l. The innovations ηt are i.i.d. from N(0, Q) and the starting distribution is given by x1 ∼N(µ1, Q1). If neuron k belongs to group m, i.e. sk = m, we model its activity ykt at time t as Poisson distributed spike count with a log-rate given by an affine combination of the factors of group m: zkt | sk = m = Cm k: xm t (3) ykt | zkt, sk ∼ Poisson(exp(zkt + bk)), (4) 2 where b ∈RK captures the baseline of the firing rates. We denote with Cm ∈RK×dm the group loading matrix with rows Cm k: for neurons k in group m and fill in the remaining rows with 0s for all neurons not in group m. We concatenate these into the total loading matrix C := (C1 · · · CM) ∈RK×d, where d := PM m=1 dm is the total latent dimension. If the neurons are sorted with respect to their group membership, then the total loading C has block-diagonal structure. Further, we denote with yk: := (yk,1 · · · yk,T ) the activity time series of neuron k and use an analogous notation for xm n := (xm n,1 · · · xm n,T ) ∈R1×T for n = 1, . . . , dm. The model parameters are θ := (A, Q, Q1, µ1, C, b); we consider the hyper-parameters φ0 to be given and fixed. For known clusters s, the mixPLDS model can be regarded as a special case of the Poisson linear dynamical system (PLDS) model [3], where the loading C is block-diagonal. For unknown group memberships s, the mixPLDS model defined above is similar to a mixture of factor analyzers (e.g. see [9, 10]) with Poisson observations over neurons k = 1, . . . , K. In the mixPLDS model however, we do not restrict the factors of the mixture components to be independent but allow for interactions over time which are modeled by a LDS. 2.2 Variational inference and parameter estimation for the mixPLDS model When applying the mixPLDS model to data y, we are interested in inferring the group memberships s and the latent trajectories x as well as estimating the parameters θ. For known parameters θ, the posterior p(x, s|y, θ) (even in the special case of a single mixture component M = 1) is not available in closed form and needs approximating. Here we propose to approximate the posterior using variational inference with the following factorization assumption: p(x, s|y, θ) ≈ q(x)q(s). (5) We further restrict q(x) to be a normal distribution q(x) = N(x|m, V ) with mean m and covariance V . Under the assumption (5), q(s) further factorizes into the product Q k q(sk) where q(sk) is a categorical distribution with natural parameters φk = (φ1 k, . . . , φM k ). The variational parameters m, V and φ = (φ1, . . . , φK) are obtained by maximizing the variational lower bound of the log marginal likelihood log p(y|θ): L(m, V, φ, θ) = 1 2 log |V | −tr[Σ−1V ] −(m −µ)⊤Σ−1(m −µ)  + K X k=1 DKL[q(sk)∥p(sk)] + M X m=1 K X k=1 T X t=1 πm k (ykthm kt −exp(hm kt + ρm kt/2)) + const (6) hm t := Cmmt + b, ρm t := diag(CmVtCm⊤), πm k ∝exp(φm k ), where Vt = Covq(x)[xt] and µ ∈RdT , Σ ∈RdT ×dT are the mean and covariance of the LDS prior over x. The first two terms in (6) are the Kullback-Leibler divergence between the prior p(x, s) = p(x)p(s) and its approximation q(x)q(s), penalizing a variational posterior that is far away from the prior. The third term in (6) is given by the expected log-likelihood of the data, promoting a posterior approximation that explains the observed data well. We optimize L in a coordinate ascent manner, i.e. we hold φ fixed and optimize jointly over m, V and vice versa. A naive implementation of the optimization of L over {m, V } is prohibitively costly for data sets with large T, as the posterior covariance V has O((dT)2) elements and has to be optimized over the set of semi-definite matrices. Instead of solving this large program, we apply a method proposed in [11], where the authors show that Gaussian variational inference for latent Gaussian models with Poisson observations can be solved more efficiently using the dual problem. We generalize their approach to the mixture of Poisson observation model (3) considered here, and we also leverage the Markovian structure of the LDS prior to speed up computations (see below). In the supplementary material, we derive this approach to inference in the mixPLDS model in detail. The optimization over φ is available in closed form and is also given in the supplementary material. We iterate updates over m, V and φ. In practice, this method converges very quickly, often requiring only two or three iterations to reach a reasonable convergence criterion. The most computationally intensive part of the proposed variational inference method is the update of m, V . Using properties of the LDS prior (i.e. the prior precision Σ−1 is block-tri-diagonal), 3 we can show that evaluation of L, its dual and the gradient of the latter all cost O(KTd + Td3), which is the same complexity as Kalman smoothing in a LDS with Gaussian observations or a single iteration of Laplace inference over x. While having the same cost as Laplace approximation, variational inference has the advantage of a non-deceasing variational lower bound L, which can be used for monitoring convergence as well as for model comparison. We can also get estimates for the model parameters by maximizing the lower bound L over θ. To this end, we interleave updates of φ and m, V with maximizations over θ. The latter corresponds to standard parameter updates in a LDS model with Poisson observations and are discussed e.g. in [3]. This procedure implements variational Expectation Maximization (VEM) in the mixPLDS model. 2.3 Initialization by Poisson subspace clustering In principle, for a given number of groups M with given dimensions d1, . . . , dM one can estimate the parameters of the mixPLDS using VEM as described above. In practice we find however that this yields poor results without having reasonable initial membership assignments s, i.e. reasonable initial values for the variational parameters φ. Furthermore, VEM requires the a priori specification of the latent dimensions d1, . . . , dM. Here we show that a simple extension to an existing subspace clustering algorithm provides, given the number of groups M, a sufficiently accurate initializer for φ and allows for an informed choice for the dimensions d1, . . . , dM. We first illustrate the connection of the mixPLDS model to the subspace clustering problem (for a review of the latter see e.g. [12]). Assume that we observe the log-rates zkt defined in equation (3) directly; we denote the corresponding data matrix as Z ∈RK×T . For unknown loading C, the row Zk: lies on a dm-dimensional subspace spanned by the “basis-trajectories” xm 1,:, . . . , xm dm,:, if neuron k is in group m. If s and x are unobserved, we only know that the rows of Z lie on a union of M subspaces of dimensions d1, . . . , dm in an ambient space of dimension T. Reconstructing the subspaces and the subspace assignments is known as a subspace clustering problem and connections to mixtures of factor analyzers have been pointed out in [13]. The authors of [13] propose to solve the subspace clustering problem by the means of the following sparse regression problem: min W ∈RK×K 1 2∥Z −WZ∥2 F + λ∥W∥1 (7) s.t. diag(W) = 0. This optimization can be interpreted as trying to reconstruct each row Zk: by the remaining rows Z\k: using sparse reconstruction weights W. Intuitively, a point on a subspace can be reconstructed using the fewest reconstruction weights by points on the same subspace, i.e. Wkl = 0 if k and l lie on different subspaces. The symmetrized, sign-less weights |W| + |W|⊤are then interpreted as the adjacency matrix of a graph and spectral clustering, with a user defined number of clusters M, is applied to obtain a subspace clustering solution. In the noise-free case (and taking λ →0 in eqn 7), under linear independence assumptions on the subspaces, [13] shows that this procedure recovers the correct subspace assignments. If the matrix Z is not observed directly but only through the observation model (3), the subspace clustering approach does not directly apply. The observed data Y generated from the model (3) is corrupted by Poisson noise and furthermore the non-linear link function transforms the union of subspaces into a union of manifolds. We can circumvent these problems using the simple observation that not only Z but also the rows Ck: of the loading matrix C lie on a union of subspaces of dimensions d1, . . . , dm (where the ambient space has dimension d). This can be easily seen from the block-diagonal structure of C (if the neurons are sorted by their true cluster assignments) mentioned in section 2.1. Hence we can use an estimate ˜C of the loading C as input to the subspace clustering optimization (7). In order to get an initial estimate ˜C we can use a variety of dimensionality reduction methods with exp-Poisson observations, e.g. exponential family PCA [14], a nuclear norm based method [15], subspace identification methods [16] and EM-based PLDS learning [16]; here we use the nuclear norm based method [15] for reasons that will become obvious below. Because of the non-identifiability of latent factor models, these methods only yield an estimate of C · D with an unknown, invertible transformation D ∈Rd×d. Nevertheless, the rows of C ·D still lie on a union of subspaces (which are however not axis-aligned anymore as is the case for C), and therefore the cluster assignments can still be recovered. Given these cluster assignments, we can get initial estimates of the non-zero rows of Cm by applying nuclear norm minimization to the individual clusters. This 4 method also returns a singular value spectrum associated with each subspace, which can be used to determine the dimension dm. One can specify e.g. a threshold σmin, and determine the dimension dm as the number of singular values > σmin. 2.4 The full parameter estimation algorithm We briefly summarize the proposed parameter estimation algorithm for the mixPLDS model. The procedure requires the user to define the number of groups M. This choice can either be informed by biological prior knowledge or one can use standard model selection methods, such as crossvalidation on the variational approximation of the marginal likelihood. We first get an initial estimate ˜C of the total loading matrix by nuclear-norm-penalized Poisson dimensionality reduction. Then, subspace clustering on ˜C yields initial group assignments. Based on these assignments, for each cluster we estimate the group dimension dm and the group loading ˜Cm. Keeping the cluster assignments fixed, we do a few VEM steps in the mixPLDS model with an initial estimation for the loading matrix given by ( ˜C1, . . . , ˜CM). This last step provides reasonable initial parameters for the parameters A, Q, Q1, µ1 of the dynamical system prior. Finally, we do full VEM iterations in the mixPLDS model to refine the initial parameters. We monitor the increase of the variational lower bound L and use its increments in a termination criterion for the VEM iterations. 2.5 Non-negativity constraints on the loading C Each component m of the mixPLDS model, representing a subpopulation of neurons, can be a very flexible model by itself (depending on the latent dimension dm). This flexibility can in some situations lead to counter-intuitive clustering results. Consider the following example. Let half of the recorded neurons oscillate in phase and the remaining neurons oscillate with a phase shift of π relative to the first half. Depending on the context, we might be interested in clustering the first and second half of the neurons into separate groups reflecting oscillation phase. The mixPLDS model could however end up putting all neurons into a single cluster, by modelling them with one oscillating latent factor that has positive loadings on the first half of neurons and negative on the second half (or vice versa). We can prevent this behavior, by imposing element-wise non-negativity constraints on the loading matrix C, denoted as C ≥0 (and by simultaneously constraining the latent dimensions of each group). The constraints guarantee that the influence of each factor on its group has the same sign across all neurons. The suitability of these constraints strongly depends on the biological context. In the application of the mixPLDS model in section 3.2, we found them to be essential for obtaining meaningful results. We modify the subspace clustering initialization to respect the constraints C ≥0 in the following way. Instead of solving the unconstrained reconstruction problem (7) with respect to W, we add non-negativity constraints W ≥0. These sign constraints restrict the points that can be reconstructed from a given set of points to the convex cone of these points (instead of the subspace containing these points). Hence, under these assumptions, all data points in a cluster can be approximately reconstructed by a (non-negative) convex combination of some “time-series basis”. We empirically observed that this yields initial loading matrix estimates with only very few negative elements (after possible row-wise sign inversions). For the full mixPLDS model we enforce C ≥0 by the reparametrization C = exp(χ) and doing VEM updates on χ. 3 Experiments 3.1 Artificial data Here we validate the parameter estimation procedure for the mixPLDS model on artificial data. We generate 35 random ground truth mixPLDS models with M = 3, d1 = d2 = d3 = 2 and 20 observed neurons per cluster. We sampled from each ground truth model a data set consisting of 4 i.i.d. trials with T = 250 times steps each. Ground truth parameters were generated such that the resulting data was sparse (12% of the bins non-empty). We compared the ability of different clustering methods to recover the 3 clusters from each data set. We report the results in fig. 1A in terms of the fraction of misclassified neurons (class labels were determined by majority vote in each cluster). We applied K-Means with careful initialization of the cluster centers [17] to the data. For K-Means, we pre5 A B Kmeans specCl subCl PsubCl mixPLDS 0 0.5 freq. of misclassification 0 0.1 0.2 0.3 0.4 0 0.5 assignment uncertainty freq. of misclassification Figure 1: Finding clusters of neurons in artificial data. A: Performance of different clustering algorithms, reported in terms of frequency of misclassified neurons, on artificial data sampled from ground truth mixPLDs models. Red bars indicate medians and blue boxes the 25% and 75% percentiles. Standard clustering methods (data plotted in black) such as K-Means, spectral clustering (“specCl”), and subspace clustering (“subCl”) are substantially outperformed by the two methods proposed here (data plotted in red). Poisson subspace clustering (“PsubCl”) yielded accurate initial cluster estimates that were significantly improved by application of the full mixPLDs model. B: Misclassification rate as a function of the cluster assignment uncertainty for the mixPLDS model. This shows that the posterior over cluster assignments returned by the mixPLDS model is well calibrated, as neurons with low assignment uncertainty as rarely misclassified. processed the data in a standard way by smoothing (Gaussian kernel, standard deviation 10 timesteps), mean-centering and scaling (such that each dimension k = 1, . . . , K has variance 1). We found K-Means yielded reasonable clusters when all populations are one-dimensional (i.e. ∀m dm = 1, data not shown) but it fails when clustering multi-dimensional groups of neurons. An alternative approach is to cluster the cross-correlation matrix of neurons (computed from pre-processed data as above) with standard spectral clustering [18]. We found that this approach works well when all the factors have small variances, as in this case the link function of the observation model is only mildly non-linear. However, with growing variances of the factors (larger dynamic ranges of neurons) spectral clustering performance quickly degrades. Standard sparse subspace clustering [13] on the spike trains (pre-processed as above) yielded very similar results to spectral clustering. We found our novel Poisson subspace clustering algorithm proposed in section 2.3 to robustly outperform the other approaches, as long as reasonable amounts of data were available (roughly T > 100 for the above system). The mixPLDS model initialized with the Poisson subspace clustering consistently yielded the best results, as it is able to integrate information over time and denoise the observations. One advantage of the mixPLDS model is that it not only returns cluster assignments for neurons but also provides a measure of uncertainty over these assignments. However, variational inference tends to return over-confident posteriors in general and the factorization approximation (5) might yield posterior uncertainty that is uninformative. To show that the variational posterior uncertainty is well-calibrated we computed the entropy of the posterior cluster assignment q(sk) for all neurons as a measure for assignment uncertainty. We binned the neurons according to their assignment uncertainty and report the misclassification rate for each bin in fig. 1B. 89% of the neurons have low posterior uncertainty and reside in the first bin having a low misclassification rate of ≈0.1, whereas few neurons (5%) have an assignment uncertainty larger than 0.3 nats and they are misclassified with a rate of ≈0.4. 3.2 Calcium imaging of spinal cord neurons We tested the mixPLDS model on calcium imaging data obtained from an in vitro, neonatal mouse spinal cord that expressed the calcium indicator GCaMP3 in all motor neurons. When an isolated spinal cord is tonically excited by a cocktail of rhythmogenic drugs (5 µM NMDA, 10 µM 5-HT, 50 µM DA), motor neurons begin to fire rhythmically. In this network state, spatially clustered ensembles of motor neurons fire in phase with each other [19]. Since multiple ensembles that have distinct phase tunings can be visualized in a single imaging field, this data represents a convenient 6 A 70 1 1 70 frames 1 500 70 1 sorted neuron # sorted neuron # unsorted neuron # factors cluster 1 factors cluster 2 B latent dim sorted neuron # 1 4 1 70 C Figure 2: Application of the mixPLDS model to recordings from spinal cord neurons. A, top panel: 500 frames of input data to the mixPLDS model. Middle panel: Same data as in upper panel, but rows are sorted by mixPLDS clusters and factor loading. Inferred latent factors (red: cluster 1, blue: cluster 2, solid: factor 1, dashed: factor 2) are also shown. Bottom panel: Inferred (smoothed) firing rates. B: Loading matrix C of the mixPLDS model showing how factors 1,2 of cluster 1 and factors 3,4 of cluster 2 influence the neurons. C: Preferred phases shown as a function of (sorted) neuron index and colored by posterior probability of belonging to cluster 1. Clearly visible are two clusters as well as an (approximately) increasing ordering within a cluster. setting for testing our algorithm. The data (90 second long movies) were acquired at 15 Hz from a custom two-photon microscope equipped with a resonant scanner (downsampled from 60 Hz to boost SNR). The frequency of the rhythmic activity was typically 0.2 Hz. In addition, aggregate motor neuron activity was simultaneously acquired with each movie using a suction electrode attached to a ventral root. This electrophysiology recording (referred to here as ephys-trace) was used as an external phase reference point to compute phase tuning curves for imaged neurons, which we used to validate our mixPLDS results. A deconvolution algorithm [20] was applied to the recorded calcium time-series to estimate the spiking activity of 70 motor neurons. The output of the deconvolution, a 70 × 1140 (neurons × frames) matrix of posterior expected number of spikes, was used as input to the mixPLDS model. The non-empty bins of the the first 500 out of the 1140 frames of input data (thresholded at 0.1) are shown in fig. 2A (upper panel). We used a mixPLDS model with M = 2 groups with two latent dimensions each, i.e. d1 = d2 = 2. We imposed the non-negativity constraints C ≥0 on the loading matrix; these were found to be crucial for finding a meaningful clustering of the neurons, as discussed above. The mixPLDS clustering reveals two groups with strongly periodic but phaseshifted population activities, as can be seen from the inferred latent factors shown in fig. 2A (middle panel, factors of cluster 1 shown in red, factors of cluster 2 in blue). For each cluster, the model learned a stronger (higher variance) latent factor (solid line) and a weaker one (dashed line); we interpret the former as capturing the main activity structure in a cluster and the latter as describing deviations. Based on the estimated mixPLDS model, we sorted the neurons for visualization into two clusters according to their most likely cluster assignment argmaxsk=1,2 q(sk). Within each cluster, we sorted the neurons according to the ratio of the loading coefficient onto the stronger factor over the loading onto the weaker factor. Re-plotting the spike-raster with this sorting in fig. 2A (middle panel) reveals interesting structure. First, it shows that the initial choice of two clusters was well justified for this data set. Second, the sorting reveals that the majority of neurons tend to 7 fire at a preferred phase relative to the oscillation cycle, and the mixPLDS-based sorting corresponds to an increasing ordering of preferred phases. Fig. 2B shows the loading matrix C of the mixPLDS, which is found to be approximately block-diagonal. On this data set we also have the opportunity to validate the unsupervised clustering by taking into account the simultaneously recorded ephys-trace. We computed for each neuron a phase tuning curve based on the ephys-trace history of the last 80 times steps (estimated via L2 regularized generalized linear model estimation, with an exp-Poisson observation model). For each neuron, we extracted the peak location of this phase tuning curve, which we call the preferred phase. Fig. 2C shows these preferred phases as a function of (sorted) neuron index, revealing that the two clusters found by the mixPLDS model coincide well with the two modes of the bi-model distribution of preferred phases. Furthermore, within each cluster, the preferred phases are (approximately) increasing, showing that the mixPLDS-sorting of neurons reflects the phase-relation of the neurons to the global, oscillatory ephys-trace. We emphasize that the latter was not used for fitting the mixPLDS; i.e., this constitutes an independent validation of our results. We conclude that the mixPLDS model successfully uncovered clustering structure from the recordings that can be validated using the side information from electrophysiological tuning, and furthermore allowed for a meaningful sorting within each cluster capturing neural response properties. In addition, the mixPLDS model leverages the temporal structure in recordings, automatically optimizing for the temporal smoothness level and revealing the main time-constants in the data (in the above data set 1.8 and 6.5 sec) as well as main oscillation frequencies (0.2 and 0.45Hz). Furthermore, either the latent trajectories or the inferred firing rates shown in fig. 2A can be used as smoothed proxies for their corresponding population activities for subsequent analyses. 4 Discussion One can generalize the mixPLDS model in several ways. Here we assumed that, given the latent factors, all neurons fire independently. This is presumably a good assumption if the recorded neurons are spatially distant, but it might break down if neurons are densely sampled from a local population and have strong, monosynaptic connections. This more general case can be accounted for by incorporating direct interaction terms between neurons into the observation model in the spirit of coupled GLMs (see [21]); inference and parameter learning are still tractable in this model using VEM. Furthermore, in addition to the activity recordings, one might have access to other covariates that are informative about the clustering structure of the population, such as cell location, genetic markers, or cell morphology. We can add such data as additional observations into the mixPLDS model to facilitate clustering of the cells. An especially relevant example are stimulus-response properties of cells. We can add a mixture model over receptive-field parameters using the cluster assignments s. This extension would provide a clustering of neurons based on their joint activity statistics (such as shared trial-to-trial variability) as well as on their receptive field properties. We presented three technical contributions, that we expect to be useful outside the context of the mixPLDS model. First, we proposed a simple extension of the sparse subspace clustering algorithm to Poisson observations. We showed that if the dimension of the union of subspaces is much smaller than the ambient dimension, our method substantially outperforms other approaches. Second, we introduced a version of subspace clustering with non-negativity constraints on the reconstruction weights, which therefore clusters points into convex cones. We expect this variant to be particularly useful when clustering activity traces of cells, allowing for separating anti-phasic oscillations. Third, we applied the dual variational inference approach of [11] to a model with a Markovian prior and with mixtures of Poisson observations. The resulting inference method proved itself numerically robust, and we expect it to be a valuable tool for analyzing time-series of sparse count variables. Acknowledgements This work was supported by Simons Foundation (SCGB#325171 and SCGB#325233), Grossman Center at Columbia University, and Gatsby Charitable Trust as well as grants MURI W911NF-12-1-0594 from the ARO, vN00014-14-1-0243 from the ONR, W91NF14-1-0269 from DARPA and an NSF CAREER award (L.P.). 8 References [1] Anne C Smith and Emery N Brown. Estimating a state-space model from point process observations. Neural Computation, 15(5):965–991, 2003. [2] Lauren M Jones, Alfredo Fontanini, Brian F Sadacca, Paul Miller, and Donald B Katz. Natural stimuli evoke dynamic sequences of states in sensory cortical ensembles. Proceedings of the National Academy of Sciences, 104(47):18772–18777, 2007. [3] Jakob H Macke, Lars Buesing, John P Cunningham, M Yu Byron, Krishna V Shenoy, and Maneesh Sahani. Empirical models of spiking in neural populations. In NIPS, pages 1350–1358, 2011. [4] Byron M Yu, John P Cunningham, Gopal Santhanam, Stephen I Ryu, Krishna V Shenoy, and Maneesh Sahani. Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity. In NIPS, pages 1881–1888, 2008. [5] Murat Okatan, Matthew A Wilson, and Emery N Brown. Analyzing functional connectivity using a network likelihood model of ensemble neural spiking activity. Neural Computation, 17(9):1927–1961, 2005. [6] Yuriy Mishchenko, Joshua T Vogelstein, Liam Paninski, et al. A Bayesian approach for inferring neuronal connectivity from calcium fluorescent imaging data. The Annals of Applied Statistics, 5(2B):1229–1261, 2011. [7] Suraj Keshri, Eftychios Pnevmatikakis, Ari Pakman, Ben Shababo, and Liam Paninski. A shotgun sampling solution for the common input problem in neural connectivity inference. arXiv preprint arXiv:1309.3724, 2013. [8] Felipe Gerhard, Tilman Kispersky, Gabrielle J Gutierrez, Eve Marder, Mark Kramer, and Uri Eden. Successful reconstruction of a physiological circuit with known connectivity from spiking activity alone. PLoS computational biology, 9(7):e1003138, 2013. [9] Michael E Tipping and Christopher M Bishop. Mixtures of probabilistic principal component analyzers. Neural Computation, 11(2):443–482, 1999. [10] Zoubin Ghahramani, Geoffrey E Hinton, et al. The EM algorithm for mixtures of factor analyzers. Technical report, Technical Report CRG-TR-96-1, University of Toronto, 1996. [11] Mohammad Emtiyaz Khan, Aleksandr Aravkin, Michael Friedlander, and Matthias Seeger. Fast dual variational inference for non-conjugate latent gaussian models. In Proceedings of The 30th International Conference on Machine Learning, pages 951–959, 2013. [12] Ren´e Vidal. A tutorial on subspace clustering. IEEE Signal Processing Magazine, 28(2):52–68, 2010. [13] Ehsan Elhamifar and Ren´e Vidal. Sparse subspace clustering: Algorithm, theory, and applications. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 35(11):2765–2781, Nov 2013. [14] Michael Collins, Sanjoy Dasgupta, and Robert E Schapire. A generalization of principal component analysis to the exponential family. In NIPS, volume 13, page 23, 2001. [15] David Pfau, Eftychios A Pnevmatikakis, and Liam Paninski. Robust learning of low-dimensional dynamics from large neural ensembles. In NIPS, pages 2391–2399, 2013. [16] Lars Buesing, Jakob H Macke, and Maneesh Sahani. Spectral learning of linear dynamics from generalised-linear observations with application to neural population data. In NIPS, pages 1691–1699, 2012. [17] David Arthur and Sergei Vassilvitskii. k-means++: The advantages of careful seeding. In Proceedings of the eighteenth annual ACM-SIAM symposium on Discrete algorithms, pages 1027–1035. Society for Industrial and Applied Mathematics, 2007. [18] Andrew Y Ng, Michael I Jordan, and Yair Weiss. On spectral clustering1 analysis and an algorithm. Proceedings of Advances in Neural Information Processing Systems. Cambridge, MA: MIT Press, 14:849– 856, 2001. [19] Timothy A. Machado, Eftychios Pnevmatikakis, Liam Paninski, Thomas M. Jessell, and Andrew Miri. Functional organization of spinal motor neurons revealed by ensemble imaging. In 79th Cold Spring Harbor Symposium on Quantitative Biology Cognition, 2014. [20] E. A. Pnevmatikakis, Y. Gao, D. Soudry, D. Pfau, C. Lacefield, K. Poskanzer, R. Bruno, R. Yuste, and L. Paninski. A structured matrix factorization framework for large scale calcium imaging data analysis. ArXiv e-prints, September 2014. [21] 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. 9
2014
377
5,488
Mode Estimation for High Dimensional Discrete Tree Graphical Models Chao Chen Department of Computer Science Rutgers, The State University of New Jersey Piscataway, NJ 08854-8019 chao.chen.cchen@gmail.com Han Liu Department of Operations Research and Financial Engineering Princeton University, Princeton, NJ 08544 hanliu@princeton.edu Dimitris N. Metaxas Department of Computer Science Rutgers, The State University of New Jersey Piscataway, NJ 08854-8019 dnm@cs.rutgers.edu Tianqi Zhao Department of Operations Research and Financial Engineering Princeton University, Princeton, NJ 08544 tianqi@princeton.edu Abstract This paper studies the following problem: given samples from a high dimensional discrete distribution, we want to estimate the leading (δ, ρ)-modes of the underlying distributions. A point is defined to be a (δ, ρ)-mode if it is a local optimum of the density within a δ-neighborhood under metric ρ. As we increase the “scale” parameter δ, the neighborhood size increases and the total number of modes monotonically decreases. The sequence of the (δ, ρ)-modes reveal intrinsic topographical information of the underlying distributions. Though the mode finding problem is generally intractable in high dimensions, this paper unveils that, if the distribution can be approximated well by a tree graphical model, mode characterization is significantly easier. An efficient algorithm with provable theoretical guarantees is proposed and is applied to applications like data analysis and multiple predictions. 1 Introduction Big Data challenge modern data analysis in terms of large dimension, insufficient sample and the inhomogeneity. To handle these challenges, new methods for visualizing and exploring complex datasets are crucially needed. In this paper, we develop a new method for computing diverse modes of the unknown discrete distribution function. Our method is applicable in many fields, such as computational biology, computer vision, etc. More specifically, our method aims to find a sequence of (δ, ρ)-modes, which are defined as follows: Definition 1 ((δ, ρ)-modes). A point is a (δ, ρ)-mode if and only if its probability is higher than all points within distance δ under a distance metric ρ. With a metric ρ(·) given, the δ-neighborhood of a point x, Nδ(x), is defined as the ball centered at x with radius δ. Varying δ from small to large, we can examine the topology of the underlying distribution at different scales. Therefore δ is also called the scale parameter. When δ = 0, Nδ(x) = {x}, so every point is a mode. When δ = ∞, Nδ(x) is the whole domain, denoted by X, so the maximum a posteriori is the only mode. As δ increases from zero to infinity, the δ-neighborhood of x monotonically grows and the set of modes, denoted by Mδ, monotonically decreases. Therefore as δ increases, the sets of Mδ form a nested sequence, which can be viewed as a multi-scale description of the underlying probability landscape. See Figure 1 for an illustrative example. In this paper, we will use the Hamming distance, ρH, i.e., the number of variables at which two points disagree. Other distance metrics, e.g., the L2 distance ρL2(x, x′) = ∥x −x′∥2, are also possible but with more computational challenges. The concept of modes can be justified by many practical problems. We mention the following two motivating applications: (1) Data analysis: modes of multiple scales provide a comprehensive 1 geometric description of the topography of the underlying distribution. In the low-dimensional continuous domain, such tools have been proposed and used for statistical data analysis [20, 17, 3]. One of our goals is to carry these tools to the discrete and high dimensional setting. (2) Multiple predictions: in applications such as computational biology [9] and computer vision [2, 6], instead of one, a model generates multiple predictions. These predictions are expected to have not only high probability but also high diversity. These solutions are valid hypotheses which could be useful in other modules down the pipeline. In this paper we address the computation of modes, formally, Problem 1 (M-modes). For all δ’s, compute the M modes with the highest probabilities in Mδ. This problem is challenging. In the continuous setting, one often starts from random positions, estimates the gradient of the distribution and walks along it towards the nearby mode [8]. However, this gradient-ascent approach is limited to low-dimensional distributions over continuous domains. In discrete domains, gradients are not defined. Moreover, a naive exhaustive search is computationally infeasible as the total number of points is exponential to dimension. In fact, even deciding whether a given point is a mode is expensive as the neighborhood has exponential size. In this paper, we propose a new approach to compute these discrete (δ, ρ)-modes. We show that the problem becomes computationally tractable when we restrict to distributions with tree factor structures. We explore the structure of the tree graphs and devise a new algorithm to compute the top M modes of a tree-structured graphical model. Inspired by the observation that a global mode is also a mode within smaller subgraphs, we show that all global modes can be discovered by examining all local modes and their consistent combinations. Our algorithm first computes local modes, and then computes the high probability combinations of these local modes using a junction tree approach. We emphasize that the algorithm itself can be used in many graphical model based methods, such as conditional random field [10], structured SVM [22], etc. When the distribution is not expressed as a factor graph, we will first estimate the tree-structured factor graph using the algorithm of Liu et al. [13]. Experimental results demonstrate the accuracy and efficiency of our algorithm. More theoretical guarantee of our algorithm can be found in [7]. Related work. Modes of distributions have been studied in continuous settings. Silverman [21] devised a test of the null hypothesis of whether a kernel density estimation has a certain number of modes or less. Modes can be used in clustering [8, 11]. For each data point, a monotonically increasing path is computed using a gradient-ascend method. All data points whose gradient path converge to a same mode is labeled the same class. Modes can be also used to help decide the number of mixture components in a mixture model, for example as the initialization of the maximum likelihood estimation [11, 15]. The topographical landscape of distributions has been studied and used in characterizing topological properties of the data [4, 20, 17]. Most of these approaches assume a kernel density estimation model. Modes are detected by approximating the gradient using k-nearest neighbors. This approach is known to be inaccurate for high dimensional data. We emphasize that the multi-scale view of a function has been used broadly in compute vision. By convolving an image with a Gaussian kernel of different widths, we obtain different level of details. This theory, called the scale-space theory [25, 12], is used as the fundamental principle of most state-of-the-art image feature extraction techniques [14, 16]. This multi-scale view has been used in statistical data analysis by Chaudhuri and Marron [3]. Chen and Edelsbrunner [5] quantitatively measured the topographical landscape of an image at different scales. Chen et al. [6] proposed a method to compute modes of a simple chain model. However, restricting to a simple chain will limit our mode prediction accuracy. A simple chain model has much less flexibility than tree-factored models. Even if the distribution has a chain structure, recovering the chain from data is computationally intractable: the problem requires finding the chain with maximal total mutual information, and thus is equivalent to the NP-hard travelling salesman problem. P(x) P(x) δ = 1 δ = 4 δ = 1 δ = 4 δ = 7 δ = 0 δ = 0 δ = 1 δ = 1 δ = 4 δ = 7 δ = 0 δ = 4 δ = 7 Figure 1: An illustration of modes of different scales. Each vertical bar corresponds to an element. The height corresponds to its probability. Left: when δ = 1, there are three modes (red). Middle: when δ = 4, only two modes left. Right: the multi-scale view of the landscape. 2 2 Background Graphical models. We briefly introduce graphical models. Please refer to [23, 19] for more details. The graphical model is a powerful tool to model the joint distribution of a set of interdependent random variables. The distribution is encrypted in a graph G = (V, E) and a potential function f. The set of vertices/nodes V corresponds to the set of discrete variables i ∈[1, D], where D = |V|. A node i can be assigned a label xi ∈L. A label configuration of all variables x = (x1, . . . , xD) is called a labeling. We denote by X = LD the domain of all labelings. The potential function f : X →R assigns to each labeling a real value, which is inversely proportional to the logarithm of the probability distribution, p(x) = exp(−f(x) −A), where A = log P x∈X exp(−f(x)) is the log-partition function. Thus the maximal modes of the distribution and the minimal modes of f have a one-to-one correspondence. Assuming these variables satisfy the Markov properties, the potential function can be written as f(x) = P (i,j)∈Efi,j(xi, xj), (2.1) where fi,j : L × L →R is the potential function for edge (i, j) 1. For convenience, we assume any two different labelings have different potential function values. We define the following notations for convenience. A vertex subset, V′ ⊆V, induces a subgraph consisting of V′ together with all edges whose both ends are within V′. In this paper, all subgraphs are vertex-induced. Therefore, we abuse the notation and denote both the subgraph and the vertex subset by the same symbol. We call a labeling of a subgraph B a partial labeling. For a given labeling y, we may denote by yB its label configurations of vertices of B. We say the distance between two partial labelings xB and yB′ is equal to the Hamming distance between the two within the intersection of the two subgraphs ˆB = B ∩B′, formally, ρ(xB, yB′) = ρ(x ˆ B, y ˆ B). We denote by fB(yB) the potential of the partial labeling, which is only evaluated over edges within B. When the context is clear, we drop the subscript B and write f(yB). Tree density estimation. In this paper, we focus on tree-structured graphical models. A distribution that is Markov to a tree structure has the following factorization: P(X = x) = p(x) = Q (i,j)∈E p(xi, xj) p(xi)p(xj) Q k∈Vp(xk). (2.2) It is easy to see that the potential function can be written in the form (2.1). In the case when the input is a set of samples, we will first use the tree density estimation algorithm [13] to estimate the graphical model. The oracle tree distribution is the one on the space of all tree distributions that minimizes the Kullback-Leibler (KL) divergence between itself and the tree density, that is, q∗= argminq∈PT D(p∗||q), where PT is the family of distributions supported on a tree graph, p∗is the true density, and D(p||q) = P x∈X p(x)(log p(x) −log q(x)) is the KL divergence. It is proved [1] that q∗has the same marginal univariate and bivariate distribution as p∗. Hence to recover q∗, we only need to recover the structure of the tree. Denote by E∗the edge set of the oracle tree. Simple calculation shows that D(p∗||q∗) = −P (i,j)∈E∗Iij + const, where Iij = PL xi=1 PL xj=1p∗(xi, xj)(log p∗(xi, xj) −log p∗(xi) −log p∗(xj)) (2.3) is called the mutual information between node i and j. Therefore we can apply Kruskal’s maximum spanning tree algorithm to obtain E∗, with edge weights being the mutual information. In reality, we do not know the true marginal univariate and bivariate distribution. We thus compute estimators ˆIij from the data set  X(1), . . . , X(n) by replacing p∗(xi, xj) and p∗(xi) in (2.3) with their estimates ˆp(xi, xj) = 1 n Pn s=1 1{X(s) i = xi, X(s) j = xj} and ˆp(xi) = 1 n Pn s=1 1{X(s) i = xi}. The tree estimator is thus obtained by Kruskal’s algorithm: ˆTn = argmaxT P (i,j)∈E(T ) ˆIij. (2.4) By definition, the potential function on each edge can be estimated similarly using the estimated marginal univariate and bivariate distributions. By (2.1), we have ˆf(x) = P (i,j)∈E( ˆT ) ˆfi,j(xi, xj), where ˆT is the estimated tree using Kruskal’s algorithm. 1For convenience, we drop unary potentials fi in this paper. Note that any potential function with unary potentials can be rewritten as a potential function without them. 3 c Figure 2: Left: The junction tree with radius r = 2. We show the geodesic balls of three supernodes. In each geodesic ball, the center is red. The boundary vertices are blue. The interior vertices are black and red. Right-bottom: Candidates of a geodesic ball. Each column corresponds to candidates of one boundary labeling. Solid and empty vertices represent label zero and one. Right-top: A geodesic ball with radius r = 3. 3 Method We present the first algorithm to compute Mδ for a tree-structured graph. To compute modes of all scales, we go through δ’s from small to large. The iteration stops at a δ with only a single mode. We first present a polynomial algorithm for the verification problem: deciding whether a given labeling is a mode (Sec. 3.1). However, this algorithm is insufficient for computing the top M modes because the space of labelings is exponential size. To compute global modes, we decompose the problem into computing modes of smaller subgraphs, which are called local modes. Because of the bounded subgraph size, local modes can be solved efficiently. In Sec. 3.2, we study the relationship between global and local modes. In Sec. 3.3 and Sec. 3.4, we give two different methods to compute local modes, depending on different situations. 3.1 Verifying whether a labeling is a mode To verify whether a given labeling y is a mode, we check whether there is another labeling within Nδ(y) with a smaller potential. We compute the labeling within the neighborhood with the minimal potential, y∗= argminz∈Nδ(y) f(z). The given labeling y is a mode if and only if y∗= y. We present a message-passing algorithm. We select an arbitrary node as the root, and thus a corresponding child-parent relationship between any two adjacent nodes. We compute messages from leaves to the root. Denote by Tj as the subtree rooted at node j. The message from vertex i to j, MSGi→j(ℓi, τ) is the minimal potential one can achieve within the subtree Ti given a fixed label ℓi at i and a constraint that the partial labeling of the subtree is no more than τ away from y. Formally, MSGi→j(ℓi, τ) = min zTi:zi=ℓi,ρ(zTi,y)≤τ f(zTi) where ℓi ∈L and τ ∈[0, δ]. This message cannot be computed until the messages from all children of i have been computed. For ease of exposition, we add a pseudo vertex s as the parent of the root, r. By definition, minℓr MSGr→s(ℓr, δ) is the potential of the desired labeling, y∗. Using the standard backtracking strategy of message passing, we can recover y∗. Please refer to [7] for details of the computation of each individual message. For convenience we call this procedure Is-a-Mode. This procedure and its variations will be used later. 3.2 Local and global modes Given a graph G and a collection of its subgraphs B, we show that under certain conditions, there is a tight connection between the modes of these subgraphs and the modes of G. In particular, any consistent combinations of these local modes is a global mode, and vice versa. Simply considering the modes of a subgraph B is insufficient. A mode of B with small potential may cause big penalty when it is extended to a labeling of the whole graph. Therefore, when defining a local mode, we select a boundary region of the subgraph and consider all possible label configurations of this boundary region. Formally, we divide the vertex set of B into two disjoint subsets, the boundary ∂B and the interior int(B), so that any path connecting an interior vertex u ∈int(B) and an outside vertex v /∈B has to pass through at least one boundary vertex w ∈∂B. See Figure 2(left) for examples of B. Similar to the definition of a global mode, we define a local mode as the partial labeling with the smallest potential in its δ-neighborhood: Definition 2 (local modes). A partial labeling, xB, is a local mode w.r.t. δ-neighborhood if and only if there is no other partial labeling yB which (C1) has a smaller potential, f(yB) < f(xB); (C2) is within δ distance from xB, ρ(yB, xB) ≤δ and (C3) has the same boundary labeling, y∂B = x∂B. 4 We denote by Mδ B the space of local modes of the subgraph B. Given a set of subgraphs B together with a interior-boundary decomposition for each subgraph, we have the following theorem. Theorem 3.1 (local-global). Suppose any connected subgraph G′ ⊆G of size δ is contained within int(B) of some B ∈B. A labeling x of G is a global mode if and only if for every B ∈B, the corresponding partial labeling xB is a local mode. Proof. The necessity is obvious since a global mode is a local mode within every subgraph. Note that necessity is not true any more if the restriction on ∂B (C3 in Definition 2) is relaxed. Next we show the sufficiency by contradiction. Suppose a labeling x is a local mode within every subgraph, but is not a global mode. By definition, there is y ∈Nδ(x) with smaller potential than x. We assume y and x disagree within a connected subgraph. If y and x disagree within multiple connected components, we can always find y′ ∈Nδ(x) with smaller potential which disagree with x within only one of these connected components. The subgraph on which x and y disagree must be contained by the interior of some B ∈B. Thus xB is not a local mode due to the existence of yB. Contradiction. We say partial labelings of two different subgraphs are consistent if they agree at all common vertices. Theorem 3.1 shows that there is a bijection between the set of global modes and the set of consistent combinations of local modes. This enables us to compute global modes by first compute local modes of each subgraph and then search through all their consistent combinations. Instantiating for a tree-structured graph. For a tree-structured graph with D nodes, let B be the set of D geodesic balls, centered at the D nodes. Each ball has radius r = ⌊δ 2⌋+ 1. Formally, we have Bi = {j | dist(i, j) ≤r}, ∂Bi = {j | dist(i, j) = r}, and int(Bi) = {j | dist(i, j) < r}. Here dist(i, j) is the number of edges between the two nodes. See Figure 2(left) for examples. It is not hard to see that any size δ subtree is contained within a int(Bi) for some i. Therefore, the prerequisite of Theorem 3.1 is guaranteed. We construct a junction tree to combine the set of all consistent local modes. It is constructed as follows: Each supernode of the junction tree corresponds to a geodesic ball. Two supernodes are neighbors if and only if their centers are neighbors in the original tree. See Figure 2(left). Let the label set of a supernode be its corresponding local modes, as defined in Definition 2. We construct a potential function of the junction tree so that a labeling of the junction tree has finite potential if and only if the corresponding local modes are consistent. Furthermore, whenever the potential of a junction tree labeling is finite, it is equal to the potential of the corresponding labeling in the original graph. This construction can be achieved using a standard junction tree construction algorithm, as long as the local mode set of each ball is given. The M-modes problem is then reduced to computing the M lowest potential labelings of the junction tree. This is the M-best labeling problem and can be solved efficiently using Nilsson’s algorithm [18]. The algorithm of this section is summarized in the Procedure Compute-M-Modes. Procedure 1 Compute-M-Modes Input: A tree G, a potential function f and a scale δ Output: The M modes of the lowest potential 1: Construct geodesic balls B = {Br(c) | c ∈V}, where r = ⌊δ 2⌋+ 1 2: for all B ∈B do 3: Mδ B = the set of local modes of B 4: Construct a junction tree (Figure 2). The label set of each supernode is its local modes. 5: Compute the M lowest-potential labelings of the junction tree, using Nilsson’s algorithm. 3.3 Computing local modes via enumeration It remains to compute all local modes of each geodesic ball B. We give two different algorithms in Sec. 3.3 and 3.4. Both methods have two steps. First, compute a set of candidate partial labelings. Second, choose from these candidates the ones that satisfy Definition 2. In both methods, it is essential to ensure the candidate set contains all local modes. Computing a candidate set. The first method enumerates through all possible labelings of the boundary. For each boundary labeling x∂B, we compute a corresponding subset of candidates. Each candidate is the partial labeling of the minimal potential with boundary labeling x∂B and a fixed label ℓof the center c. This subset has L elements since c has L labels. Formally, the candidate subset for a fixed boundary labeling x∂B is CB(x∂B) =  argminyBfB(yB)|y∂B = x∂B, yc ∈L . It can be computed using a standard message-passing algorithm over the tree, using c as the root. Denote by XB and X∂B the space of all partial labelings of B and ∂B respectively. The candidate set we compute is the union of candidate subsets of all boundary labelings, i.e. CB = 5 S x∂B∈X∂B CB(x∂B). See Figure 2(right-bottom) for an example candidate set. We can show that the computed candidate set CB contains all local modes of B. Theorem 3.2. Any local mode yB belongs to the candidate set CB. Before proving the theorem, we formalize an assumption of the geodesic balls. Assumption 1 (well-centered). We assume that after removing the center from int(B), each connected component of the remaining graph has a size smaller than δ. For example, in Figure 2(right-top), a geodesic ball of radius 3 has three connected components in int(B)\{c}, of size one, two and three, respectively. Since r = ⌊δ 2⌋+ 1, δ is either four or five. The ball is well-centered. Since the interior of B is essentially a ball of radius r −1 = ⌊δ 2⌋, the assumption is unlikely to be violated, as we observed in practice. In the worst case when the assumption is violated, we can still solve the problem by adding additional centers in the middle of these connected components. Next we prove the theorem. Proof of Theorem 3.2. We prove by contradiction. Suppose there is a local mode yB /∈XB(x∂B) such that y∂B = x∂B. Let ℓbe the label of yB at the center c. Let y′ B ∈XB(x∂B) be the candidate with the same label at the center. Furthermore, the two partial labelings agree at ∂B and at c. Therefore the two labelings differ at a set of connected subgraphs. Each of the subgraphs has a size smaller than δ, due to Assumption 1. Since y′ B has a smaller potential than yB by definition, we can find a partial labeling y′′ B which only disagree with yB within one of these components. And y′′ B has a smaller potential than yB. Therefore yB cannot be a local mode. Contradiction. Verifying each candidate. Next, we show how to check whether a candidate is a local mode. For a given boundary labeling, x∂B, we denote by XB(x∂B) the space of all partial labelings with fixed boundary labeling x∂B. By definition, a candidate yB ∈XB(x∂B) is a local mode if and only if there is no other partial labeling in XB(x∂B) within δ from yB with a smaller potential. The verification of yB can be transformed into a global mode verification problem and solved by the algorithm in Sec. 3.1. We use the subgraph B and its potential to construct a new graph. We need to ensure that only labelings with the fixed boundary labeling x∂B are considered in this new graph. This can be done by enforcing each boundary node i ∈∂B to have xi as the only feasible label. 3.4 Computing local modes using local modes of smaller scales In Sec. 3.3, we computed the candidate set by enumerating all boundary labelings x∂B. In this subsection, we present an alternative method when the local modes of the scale δ −1 has been computed. We construct a new candidate set using local modes of scale δ −1. This candidate set is smaller that the candidate set from the previous subsection and thus leads to a more efficient algorithm. Since our algorithm computes modes from small scale to large scale. This algorithm can be used in all scales except for δ = 1. The step of verifying whether each candidate is a local mode is the same as the previous subsection. The following notations will prove convenient. Denote by r and r′ the radii of balls for scales δ and δ −1 respectively (See Sec. 3.2 for the definition). Denote by Bi and B′ i the balls centered at node i for scales δ and δ −1. Let Mδ Bi and Mδ−1 B′ i be their sets of local modes at scales δ and δ −1 respectively. Our idea is to use Mδ−1 B′ i ’s to compute a candidate set containing Mδ Bi. Consider two different cases, δ is odd and even. When δ is odd, r = r′ and Bi = B′ i. By definition, Mδ Bi ⊆Mδ−1 Bi = Mδ−1 B′ i . We can directly use the local modes of the previous scale as the candidate set for the current scale. When δ is even, r = r′ + 1. The ball Bi is the union of the B′ j’s for all j adjacent to i, Bi = S j∈Ni B′ j, where Ni is the set of neighbors of i. We collect the set of all consistent combinations of Mδ−1 B′ j for all j ∈Ni as the candidate set. This set is a superset of Mδ Bi, because a local mode at scale δ has to be a local mode at scale δ −1. Dropping unused local modes. In practice, we observe that a large amount of local modes do not contribute to any global mode. These unused local modes can be dropped when computing global modes and when computing local modes of larger scales. To check if a local mode of Bi can be dropped, we compare it with all local modes of an adjacent ball Bj, j ∈Ni. If it is not consistent with any local mode of Bj, we drop it. We go through all adjacent balls Bj in order to drop as many local modes as possible. 6 (a) (b) (c) (d) Figure 3: Scalability. 3.5 Complexity There are three steps in our algorithm for each fixed δ: computing, verifying candidates and computing the M best labelings of the junction tree. Denote by d the tree degree. Denote by λ the maximum number of undropped local modes for any ball B and scale δ. When δ = 1, we use the enumeration method. Since the ball radius is 1, the ball boundary size is O(d). There are at most Ld many candidates for each ball. When δ > 1, we use local modes of the scale δ −1 to construct the candidate set. Since each ball of scale δ is the union of O(d) many balls of scale δ −1, there are at most λd many candidates per node. The verification takes O(DdLδ2(L+δ)) time per candidate. (See [7] for complexity analysis of the verification algorithm.) Therefore overall the computation and verification of all local modes for all D balls is O(D2dLδ2(L + δ)(Ld + λd)). The last step runs Nilsson’s algorithm on a junction tree with label size O(λ), and thus takes O(Dλ2+MDλ+MD log(MD)). Summing up these complexities gives the final complexity. Scalability. Even though our algorithm is not polynomial to all relevant parameters, it is efficient in practice. The complexity is exponential to the tree degree (d). However, in practice, we can enforce an upperbound of the tree degree in the model estimation stage. This way we can assume d to be constant. Another parameter in the complexity is λ, the maximal number of undropped local modes of a geodesic ball. When the scale δ is large, λ could be exponential to the graph size. However, in practice, we observe that λ decreases quickly as δ increases. Therefore, our algorithm can finish in a reasonable time. See Sec. 4 for more discussions. 4 Experiment To validate our method, we first show the scalability and accuracy of our algorithm in synthetic data. Furthermore, we demonstrate using biological data how modes can be used as a novel analysis tool. Quantitative analysis of modes reveals new insight of the data. This finding is well supported by a visualization of the modes, which intuitively outlines the topographical map of the distribution. In all experiments, we choose M to be 500. At bigger scales, there are often less than M modes in total. As mentioned earlier, modes can also be applied to the problem of multiple predictions [7]. Scalability. We randomly generate tree-structured graphical model (tree size D =200 ...2000, label size L = 3) and test the speed. For each tree size, we generates 100 random data. In Figure 3(a), we show the running time of our algorithm to compute modes of all scales. The running time is roughly linear to the graph size. In Figure 3(b) we show the average running time for each delta when the graph size is 200, 1000 and 2000. As we see most of the computation time is spent on computations with δ = 1 and 2. Note only when δ = 1, the enumeration method is used. When δ ≥2, we reuse local modes of previous δ. The algorithm speed depends on the parameter λ, the maximum number of undropped local modes over all balls. In Figure 3(c), we show that λ drops quickly as the scale increases. We believe this is critical to the overall efficiency of our method. In Figure 3(d), we show the average number of global modes at different scales. Accuracy. We randomly generate tree-structured distributions (D = 20, L = 2). We select the trees with strong modes as ground-truth trees, i.e. those with at least two modes up to δ = 7. See Figure 4(a) for the average number of modes at different scales over these selected tree models. Next we sample these trees and then use the samples to estimate a tree model to approximate this distribution. Finally we compute modes of the estimated tree and compare them to the modes of the ground-truth trees. To evaluate the sensitivity of our method to noise, we randomly flip 0%, 5%, 10%, 15% and 20% labels of these samples. We compare the number of predicted modes to the number of true modes for each scale. The error is normalized by the number of true modes. See Figure 4(b). With small noise, our prediction is accurate except for δ = 1, when the number of true modes is very large. As the noise level increases, the error increases linearly. We do notice an increase of error at near δ = 7. This is because at δ = 8, many data become unimodal. Predicting two modes leads to 50% error. 7 (a) (b) (c) (d) Figure 4: Accuracy. Denote by ϵ the noise level, n the sample size. We also measure the prediction accuracy using the Hausdorff distance between the predicted modes and the true modes. The Hausdorff distance between two finite points sets X and Y is defined as max (maxx∈X miny∈Y ρ(x, y), maxy∈Y minx∈X ρ(x, y)). The result is shown in Figure 4(c). We normalize the error using the tree size D. So the error is between zero and one. The error is again increasing linearly w.r.t. the noise level. An increase at δ = 7 is due to the fact that many data change from multiple modes to one single mode. In Figure 4(d), we compare for a same noise level the error when we use different sample sizes. When the sample size is 10K, we have bigger error. When the sample size is 80K and 40K, the errors are similar and small. Biological data analysis. We compute modes of the microarray data of Arabidopsis thaliana plant (108 samples, 39 dimensions) [24]. Each gene has three labels: “+”, “0” and “-” respectively denote over-expression, normal-expression and under-expression of the genes. Based on the data sample we estimate the tree graph and compute the top modes with different radiuses δ using Hamming distance. We use multidimensional scaling to map these modes so that their pairwise Hamming distance is approximated by the L2 distance in R2. The result is visualized in Fig. 5 with different scales. The size of the points is proportional to the log of its probability. Arrows in the figure show how each mode merges to survived modes at the larger scale. The graph intuitively shows that there are two major modes when viewed from a large scale and even shows how the modes evolve as we change the scale. (a) (b) (c) (d) Figure 5: Microarray results. From left to right: scale 1 to 4. 5 Conclusion This paper studies the (δ, ρ)-mode estimation problem for tree graphical models. The significance of this work lies in several aspects: (1) we develop an efficient algorithm to illustrate the intrinsic connection between structured statistical modeling and mode characterization; (2) our notion of (δ, ρ)-modes provides a new tool for visualizing the topographical information of complex discrete distributions. This work is the first step towards understanding the statistical and computational aspects of complex discrete distributions. For future investigations, we plan to relax the tree graphical model assumption to junction trees. Acknowledgments Chao Chen thanks Vladimir Kolmogorov and Christoph H. Lampert for helpful discussions. The research of Chao Chen and Dimitris N. Metaxas is partially supported by the grants NSF IIS 1451292 and NSF CNS 1229628. The research of Han Liu is partially supported by the grants NSF IIS1408910, NSF IIS1332109, NIH R01MH102339, NIH R01GM083084, and NIH R01HG06841. 8 References [1] F. R. Bach and M. I. Jordan. Beyond independent components: trees and clusters. The Journal of Machine Learning Research, 4:1205–1233, 2003. [2] D. Batra, P. Yadollahpour, A. Guzman-Rivera, and G. Shakhnarovich. Diverse M-best solutions in markov random fields. Computer Vision–ECCV 2012, pages 1–16, 2012. [3] P. Chaudhuri and J. S. Marron. SiZer for exploration of structures in curves. Journal of the American Statistical Association, 94(447):807–823, 1999. [4] F. Chazal, L. J. Guibas, S. Y. Oudot, and P. Skraba. Persistence-based clustering in Riemannian manifolds. In Proceedings of the 27th annual ACM symp. on Computational Geometry, pages 97–106. ACM, 2011. [5] C. Chen and H. Edelsbrunner. Diffusion runs low on persistence fast. In IEEE International Conference on Computer Vision (ICCV), pages 423–430. IEEE, 2011. [6] C. Chen, V. Kolmogorov, Y. Zhu, D. Metaxas, and C. H. Lampert. Computing the M most probable modes of a graphical model. In International Conf. on Artificial Intelligence and Statistics (AISTATS), 2013. [7] C. Chen, H. Liu, D. N. Metaxas, M. G. Uzunbas¸, and T. Zhao. High dimensional mode estimation – a graphical model approach. Technical report, October 2014. [8] D. Comaniciu and P. Meer. Mean shift: A robust approach toward feature space analysis. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 24(5):603–619, 2002. [9] M. Fromer and C. Yanover. Accurate prediction for atomic-level protein design and its application in diversifying the near-optimal sequence space. Proteins: Structure, Function, and Bioinformatics, 75(3):682–705, 2009. [10] J. D. Lafferty, A. McCallum, and F. C. N. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data. In Proceedings of the Eighteenth International Conference on Machine Learning (ICML), pages 282–289, 2001. [11] J. Li, S. Ray, and B. G. Lindsay. A nonparametric statistical approach to clustering via mode identification. Journal of Machine Learning Research, 8(8):1687–1723, 2007. [12] T. Lindeberg. Scale-space theory in computer vision. Springer, 1993. [13] H. Liu, M. Xu, H. Gu, A. Gupta, J. Lafferty, and L. Wasserman. Forest density estimation. Journal of Machine Learning Research, 12:907–951, 2011. [14] D. Lowe. Distinctive image features from scale-invariant keypoints. IJCV, 60(2):91–110, 2004. [15] R. Maitra. Initializing partition-optimization algorithms. Computational Biology and Bioinformatics, IEEE/ACM Transactions on, 6(1):144–157, 2009. [16] K. Mikolajczyk, T. Tuytelaars, C. Schmid, A. Zisserman, J. Matas, F. Schaffalitzky, T. Kadir, and L. Van Gool. A comparison of affine region detectors. International journal of computer vision, 65(12):43–72, 2005. [17] M. C. Minnotte and D. W. Scott. The mode tree: A tool for visualization of nonparametric density features. Journal of Computational and Graphical Statistics, 2(1):51–68, 1993. [18] D. Nilsson. An efficient algorithm for finding the m most probable configurationsin probabilistic expert systems. Statistics and Computing, 8(2):159–173, 1998. [19] S. Nowozin and C. Lampert. Structured learning and prediction in computer vision. Foundations and Trends in Computer Graphics and Vision, 6(3-4):185–365, 2010. [20] S. Ray and B. G. Lindsay. The topography of multivariate normal mixtures. Annals of Statistics, pages 2042–2065, 2005. [21] B. W. Silverman. Using kernel density estimates to investigate multimodality. Journal of the Royal Statistical Society. Series B (Methodological), pages 97–99, 1981. [22] I. Tsochantaridis, T. Joachims, T. Hofmann, and Y. Altun. Large margin methods for structured and interdependent output variables. In Journal of Machine Learning Research, pages 1453–1484, 2005. [23] M. Wainwright and M. Jordan. Graphical models, exponential families, and variational inference. Foundations and Trends in Machine Learning, 1(1-2):1–305, 2008. [24] A. Wille, P. Zimmermann, E. Vranov´a, A. F¨urholz, O. Laule, S. Bleuler, L. Hennig, A. Prelic, P. von Rohr, L. Thiele, et al. Sparse graphical gaussian modeling of the isoprenoid gene network in arabidopsis thaliana. Genome Biol, 5(11):R92, 2004. [25] A. Witkin. Scale-space filtering. Readings in computer vision: issues, problems, principles, and paradigms, pages 329–332, 1987. 9
2014
378
5,489
Sampling for Inference in Probabilistic Models with Fast Bayesian Quadrature Tom Gunter, Michael A. Osborne Engineering Science University of Oxford {tgunter,mosb}@robots.ox.ac.uk Roman Garnett Knowledge Discovery and Machine Learning University of Bonn rgarnett@uni-bonn.de Philipp Hennig MPI for Intelligent Systems T¨ubingen, Germany phennig@tuebingen.mpg.de Stephen J. Roberts Engineering Science University of Oxford sjrob@robots.ox.ac.uk Abstract We propose a novel sampling framework for inference in probabilistic models: an active learning approach that converges more quickly (in wall-clock time) than Markov chain Monte Carlo (MCMC) benchmarks. The central challenge in probabilistic inference is numerical integration, to average over ensembles of models or unknown (hyper-)parameters (for example to compute the marginal likelihood or a partition function). MCMC has provided approaches to numerical integration that deliver state-of-the-art inference, but can suffer from sample inefficiency and poor convergence diagnostics. Bayesian quadrature techniques offer a model-based solution to such problems, but their uptake has been hindered by prohibitive computation costs. We introduce a warped model for probabilistic integrands (likelihoods) that are known to be non-negative, permitting a cheap active learning scheme to optimally select sample locations. Our algorithm is demonstrated to offer faster convergence (in seconds) relative to simple Monte Carlo and annealed importance sampling on both synthetic and real-world examples. 1 Introduction Bayesian approaches to machine learning problems inevitably call for the frequent approximation of computationally intractable integrals of the form Z = ⟨ℓ⟩= Z ℓ(x) π(x) dx, (1) where both the likelihood ℓ(x) and prior π(x) are non-negative. Such integrals arise when marginalising over model parameters or variables, calculating predictive test likelihoods and computing model evidences. In all cases the function to be integrated—the integrand—is naturally constrained to be non-negative, as the functions being considered define probabilities. In what follows we will primarily consider the computation of model evidence, Z. In this case ℓ(x) defines the unnormalised likelihood over a D-dimensional parameter set, x1, ..., xD, and π(x) defines a prior density over x. Many techniques exist for estimating Z, such as annealed importance sampling (AIS) [1], nested sampling [2], and bridge sampling [3]. These approaches are based around a core Monte Carlo estimator for the integral, and make minimal effort to exploit prior information about the likelihood surface. Monte Carlo convergence diagnostics are also unreliable for partition function estimates [4, 5, 6]. More advanced methods—e.g., AIS—also require parameter tuning, and will yield poor estimates with misspecified parameters. 1 The Bayesian quadrature (BQ) [7, 8, 9, 10] approach to estimating model evidence is inherently model based. That is, it involves specifying a prior distribution over likelihood functions in the form of a Gaussian process (GP) [11]. This prior may be used to encode beliefs about the likelihood surface, such as smoothness or periodicity. Given a set of samples from ℓ(x), posteriors over both the integrand and the integral may in some cases be computed analytically (see below for discussion on other generalisations). Active sampling [12] can then be used to select function evaluations so as to maximise the reduction in entropy of either the integrand or integral. Such an approach has been demonstrated to improve sample efficiency, relative to na¨ıve randomised sampling [12]. In a big-data setting, where likelihood function evaluations are prohibitively expensive, BQ is demonstrably better than Monte Carlo approaches [10, 12]. As the cost of the likelihood decreases, however, BQ no longer achieves a higher effective sample rate per second, because the computational cost of maintaining the GP model and active sampling becomes relevant, and many Monte Carlo samples may be generated for each new BQ sample. Our goal was to develop a cheap and accurate BQ model alongside an efficient active sampling scheme, such that even for low cost likelihoods BQ would be the scheme of choice. Our contributions extend existing work in two ways: Square-root GP: Foundational work [7, 8, 9, 10] on BQ employed a GP prior directly on the likelihood function, making no attempt to enforce non-negativity a priori. [12] introduced an approximate means of modelling the logarithm of the integrand with a GP. This involved making a first-order approximation to the exponential function, so as to maintain tractability of inference in the integrand model. In this work, we choose another classical transformation to preserve non-negativity—the square-root. By placing a GP prior on the square-root of the integrand, we arrive at a model which both goes some way towards dealing with the high dynamic range of most likelihoods, and enforces non-negativity without the approximations resorted to in [12]. Fast Active Sampling: Whereas most approaches to BQ use either a randomised or fixed sampling scheme, [12] targeted the reduction in the expected variance of Z. Here, we sample where the expected posterior variance of the integrand after the quadratic transform is at a maximum. This is a cheap way of balancing exploitation of known probability mass and exploration of the space in order to approximately minimise the entropy of the integral. We compare our approach, termed warped sequential active Bayesian integration (WSABI), to nonnegative integration with standard Monte Carlo techniques on simulated and real examples. Crucially, we make comparisons of error against ground truth given a fixed compute budget. 2 Bayesian Quadrature Given a non analytic integral ⟨ℓ⟩:= R ℓ(x)π(x) dx on a domain X = RD, Bayesian quadrature is a model based approach of inferring both the functional form of the integrand and the value of the integral conditioned on a set of sample points. Typically the prior density is assumed to be a Gaussian, π(x) := N(x; ν, Λ); however, via the use of an importance re-weighting trick, q(x) = (q(x)/π(x)) π(x), any prior density q(x) may be integrated against. For clarity we will henceforth notationally consider only the X = R case, although all results trivially extend to X = Rd. Typically a GP prior is chosen for ℓ(x), although it may also be directly specified on ℓ(x)π(x). This is parameterised by a mean µ(x) and scaled Gaussian covariance K(x, x′) := λ2 exp  −1 2 (x−x′)2 σ2  . The output length-scale λ and input length-scale σ control the standard deviation of the output and the autocorrelation range of each function evaluation respectively, and will be jointly denoted as θ = {λ, σ}. Conditioned on samples xd = {x1, ..., xN} and associated function values ℓ(xd), the posterior mean is mD(x) := µ(x) + K(x, xd)K−1(xd, xd) ℓ(xd) −µ(xd)  , and the posterior covariance is CD(x, x′) := K(x, x) −K(x, xd)K(xd, xd)−1K(xd, x), where D :=  xd, ℓ(xd), θ . For an extensive review of the GP literature and associated identities, see [11]. When a GP prior is placed directly on the integrand in this manner, the posterior mean and variance of the integral can be derived analytically through the use of Gaussian identities, as in [10]. This is because the integration is a linear projection of the function posterior onto π(x), and joint Gaussianity is preserved through any arbitrary affine transformation. The mean and variance estimate of the integral are given as follows: Eℓ|D  ⟨ℓ⟩  = R mD(x) π(x) dx (2), and 2 Vℓ|D  ⟨ℓ⟩  = RR CD(x, x′) π(x) dx π(x′) dx′ (3). Both mean and variance are analytic when π(x) is Gaussian, a mixture of Gaussians, or a polynomial (amongst other functional forms). If the GP prior is placed directly on the likelihood in the style of traditional Bayes–Hermite quadrature, the optimal point to add a sample (from an information gain perspective) is dependent only on xd—the locations of the previously sampled points. This means that given a budget of N samples, the most informative set of function evaluations is a design that can be pre-computed, completely uninfluenced by any information gleaned from function values [13]. In [12], where the log-likelihood is modelled by a GP, a dependency is introduced between the uncertainty over the function at any point and the function value at that point. This means that the optimal sample placement is now directly influenced by the obtained function values. True function GP posterior mean 95% confidence interval ℓ(x) X (a) Traditional Bayes–Hermite quadrature. True function WSABI-M posterior mean 95% confidence interval ℓ(x) X (b) Square-root moment-matched Bayesian quadrature. Figure 1: Figure 1a depicts the integrand as modelled directly by a GP, conditioned on 15 samples selected on a grid over the domain. Figure 1b shows the moment matched approximation—note the larger relative posterior variance in areas where the function is high. The linearised square-root GP performed identically on this example, and is not shown. An illustration of Bayes–Hermite quadrature is given in Figure 1a. Conditioned on a grid of 15 samples, it is visible that any sample located equidistant from two others is equally informative in reducing our uncertainty about ℓ(x). As the dimensionality of the space increases, exploration can be increasingly difficult due to the curse of dimensionality. A better designed BQ strategy would create a dependency structure between function value and informativeness of sample, in such a way as to appropriately express prior bias towards exploitation of existing probability mass. 3 Square-Root Bayesian Quadrature Crucially, likelihoods are non-negative, a fact neglected by traditional Bayes–Hermite quadrature. In [12] the logarithm of the likelihood was modelled, and approximate the posterior of the integral, via a linearisation trick. We choose a different member of the power transform family—the square-root. The square-root transform halves the dynamic range of the function we model. This helps deal with the large variations in likelihood observed in a typical model, and has the added benefit of extending the autocorrelation range (or the input length-scale) of the GP, yielding improved predictive power when extrapolating away from existing sample points. Let ˜ℓ(x) := q 2 ℓ(x) −α  , such that ℓ(x) = α + 1/2 ˜ℓ(x)2, where α is a small positive scalar.1 We then take a GP prior on ˜ℓ(x): ˜ℓ∼GP(0, K). We can then write the posterior for ˜ℓas p(˜ℓ| D) = GP ˜ℓ; ˜mD(·), ˜CD(·, ·)  ; (4) ˜mD(x) := K(x, xd)K(xd, xd)−1˜ℓ(xd); (5) ˜CD(x, x′) := K(x, x′) −K(x, xd)K(xd, xd)−1K(xd, x′). (6) The square-root transformation renders analysis intractable with this GP: we arrive at a process whose marginal distribution for any ℓ(x) is a non-central χ2 (with one degree of freedom). Given this process, the posterior for our integral is not closed-form. We now describe two alternative approximation schemes to resolve this problem. 1α was taken as 0.8 × min ℓ(xd) in all experiments; our investigations found that performance was insensitive to the choice of this parameter. 3 3.1 Linearisation We firstly consider a local linearisation of the transform f : ˜ℓ7→ℓ= α + 1/2 ˜ℓ2. As GPs are closed under linear transformations, this linearisation will ensure that we arrive at a GP for ℓgiven our existing GP on ˜ℓ. Generically, if we linearise around ˜ℓ0, we have ℓ≃f(˜ℓ0) + f ′(˜ℓ0)(˜ℓ−˜ℓ0). Note that f ′(˜ℓ) = ˜ℓ: this simple gradient is a further motivation for our transform, as described further in Section 3.3. We choose ˜ℓ0 = ˜mD; this represents the mode of p(˜ℓ| D). Hence we arrive at ℓ(x) ≃ α + 1/2 ˜mD(x)2 + ˜mD(x) ˜ℓ(x) −˜mD(x)  = α −1/2 ˜mD(x)2 + ˜mD(x) ˜ℓ(x). (7) Under this approximation, in which ℓis a simple affine transformation of ˜ℓ, we have p(ℓ| D) ≃GP ℓ; mL D(·), CL D(·, ·)  ; (8) mL D(x) := α + 1/2 ˜mD(x)2; (9) CL D(x, x′) := ˜mD(x) ˜CD(x, x′) ˜mD(x′). (10) 3.2 Moment Matching Alternatively, we consider a moment-matching approximation: p(ℓ| D) is approximated as a GP with mean and covariance equal to those of the true χ2 (process) posterior. This gives p(ℓ| D) := GP ℓ; mM D (·), CM D (·, ·)  , where mM D (x) := α + 1/2 ˜m2 D(x) + ˜CD(x, x)  ; (11) CM D (x, x′) := 1/2 ˜CD(x, x′)2 + ˜mD(x) ˜CD(x, x′) ˜mD(x′). (12) We will call these two approximations WSABI-L (for “linear”) and WSABI-M (for “moment matched”), respectively. Figure 2 shows a comparison of the approximations on synthetic data. The likelihood function, ℓ(x), was defined to be ℓ(x) = exp(−x2), and is plotted in red. We placed a GP prior on ˜ℓ, and conditioned this on seven observations spanning the interval [−2, 2]. We then drew 50 000 samples from the true χ2 posterior on ˜ℓalong a dense grid on the interval [−5, 5] and used these to estimate the true density of ℓ(x), shown in blue shading. Finally, we plot the means and 95% confidence intervals for the approximate posterior. Notice that the moment matching results in a higher mean and variance far from observations, but otherwise the approximations largely agree with each other and the true density. 3.3 Quadrature ˜mD and ˜CD are both mixtures of un-normalised Gaussians K. As such, the expressions for posterior mean and covariance under either the linearisation (mL D and CL D, respectively) or the momentmatching approximations (mM D and CM D , respectively) are also mixtures of un-normalised Gaussians. Substituting these expressions (under either approximation) into (2) and (3) yields closedform expressions (omitted due to their length) for the mean and variance of the integral ⟨ℓ⟩. This result motivated our initial choice of transform: for linearisation, for example, it was only the fact that the gradient f ′(˜ℓ) = ˜ℓthat rendered the covariance in (10) a mixture of un-normalised Gaussians. The discussion that follows is equally applicable to either approximation. It is clear that the posterior variance of the likelihood model is now a function of both the expected value of the likelihood at that point, and the distance of that sample location from the rest of xd. This is visualised in Figure 1b. Comparing Figures 1a and 1b we see that conditioned on an identical set of samples, WSABI both achieves a closer fit to the true underlying function, and associates minimal probability mass with negative function values. These are desirable properties when modelling likelihood functions—both arising from the use of the square-root transform. 4 Active Sampling Given a full Bayesian model of the likelihood surface, it is natural to call on the framework of Bayesian decision theory, selecting the next function evaluation so as to optimally reduce our uncer4 95% CI (WSABI-L) Mean (WSABI-L) 95% CI (WSABI-M) Mean (WSABI-M) Mean (ground truth) χ2 process ℓ(x) X Figure 2: The χ2 process, alongside moment matched (WSABI-M) and linearised approximations (WSABI-L). Notice that the WSABI-L mean is nearly identical to the ground truth. tainty about either the total integrand surface or the integral. Let us define this next sample location to be x∗, and the associated likelihood to be ℓ∗:= ℓ(x∗). Two utility functions immediately present themselves as natural choices, which we consider below. Both options are appropriate for either of the approximations to p(ℓ) described above. 4.1 Minimizing expected entropy One possibility would be to follow [12] in minimising the expected entropy of the integral, by selecting x∗= arg min x Vℓ|D,ℓ(x)  ⟨ℓ⟩  , where D Vℓ|D,ℓ(x)  ⟨ℓ⟩ E = Z Vℓ|D,ℓ(x)  ⟨ℓ⟩  N ℓ(x); mD(x), CD(x, x)  dℓ(x). (13) 4.2 Uncertainty sampling Alternatively, we can target the reduction in entropy of the total integrand ℓ(x)π(x) instead, by targeting x∗= arg max x Vℓ|D  ℓ(x)π(x)  (this is known as uncertainty sampling), where VM ℓ|D  ℓ(x)π(x)  = π(x)CD(x, x)π(x) = π(x)2 ˜CD(x, x) 1/2 ˜CD(x, x) + ˜mD(x)2 , (14) in the case of our moment matched approximation, and, under the linearisation approximation, VL ℓ|D  ℓ(x)π(x)  = π(x)2 ˜CD(x, x) ˜mD(x)2. (15) The uncertainty sampling option reduces the entropy of our GP approximation to p(ℓ) rather than the true (intractable) distribution. The computation of either (14) or (15) is considerably cheaper and more numerically stable than that of (13). Notice that as our model builds in greater uncertainty in the likelihood where it is high, it will naturally balance sampling in entirely unexplored regions against sampling in regions where the likelihood is expected to be high. Our model (the squareroot transform) is more suited to the use of uncertainty sampling than the model taken in [12]. This is because the approximation to the posterior variance is typically poorer for the extreme logtransform than for the milder square-root transform. This means that, although the log-transform would achieve greater reduction in dynamic range than any power transform, it would also introduce the most error in approximating the posterior predictive variance of ℓ(x). Hence, on balance, we consider the square-root transform superior for our sampling scheme. Figures 3–4 illustrate the result of square-root Bayesian quadrature, conditioned on 15 samples selected sequentially under utility functions (14) and (15) respectively. In both cases the posterior mean has not been scaled by the prior π(x) (but the variance has). This is intended to exaggerate the contributions to the mean made by WSABI-M. A good posterior estimate of the integral has been achieved, and this set of samples is more informative than a grid under the utility function of minimising the integral error. In all active-learning 5 Optimal next sample True function WSABI-M posterior mean 95% Confidence interval Prior mass ℓ(x) X Figure 3: Square-root Bayesian quadrature with active sampling according to utility function (14) and corresponding momentmatched model. Note the non-zero expected mean everywhere. Optimal next sample True function WSABI-L posterior mean 95% Confidence interval Prior mass ℓ(x) X Figure 4: Square-root Bayesian quadrature with active sampling according to utility function (15) and corresponding linearised model. Note the zero expected mean away from samples. examples a covariance matrix adaptive evolution strategy (CMA-ES) [14] global optimiser was used to explore the utility function surface before selecting the next sample. 5 Results Given this new model and fast active sampling scheme for likelihood surfaces, we now test for speed against standard Monte Carlo techniques on a variety of problems. 5.1 Synthetic Likelihoods We generated 16 likelihoods in four-dimensional space by selecting K normal distributions with K drawn uniformly at random over the integers 5–14. The means were drawn uniformly at random over the inner quarter of the domain (by area), and the covariances for each were produced by scaling each axis of an isotropic Gaussian by an integer drawn uniformly at random between 21 and 29. The overall likelihood surface was then given as a mixture of these distributions, with weights given by partitioning the unit interval into K segments drawn uniformly at random—‘stick-breaking’. This procedure was chosen in order to generate ‘lumpy’ surfaces. We budgeted 500 samples for our new method per likelihood, allocating the same amount of time to simple Monte Carlo (SMC). Naturally the computational cost per evaluation of this likelihood is effectively zero, which afforded SMC just under 86 000 samples per likelihood on average. WSABI was on average faster to converge to 10−3 error (Figure 5), and it is visible in Figure 6 that the likelihood of the ground truth is larger under this model than with SMC. This concurs with the fact that a tighter bound was achieved. 5.2 Marginal Likelihood of GP Regression As an initial exploration into the performance of our approach on real data, we fitted a Gaussian process regression model to the yacht hydrodynamics benchmark dataset [15]. This has a sixdimensional input space corresponding to different properties of a boat hull, and a one-dimensional output corresponding to drag coefficient. The dataset has 308 examples, and using a squared exponential ARD covariance function a single evaluation of the likelihood takes approximately 0.003 seconds. Marginalising over the hyperparameters of this model is an eight-dimensional non-analytic integral. Specifically, the hyperparameters were: an output length-scale, six input length-scales, and an output noise variance. We used a zero-mean isotropic Gaussian prior over the hyperparameters in log space with variance of 4. We obtained ground truth through exhaustive SMC sampling, and budgeted 1 250 samples for WSABI. The same amount of compute-time was then afforded to SMC, AIS (which was implemented with a Metropolis–Hastings sampler), and Bayesian Monte Carlo (BMC). SMC achieved approximately 375 000 samples in the same amount of time. We ran AIS in 10 steps, spaced on a log-scale over the number of iterations, hence the AIS plot is more granular than the others (and does not begin at 0). The ‘hottest’ proposal distribution for AIS was a Gaussian centered on the prior mean, with variance tuned down from a maximum of the prior variance. 6 SMC ± 1 std. error SMC WSABI-L ± 1 std. error WSABI-L Fractional error vs. ground truth Time in seconds 0 20 40 60 80 100 120 140 160 180 200 10−3 10−2 10−1 100 Figure 5: Time in seconds vs. average fractional error compared to the ground truth integral, as well as empirical standard error bounds, derived from the variance over the 16 runs. WSABI-M performed slightly better. SMC WSABI-L Average likelihood of ground truth Time in seconds 0 50 100 150 200 ×105 0 1 2 3 4 5 Figure 6: Time in seconds versus average likelihood of the ground truth integral over 16 runs. WSABI-M has a significantly larger variance estimate for the integral as compared to WSABI-L. BMC AIS SMC WSABI-M WSABI-L Ground truth log Z Time in seconds 0 200 400 600 800 1000 1200 1400 ×104 −1.5 −1 −0.5 0 0.5 1 Figure 7: Log-marginal likelihood of GP regression on the yacht hydrodynamics dataset. Figure 7 shows the speed with which WSABI converges to a value very near ground truth compared to the rest. AIS performs rather disappointingly on this problem, despite our best attempts to tune the proposal distribution to achieve higher acceptance rates. Although the first datapoint (after 10 000 samples) is the second best performer after WSABI, further compute budget did very little to improve the final AIS estimate. BMC is by far the worst performer. This is because it has relatively few samples compared to SMC, and those samples were selected completely at random over the domain. It also uses a GP prior directly on the likelihood, which due to the large dynamic range will have a poor predictive performance. 5.3 Marginal Likelihood of GP Classification We fitted a Gaussian process classification model to both a one dimensional synthetic dataset, as well as real-world binary classification problem defined on the nodes of a citation network [16]. The latter had a four-dimensional input space and 500 examples. We use a probit likelihood model, inferring the function values using a Laplace approximation. Once again we marginalised out the hyperparameters. 7 5.4 Synthetic Binary Classification Problem We generate 500 binary class samples using a 1D input space. The GP classification scheme implemented in Gaussian Processes for Machine Learning Matlab Toolbox (GPML) [17] is employed using the inference and likelihood framework described above. We marginalised over the threedimensional hyperparameter space of: an output length-scale, an input length-scale and a ‘jitter’ parameter. We again tested against BMC, AIS, SMC and, additionally, Doubly-Bayesian Quadrature (BBQ) [12]. Ground truth was found through 100 000 SMC samples. This time the acceptance rate for AIS was significantly higher, and it is visibly converging to the ground truth in Figure 8, albeit in a more noisy fashion than the rest. WSABI-L performed particularly well, almost immediately converging to the ground truth, and reaching a tighter bound than SMC in the long run. BMC performed well on this particular example, suggesting that the active sampling approach did not buy many gains on this occasion. Despite this, the square-root approaches both converged to a more accurate solution with lower variance than BMC. This suggests that the square-root transform model generates significant added value, even without an active sampling scheme. The computational cost of selecting samples under BBQ prevents rapid convergence. 5.5 Real Binary Classification Problem For our next experiment, we again used our method to calculate the model evidence of a GP model with a probit likelihood, this time on a real dataset. The dataset, first described in [16], was a graph from a subset of the CiteSeerx citation network. Papers in the database were grouped based on their venue of publication, and papers from the 48 venues with the most associated publications were retained. The graph was defined by having these papers as its nodes and undirected citation relations as its edges. We designated all papers appearing in NIPS proceedings as positive observations. To generate Euclidean input vectors, the authors performed “graph principal component analysis” on this network [18]; here, we used the first four graph principal components as inputs to a GP classifier. The dataset was subsampled down to a set of 500 examples in order to generate a cheap likelihood, half of which were positive. BBQ BMC AIS SMC WSABI-M WSABI-L Ground truth log Z Time in seconds 0 50 100 150 200 250 300 350 400 450 −158 −156 −154 −152 −150 −148 −146 −144 Figure 8: Log-marginal likelihood for GP classification—synthetic dataset. BBQ BMC AIS SMC WSABI-M WSABI-L Ground truth log Z Time in seconds 0 200 400 600 800 1000 1200 1400 1600 1800 −310 −300 −290 −280 −270 −260 −250 −240 −230 −220 Figure 9: Log-marginal likelihood for GP classification—graph dataset. Across all our results, it is noticeable that WSABI-M typically performs worse relative to WSABI-L as the dimensionality of the problem increases. This is due to an increased propensity for exploration as compared to WSABI-L. WSABI-L is the fastest method to converge on all test cases, apart from the synthetic mixture model surfaces where WSABI-M performed slightly better (although this was not shown in Figure 5). These results suggest that an active-sampling policy which aggressively exploits areas of probability mass before exploring further afield may be the most appropriate approach to Bayesian quadrature for real likelihoods. 6 Conclusions We introduced the first fast Bayesian quadrature scheme, using a novel warped likelihood model and a novel active sampling scheme. Our method, WSABI, demonstrates faster convergence (in wall-clock time) for regression and classification benchmarks than the Monte Carlo state-of-the-art. 8 References [1] R.M. Neal. Annealed importance sampling. Statistics and Computing, 11(2):125–139, 2001. [2] J. Skilling. Nested sampling. Bayesian inference and maximum entropy methods in science and engineering, 735:395–405, 2004. [3] X. Meng and W. H. Wong. Simulating ratios of normalizing constants via a simple identity: a theoretical exploration. Statistica Sinica, 6(4):831–860, 1996. [4] R. M. Neal. Probabilistic inference using Markov chain Monte Carlo methods. Technical Report CRG-TR-93-1, University of Toronto, 1993. [5] S.P. Brooks and G.O. Roberts. Convergence assessment techniques for Markov chain Monte Carlo. Statistics and Computing, 8(4):319–335, 1998. [6] M.K. Cowles, G.O. Roberts, and J.S. Rosenthal. Possible biases induced by MCMC convergence diagnostics. Journal of Statistical Computation and Simulation, 64(1):87, 1999. [7] P. Diaconis. Bayesian numerical analysis. In S. Gupta J. Berger, editor, Statistical Decision Theory and Related Topics IV, volume 1, pages 163–175. Springer-Verlag, New York, 1988. [8] A. O’Hagan. Bayes-Hermite quadrature. Journal of Statistical Planning and Inference, 29:245–260, 1991. [9] M. Kennedy. Bayesian quadrature with non-normal approximating functions. Statistics and Computing, 8(4):365–375, 1998. [10] C. E. Rasmussen and Z. Ghahramani. Bayesian Monte Carlo. In S. Becker and K. Obermayer, editors, Advances in Neural Information Processing Systems, volume 15. MIT Press, Cambridge, MA, 2003. [11] C. E. Rasmussen and C. K. I. Williams. Gaussian Processes for Machine Learning. MIT Press, 2006. [12] M. A. Osborne, D. K. Duvenaud, R. Garnett, C. E. Rasmussen, S. J. Roberts, and Z. Ghahramani. Active learning of model evidence using Bayesian quadrature. In P. Bartlett, F. C. N. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems. MIT Press, Cambridge, MA, 2012. [13] T. P. Minka. Deriving quadrature rules from Gaussian processes. Technical report, Statistics Department, Carnegie Mellon University, 2000. [14] N. Hansen, S. D. M¨uller, and P. Koumoutsakos. Reducing the time complexity of the derandomized evolution strategy with covariance matrix adaptation (CMA-ES). Evolutionary Computation, 11(1):1–18, 2003. [15] J Gerritsma, R Onnink, and A Versluis. Geometry, resistance and stability of the delft systematic yacht hull series. International shipbuilding progress, 28(328), 1981. [16] R. Garnett, Y. Krishnamurthy, X. Xiong, J. Schneider, and R. P. Mann. Bayesian optimal active search and surveying. In J. Langford and J. Pineau, editors, Proceedings of the 29th International Conference on Machine Learning (ICML 2012). Omnipress, Madison, WI, USA, 2012. [17] C. E. Rasmussen and H. Nickisch. Gaussian processes for machine learning (GPML) toolbox. The Journal of Machine Learning Research, 11(2010):3011–03015. [18] F. Fouss, A. Pirotte, J-M Renders, and M. Saerens. Random-walk computation of similarities between nodes of a graph with application to collaborative recommendation. IEEE Transactions on Knowledge and Data Engineering, 19(3):355–369, 2007. 9
2014
379
5,490
Deep Networks with Internal Selective Attention through Feedback Connections Marijn F. Stollenga∗, Jonathan Masci∗, Faustino Gomez, Juergen Schmidhuber IDSIA, USI-SUPSI Manno-Lugano, Switzerland {marijn,jonathan,tino,juergen}@idsia.ch Abstract Traditional convolutional neural networks (CNN) are stationary and feedforward. They neither change their parameters during evaluation nor use feedback from higher to lower layers. Real brains, however, do. So does our Deep Attention Selective Network (dasNet) architecture. DasNet’s feedback structure can dynamically alter its convolutional filter sensitivities during classification. It harnesses the power of sequential processing to improve classification performance, by allowing the network to iteratively focus its internal attention on some of its convolutional filters. Feedback is trained through direct policy search in a huge million-dimensional parameter space, through scalable natural evolution strategies (SNES). On the CIFAR-10 and CIFAR-100 datasets, dasNet outperforms the previous state-of-the-art model on unaugmented datasets. 1 Introduction Deep convolutional neural networks (CNNs) [1] with max-pooling layers [2] trained by backprop [3] on GPUs [4] have become the state-of-the-art in object recognition [5, 6, 7, 8], segmentation/detection [9, 10], and scene parsing [11, 12] (for an extensive review see [13]). These architectures consist of many stacked feedforward layers, mimicking the bottom-up path of the human visual cortex, where each layer learns progressively more abstract representations of the input data. Low-level stages tend to learn biologically plausible feature detectors, such as Gabor filters [14]. Detectors in higher layers learn to respond to concrete visual objects or their parts, e.g., [15]. Once trained, the CNN never changes its weights or filters during evaluation. Evolution has discovered efficient feedforward pathways for recognizing certain objects in the blink of an eye. However, an expert ornithologist, asked to classify a bird belonging to one of two very similar species, may have to think for more than a few milliseconds before answering [16, 17], implying that several feedforward evaluations are performed, where each evaluation tries to elicit different information from the image. Since humans benefit greatly from this strategy, we hypothesise CNNs can too. This requires: (1) the formulation of a non-stationary CNN that can adapt its own behaviour post-training, and (2) a process that decides how to adapt the CNNs behaviour. This paper introduces Deep Attention Selective Networks (dasNet) which model selective attention in deep CNNs by allowing each layer to influence all other layers on successive passes over an image through special connections (both bottom-up and top-down), that modulate the activity of the convolutional filters. The weights of these special connections implement a control policy that is learned through reinforcement learning after the CNN has been trained in the usual way via supervised learning. Given an input image, the attentional policy can enhance or suppress features over multiple passes to improve the classification of difficult cases not captured by the initially supervised ∗Shared first author. 1 training. Our aim is to let the system check the usefulness of internal CNN filters automatically, omitting manual inspection [18]. In our current implementation, the attentional policy is evolved using Separable Natural Evolution Strategies (SNES; [19]), instead of a conventional, single agent reinforcement learning method (e.g. value iteration, temporal difference, policy gradients, etc.) due to the large number of parameters (over 1 million) required to control CNNs of the size typically used in image classification. Experiments on CIFAR-10 and CIFAR100 [20] show that on difficult classification instances, the network corrects itself by emphasising and de-emphasising certain filters, outperforming a previous state-of-the-art CNN. 2 Maxout Networks In this work we use the Maxout networks [7], combined with dropout [21], as the underlying model for dasNet. Maxout networks represent the state-of-the-art for object recognition in various tasks and have only been outperformed (by a small margin) by averaging committees of several convolutional neural networks. A similar approach, which does not reduce dimensionality in favor of sparsity in the representation has also been recently presented [22]. Maxout CNNs consist of a stack of alternating convolutional and maxout layers, with a final classification layer on top: Convolutional Layer. The input to this layer can be an image or the output of a previous layer, consisting of c input maps of width m and height n: x ∈Rc×m×n. The output consists of a set of c′ output maps: y ∈Rc′×m′×n′. The convolutional layer is parameterised by c · c′ filters of size k × k. We denote the filters by F ℓ i,j ∈Rk×k, where i and j are indexes of the input and output maps and ℓ denotes the layer. yℓ j = i=c ∑ i=0 ϕ(xi ∗F ℓ i,j) (1) where i and j index the input and output map respectively, ∗is the convolutional operator, ϕ is an element-wise nonlinear function, and ℓis used to index the layer. The size of the output is determined by the kernel size and the stride used for the convolution (see [7]). Pooling Layer. A pooling layer is used to reduced the dimensionality of the output from a convolutional layer. The usual approach is to take the maximum value among non- or partially-overlapping patches in every map, therefore reducing dimensionality along the height and width [2]. Instead, a Maxout pooling layer reduces every b consecutive maps to one map, by keeping only the maximum value for every pixel-position, where b is called the block size. Thus the map reduces c input maps to c′ = c/b output maps. yℓ j,x,y = b max i=0 yℓ−1 j·b+i,x,y (2) where yℓ∈Rc′×m′×n′, and ℓagain is used to index the layer. The output of the pooling layer can either be used as input to another pair of convolutional- and pooling layers, or form input to a final classification layer. Classification Layer. Finally, a classification step is performed. First the output of the last pooling layer is flattened into one large vector ⃗x, to form the input to the following equations: ¯yℓ j = max i=0..b F ℓ j·b+i⃗x (3) v = σ(F ℓ+1¯yℓ) (4) where F ℓ∈RN×|⃗x| (N is chosen), and σ(·) is the softmax activation function which produces the class probabilities v. The input is projected by F and then reduced using a maxout, similar to the pooling layer (3). 2 3 Reinforcement Learning Reinforcement learning (RL) is a general framework for learning to make sequential decisions order to maximise an external reward signal [23, 24]. The learning agent can be anything that has the ability to act and perceive in a given environment. At time t, the agent receives an observation ot ∈O of the current state of the environment st ∈S, and selects an action, at ∈A, chosen by a policy π : O →A, where S, O and A the spaces of all possible states, observations, and action, respectively.1 The agent then enters state st+1 and receives a reward rt ∈R. The objective is to find the policy, π, that maximises the expected future discounted reward, E[∑ t γtrt], where γ ∈[0, 1] discounts the future, modeling the “farsightedness” of the agent. In dasNet, both the observation and action spaces are real valued O = Rdim(O), A = Rdim(A). Therefore, policy πθ must be represented by a function approximator, e.g. a neural network, parameterised by θ. Because the policies used to control the attention of the dasNet have state and actions spaces of close to a thousand dimensions, the policy parameter vector, θ, will contain close to a million weights, which is impractical for standard RL methods. Therefore, we instead evolve the policy using a variant for Natural Evolution Strategies (NES; [25, 26]), called Separable NES (SNES; [19]). The NES family of black-box optimization algorithms use parameterised probability distributions over the search space, instead of an explicit population (i.e., a conventional ES [27]). Typically, the distribution is a multivariate Gaussian parameterised by mean µ and covariance matrix Σ. Each epoch a generation is sampled from the distribution, which is then updated the direction of the natural gradient of the expected fitness of the distribution. SNES differs from standard NES in that instead of maintaining the full covariance matrix of the search distribution, uses only the diagonal entries. SNES is theoretically less powerful than standard NES, but is substantially more efficient. 4 Deep Attention Selective Networks (dasNet) The idea behind dasNet is to harness the power of sequential processing to improve classification performance by allowing the network to iteratively focus the attention of its filters. First, the standard Maxout net (see Section 2) is augmented to allow the filters to be weighted differently on different passes over the same image (compare to equation 1): yℓ j = aℓ j i=c ∑ i=0 ϕ(xi ∗F ℓ i,j), (5) where aℓ j is the weight of the j-th output map in layer ℓ, changing the strength of its activation, before applying the maxout pooling operator. The vector a = [a0 0, a0 1, · · · , a0 c′, a1 0, · · · , a1 c′, · · · ] represents the action that the learned policy must select in order to sequentially focus the attention of the Maxout net on the most discriminative features in the image being processed. Changing action a will alter the behaviour of the CNN, resulting in different outputs, even when the image x does not change. We indicate this with the following notation: vt = Mt(θ, x) (6) where θ is the parameter vector of the policy, πθ, and vt is the output of the network on pass t. Algorithm 1 describes the dasNet training algorithm. Given a Maxout net, M, that has already been trained to classify images using training set, X, the policy, π, is evolved using SNES to focus the attention of M. Each pass through the while loop represents one generation of SNES. Each generation starts by selecting a subset of n images from X at random. Then each of the p samples drawn from the SNES search distribution (with mean µ and covariance Σ) representing the parameters, θi, of a candidate policy, πθi, undergoes n trials, one for each image in the batch. During a trial, the image is presented to the Maxout net T times. In the first pass, t = 0, the action, a0, is set to ai = 1, ∀i, so that the Maxout network functions as it would normally — 1In this work π : O →A is a deterministic policy; given an observation it will always output the same action. However, π could be extended to stochastic policies. 3 Algorithm 1 TRAIN DASNET (M, µ, Σ, p, n) 1: while True do 2: images ⇐NEXTBATCH(n) 3: for i = 0 →p do 4: θi ∼N(µ, Σ) 5: for j = 0 →n do 6: a0 ⇐1 {Initialise gates a with identity activation} 7: for t = 0 →T do 8: vt = Mt(θi, xi) 9: ot ⇐h(Mt) 10: at+1 ⇐πθi(ot) 11: end for 12: Li = −λboostd log(vT ) 13: end for 14: F[i] ⇐f(θi) 15: Θ[i] ⇐θi 16: end for 17: UPDATESNES(F, Θ) {Details in supplementary material.} 18: end while the action has no effect. Once the image is propagated through the net, an observation vector, o0, is constructed by concatenating the following values extracted from M, by h(·): 1. the average activation of every output map Avg(yj) (Equation 2), of each Maxout layer. 2. the intermediate activations ¯yj of the classification layer. 3. the class probability vector, vt. While averaging map activations provides only partial state information, these values should still be meaningful enough to allow for the selection of good actions. The candidate policy then maps the observation to an action: πθi(o) = dim(A)σ(θiot) = at, (7) where θ ∈Rdim(A)×dim(O) is the weight matrix of the neural network, and σ is the softmax. Note that the softmax function is scaled by the dimensionality of the action space so that elements in the action vector average to 1 (instead of regular softmax which sums to 1), ensuring that all network outputs are positive, thereby keeping the filter activations stable. On the next pass, the same image is processed again, but this time using the filter weighting, a1. This cycle is repeated until pass T (see figure 1 for a illustration of the process), at which time the performance of the network is scored by: Li = −λboostd log(vT ) (8) vT = MT (θi, xi) (9) λboost = {λcorrect if d = ∥vT ∥∞ λmisclassified otherwise, (10) where v is the output of M at the end of the pass T, d is the correct classification, and λcorrect and λmisclassified are constants. Li measures the weighted loss, where misclassified samples are weighted higher than correctly classified samples λmisclassified > λcorrect. This simple form of boosting is used to focus on the ‘difficult’ misclassified images. Once all of the input images have been processed, the policy is assigned the fitness: f(θi) = cumulative score z }| { n ∑ i=1 Li + regularization z }| { λL2∥θi∥2 (11) 4 Softmax Maps Filters Filters Maps Observation Classes map averages map averages t = 1 Action RGB Image Action RGB Image Softmax Maps Filters Filters Maps t = T gates gates error Softmax Maps Filters Filters Maps Classes map averages map averages t = 2 gates gates policy Figure 1: The dasNet Network. Each image in classified after T passes through the network. After each forward propagation through the Maxout net, the output classification vector, the output of the second to last layer, and the averages of all feature maps, are combined into an observation vector that is used by a deterministic policy to choose an action that changes the weights of all the feature maps for the next pass of the same image. After pass T, the output of the Maxout net is finally used to classify the image. where λL2 is a regularization parameter. Once all of the candidate policies have been evaluated, SNES updates its distribution parameters (µ, Σ) according the natural gradient calculated from the sampled fitness values, F. As SNES repeatedly updates the distribution over the course of many generations, the expected fitness of the distribution improves, until the stopping criterion is met when no improvement is made for several consecutive epochs. 5 Related Work Human vision is still the most advanced and flexible perceptual system known. Architecturally, visual cortex areas are highly connected, including direct connections over multiple levels and topdown connections. Felleman and Essen [28] constructed a (now famous) hierarchy diagram of 32 different visual cortical areas in macaque visual cortex. About 40% of all pairs of areas were considered connected, and most connected areas were connected bidirectionally. The top-down connections are more numerous than bottom-up connections, and generally more diffuse [29]. They are thought to play primarily a modulatory role, while feedforward connections serve as directed information carriers [30]. Analysis of response latencies to a newly-presented image lends credence to the theory that there are two stages of visual processing: a fast, pre-attentive phase, due to feedforward processing, followed by an attentional phase, due to the influence of recurrent processing [31]. After the feedforward pass, we can recognise and localise simple salient stimuli, which can “pop-out” [32], and response times do not increase regardless of the number of distractors. However, this effect has only been conclusively shown for basic features such as colour or orientation; for categorical stimuli or faces, whether there is a pop-out effect remains controversial [33]. Regarding the attentional phase, feedback connections are known to play important roles, such as in feature grouping [34], in differentiating a foreground from its background, (especially when the foreground is not highly salient [35]), and perceptual filling in [36]. Work by Bar et al. [37] supports the idea that top-down projections from prefrontal cortex play an important role in object recognition by quickly extracting low-level spatial frequency information to provide an initial guess about potential categories, forming a top-down expectation that biases recognition. Recurrent connections seem to rely heavily on competitive inhibition and other feedback to make object recognition more robust [38, 39]. In the context of computer vision, RL has been shown to be able to learn saccades in visual scenes to learn selective attention [40, 41], learn feedback to lower levels [42, 43], and improve face recognition [44, 45]. It has been shown to be effective for object recognition [46], and has also been 5 Table 1: Classification results on CIFAR-10 and CIFAR-100 datasets. The error on the test-set is shown for several methods. Note that the result for Dropconnect is the average of 12 models. Our method improves over the state-of-the-art reference implementation to which feedback connections are added. The recent Network in Network architecture [8] has better results when data-augmentation is applied. Method CIFAR-10 CIFAR-100 Dropconnect [51] 9.32% Stochastic Pooling [52] 15.13% Multi-column CNN [5] 11.21% Maxout [7] 9.38% 38.57% Maxout (trained by us) 9.61% 34.54% dasNet 9.22% 33.78% NiN [8] 10.41% 35.68% NiN (augmented) 8.81% 0.44 0.442 0.444 0.446 0.448 0.45 0.452 0 1 2 3 4 5 6 7 8 9 % Correct Number of steps evaluated 0 steps 1 step 2 steps 3 steps Figure 2: Two dasNets were trained on CIFAR-100 for different values of T. Then they were allowed to run for [0..9] iterations for each image. The performance peeks at the number of steps that the network is trained on, after which the performance drops, but does not explode, showing the dynamics are stable. combined with traditional computer vision primitives [47]. Iterative processing of images using recurrency has been successfully used for image reconstruction [48], face-localization [49] and compression [50]. All these approaches show that recurrency in processing and an RL perspective can lead to novel algorithms that improve performance. However, this research is often applied to simplified datasets for demonstration purposes due to computation constraints, and are not aimed at improving the state-of-the-art. In contrast, we apply this perspective directly to the known state-of-the-art neural networks to show that this approach is now feasible and actually increases performance. 6 Experiments on CIFAR-10/100 The experimental evaluation of dasNet focuses on ambiguous classification cases in the CIFAR-10 and CIFAR-100 data sets where, due to a high number of common features, two classes are often mistaken for each other. These are the most interesting cases for our approach. By learning on top of an already trained model, dasNet must aim at fixing these erroneous predictions without disrupting, or forgetting, what has been learned. The CIFAR-10 dataset [20] is composed of 32 × 32 colour images split into 5×104 training and 104 testing samples, where each image is assigned to one of 10 classes. The CIFAR-100 is similarly composed, but contains 100 classes. The number of steps was experimentally determined and fixed at T = 5; small enough to be computationally tractable while still allowing for enough interaction. In all experiments we set λcorrect = 0.005, λmisclassified = 1 and λL2 = 0.005. The Maxout network, M, was trained with data augmentation following global contrast normalization and ZCA normalization. The model consists of three convolutional maxout layers followed by a fully connected maxout and softmax outputs. Dropout of 0.5 was used in all layers except the input layer, and 0.2 for the input layer. The population size for SNES was set to 50. Training took of dasNet took around 4 days on a GTX 560 Ti GPU, excluding the original time used to train M. Table 1 shows the performance of dasNet vs. other methods, where it achieves a relative improvement of 6% with respect to the vanilla CNN. This establishes a new state-of-the-art result for this challenging dataset, for unaugmented data. Figure 3 shows the classification of a cat-image from the test-set. All output map activations in the final step are shown at the top. The difference in activations compared to the first step, i.e., the (de-)emphasis of each map, is shown on the bottom. On the left are the class probabilities for each time-step. At the first step, the classification is ‘dog’, and the cat could indeed be mistaken for a puppy. Note that in the first step, the network has not yet received any feedback. In the next step, the probability for ‘cat’ goes up dramatically, and subsequently drops a bit in the following steps. The network has successfully disambiguated a cat from a dog. If we investigate the filters, we see that in the lower layer emphasis changes significantly (see ‘change of layer 0’). Some filters focus more on surroundings whilst others de-emphasise the eyes. In the 6 1 Timesteps 2 3 4 5 airplane automobile bird cat deer dog frog horse ship truck change of layer 0 change of layer 1 change of layer 2 layer 0 layer 1 layer 2 class probabilities Figure 3: The classification of a cat by the dasNet is shown. All output map activations in the final step are shown on the top. Their changes relative to initial activations in the first step are shown at the bottom (white = emphasis, black = suppression). The changes are normalised to show the effects more clearly. The class probabilities over time are shown on the left. The network first classifies the image as a dog (wrong) but corrects itself by emphasising its convolutional filters to see it is actually a cat. Two more examples are included in the supplementary material. second layer, almost all output maps are emphasised. In the third and highest convolutional layer, the most complex changes to the network can be seen. At this level the positional correspondence is largely lost, and the filters are known to code for ‘higher level’ features. It is in this layer that changes are the most influential because they are closest to the final output layers. It is hard to qualitatively analyze the effect of the alterations. If we compare each final activation in layer 2 to its corresponding change (see Figure 3, right), we see that the activations are not simply uniformly enhanced. Instead, complex suppression and enhancement patterns are found, increasing and decreasing activation of specific pixels. Visualising what these high-level actually do is an open problem in deep learning. Dynamics To investigate the dynamics, a small 2-layer dasNet network was trained for different values of T. Then they were evaluated by allowing them to run for [0..9] steps. Figure 2 shows results of training dasNet on CIFAR-100 for T = 1 and T = 2. The performance goes up from the vanilla CNN, peaks at the step = T as expected, and reduces but stays stable after that. So even though the dasNet was trained using only a small number of steps, the dynamics stay stable when these are evaluated for as many as 10 steps. To verify whether the dasNet policy is actually making good use of its gates, we estimate their information content in the following way: The gate values in the final step are used directly for classification. The hypothesis is that if the gates are used properly, then their activation should contain information that is relevant for classification. For this purpose, a dasNet that was trained with T = 2. Then using only the final gate-values (so without e.g. the output of the classification layer), a classification using 15-nearest neighbour and logistic regression was performed. This resulted in a performance of 40.70% and 45.74% correct respectively, similar to the performance of dasNet, confirming that they contain significant information. 7 Conclusion DasNet is a deep neural network with feedback connections that are learned by through reinforcement learning to direct selective internal attention to certain features extracted from images. After a rapid first shot image classification through a standard stack of feedforward filters, the feedback can actively alter the importance of certain filters “in hindsight”, correcting the initial guess via additional internal “thoughts”. 7 DasNet successfully learned to correct image misclassifications produced by a fully trained feedforward Maxout network. Its active, selective, internal spotlight of attention enabled state-of-the-art results. Future research will also consider more complex actions that spatially focus on (or alter) parts of observed images. Acknowledgments We acknowledge Matthew Luciw for his discussions and for providing a short literature review, included in the Related Work section. References [1] K. Fukushima. “Neural network model for a mechanism of pattern recognition unaffected by shift in position - Neocognitron”. In: Trans. IECE J62-A(10) (1979), pp. 658–665. [2] J. Weng, N. Ahuja, and T. S. Huang. “Cresceptron: a self-organizing neural network which grows adaptively”. In: IJCNN. Vol. 1. IEEE. 1992, pp. 576–581. [3] Y. LeCun et al. “Back-Propagation Applied to Handwritten Zip Code Recognition”. In: Neural Computation 1.4 (1989), pp. 541–551. [4] D. C. Ciresan et al. “Flexible, High Performance Convolutional Neural Networks for Image Classification”. In: IJCAI. 2011, pp. 1237–1242. [5] D. C. Ciresan, U. Meier, and J. Schmidhuber. “Multi-Column Deep Neural Networks for Image Classification”. In: CVPR. Long preprint arXiv:1202.2745v1 [cs.CV]. 2012. [6] A. Krizhevsky, I Sutskever, and G. E Hinton. “ImageNet Classification with Deep Convolutional Neural Networks”. In: NIPS. 2012, p. 4. [7] I. J. Goodfellow et al. “Maxout networks”. In: ICML. 2013. [8] Min Lin, Qiang Chen, and Shuicheng Yan. “Network In Network”. In: CoRR abs/1312.4400 (2013). [9] D. C. Ciresan et al. “Mitosis Detection in Breast Cancer Histology Images with Deep Neural Networks”. In: MICCAI. Vol. 2. 2013, pp. 411–418. [10] D. C. Ciresan et al. “Deep Neural Networks Segment Neuronal Membranes in Electron Microscopy Images”. In: NIPS. 2012, pp. 2852–2860. [11] C. Farabet et al. “Learning hierarchical features for scene labeling”. In: PAMI 35.8 (2013), pp. 1915–1929. [12] P. Sermanet et al. “Pedestrian Detection with Unsupervised Multi-Stage Feature Learning”. In: CVPR. IEEE, 2013. [13] J. Schmidhuber. Deep Learning in Neural Networks: An Overview. Tech. rep. IDSIA-03-14 / arXiv:1404.7828v1 [cs.NE]. The Swiss AI Lab IDSIA, 2014. [14] D. Gabor. “Theory of communication. Part 1: The analysis of information”. In: Electrical Engineers-Part III: Journal of the Institution of Radio and Communication Engineering 93.26 (1946), pp. 429–441. [15] Matthew D Zeiler and Rob Fergus. “Visualizing and understanding convolutional networks”. In: Computer Vision–ECCV. Springer, 2014, pp. 818–833. [16] S. Branson et al. “Visual recognition with humans in the loop”. In: Computer Vision–ECCV 2010. Springer, 2010, pp. 438–451. [17] P. Welinder et al. Caltech-UCSD Birds 200. Tech. rep. CNS-TR-2010-001. California Institute of Technology, 2010. [18] M. D. Zeiler and R. Fergus. Visualizing and Understanding Convolutional Networks. Tech. rep. arXiv:1311.2901 [cs.CV]. NYU, 2013. [19] T. Schaul, T. Glasmachers, and J. Schmidhuber. “High dimensions and heavy tails for natural evolution strategies”. In: GECCO. ACM. 2011, pp. 845–852. [20] A. Krizhevsky. “Learning multiple layers of features from tiny images”. MA thesis. Computer Science Department, University of Toronto, 2009. [21] G. E. Hinton et al. “Improving neural networks by preventing co-adaptation of feature detectors”. In: arXiv preprint arXiv:1207.0580 (2012). [22] R. K. Srivastava et al. “Compete to Compute”. In: NIPS. 2013. [23] L. P. Kaelbling, M. L. Littman, and A. W. Moore. “Reinforcement learning: a survey”. In: Journal of Artificial Intelligence Research 4 (1996), pp. 237–285. 8 [24] R. S. Sutton and A. G. Barto. Reinforcement Learning I: Introduction. 1998. [25] D. Wierstra et al. “Natural evolution strategies”. In: IEEE Congress on Evolutionary Computation. IEEE. 2008, pp. 3381–3387. [26] T. Glasmachers et al. “Exponential natural evolution strategies”. In: GECCO. ACM. 2010, pp. 393–400. [27] I. Rechenberg. Evolutionsstrategie - Optimierung technischer Systeme nach Prinzipien der biologischen Evolution. Dissertation. Published 1973 by Fromman-Holzboog. 1971. [28] D. J. Felleman and D. C. van Essen. “Distributed hierarchical processing in the primate cerebral cortex”. In: Cerebral cortex 1.1 (1991), pp. 1–47. [29] R. J. Douglas et al. “Recurrent excitation in neocortical circuits”. In: Science 269.5226 (1995), pp. 981–985. [30] J. Bullier. “Hierarchies of Cortical Areas”. In: The Primate Visual System. Ed. by J.H. Kaas and C.E. Collins. New York: CRC Press, 2004, pp. 181–204. [31] V. A. F. Lamme and P. R. Roelfsema. “The distinct modes of vision offered by feedforward and recurrent processing”. In: Trends in neurosciences 23.11 (2000), pp. 571–579. [32] L. Itti. “Visual salience”. In: 2.9 (2007), p. 3327. [33] R. VanRullen. “On second glance: Still no high-level pop-out effect for faces”. In: Vision research 46.18 (2006), pp. 3017–3027. [34] C. D. Gilbert and M. Sigman. “Brain states: top-down influences in sensory processing”. In: Neuron 54.5 (2007), pp. 677–696. [35] J. M. Hupe et al. “Cortical feedback improves discrimination between figure and background by V1, V2 and V3 neurons”. In: Nature 394.6695 (1998), pp. 784–787. [36] V. A. F. Lamme. “Blindsight: the role of feedforward and feedback corticocortical connections”. In: Acta psychologica 107.1 (2001), pp. 209–228. [37] M Bar et al. “Top-down facilitation of visual recognition”. In: Proceedings of the National Academy of Sciences of the United States of America 103.2 (2006), pp. 449–454. [38] D. Wyatte et al. “The Role of Competitive Inhibition and Top-Down Feedback in Binding during Object Recognition”. In: Frontiers in Psychology 3 (2012), p. 182. [39] D. Wyatte, T. Curran, and R. O’Reilly. “The limits of feedforward vision: Recurrent processing promotes robust object recognition when objects are degraded”. In: Journal of Cognitive Neuroscience 24.11 (2012), pp. 2248–2261. [40] J. Schmidhuber and R. Huber. “Learning to Generate Artificial Fovea Trajectories for Target Detection”. In: International Journal of Neural Systems 2.1 & 2 (1991), pp. 135–141. [41] Misha Denil et al. “Learning where to attend with deep architectures for image tracking”. In: Neural computation 24.8 (2012), pp. 2151–2184. [42] R. C. O’Reilly. “Biologically plausible error-driven learning using local activation differences: The generalized recirculation algorithm”. In: Neural Computation 8.5 (1996), pp. 895– 938. [43] K. Fukushima. “Restoring partly occluded patterns: a neural network model with backward paths”. In: ICANN/ICONIP. Springer, 2003, pp. 393–400. [44] H. Larochelle and G. Hinton. “Learning to combine foveal glimpses with a third-order Boltzmann machine”. In: Image 1 (2010), p. x2. [45] M. F. Stollenga, M. A. Wiering, and L. R. B. Schomaker. “Using Guided Autoencoders on Face Recognition”. In: Master’s thesis. University of Groningen. 2011. [46] C OReilly R et al. “Recurrent processing during object recognition”. In: Frontiers in Psychology 4 (2013), p. 124. [47] S. D. Whitehead. “Reinforcement Learning for the adaptive control of perception and action”. PhD thesis. University of Rochester, 1992. [48] S. Behnke. “Learning iterative image reconstruction in the Neural Abstraction Pyramid”. In: IJCIA 1.04 (2001), pp. 427–438. [49] S. Behnke. “Face localization and tracking in the neural abstraction pyramid”. In: Neural Computing & Applications 14.2 (2005), pp. 97–103. [50] B. Knoll and N. de Freitas. “A Machine Learning Perspective on Predictive Coding with PAQ8”. In: Data Compression Conference. 2012, pp. 377–386. [51] L. Wan et al. “Regularization of neural networks using dropconnect”. In: ICML. 2013, pp. 1058–1066. [52] Matthew D Zeiler and Rob Fergus. “Stochastic pooling for regularization of deep convolutional neural networks”. In: arXiv preprint arXiv:1301.3557 (2013). 9
2014
38
5,491
Do Deep Nets Really Need to be Deep? Lei Jimmy Ba University of Toronto jimmy@psi.utoronto.ca Rich Caruana Microsoft Research rcaruana@microsoft.com Abstract Currently, deep neural networks are the state of the art on problems such as speech recognition and computer vision. In this paper we empirically demonstrate that shallow feed-forward nets can learn the complex functions previously learned by deep nets and achieve accuracies previously only achievable with deep models. Moreover, in some cases the shallow nets can learn these deep functions using the same number of parameters as the original deep models. On the TIMIT phoneme recognition and CIFAR-10 image recognition tasks, shallow nets can be trained that perform similarly to complex, well-engineered, deeper convolutional models. 1 Introduction You are given a training set with 1M labeled points. When you train a shallow neural net with one fully connected feed-forward hidden layer on this data you obtain 86% accuracy on test data. When you train a deeper neural net as in [1] consisting of a convolutional layer, pooling layer, and three fully connected feed-forward layers on the same data you obtain 91% accuracy on the same test set. What is the source of this improvement? Is the 5% increase in accuracy of the deep net over the shallow net because: a) the deep net has more parameters; b) the deep net can learn more complex functions given the same number of parameters; c) the deep net has better inductive bias and thus learns more interesting/useful functions (e.g., because the deep net is deeper it learns hierarchical representations [5]); d) nets without convolution can’t easily learn what nets with convolution can learn; e) current learning algorithms and regularization methods work better with deep architectures than shallow architectures[8]; f) all or some of the above; g) none of the above? There have been attempts to answer this question. It has been shown that deep nets coupled with unsupervised layer-by-layer pre-training [10] [19] work well. In [8], the authors show that depth combined with pre-training provides a good prior for model weights, thus improving generalization. There is well-known early theoretical work on the representational capacity of neural nets. For example, it was proved that a network with a large enough single hidden layer of sigmoid units can approximate any decision boundary [4]. Empirical work, however, shows that it is difficult to train shallow nets to be as accurate as deep nets. For vision tasks, a recent study on deep convolutional nets suggests that deeper models are preferred under a parameter budget [7]. In [5], the authors trained shallow nets on SIFT features to classify a large-scale ImageNet dataset and found that it was difficult to train large, high-accuracy, shallow nets. And in [17], the authors show that deeper models are more accurate than shallow models in speech acoustic modeling. In this paper we provide empirical evidence that shallow nets are capable of learning the same function as deep nets, and in some cases with the same number of parameters as the deep nets. We do this by first training a state-of-the-art deep model, and then training a shallow model to mimic the deep model. The mimic model is trained using the model compression method described in the next section. Remarkably, with model compression we are able to train shallow nets to be as accurate as some deep models, even though we are not able to train these shallow nets to be as accurate as the deep nets when the shallow nets are trained directly on the original labeled training data. If a shallow net with the same number of parameters as a deep net can learn to mimic a deep net with high fidelity, then it is clear that the function learned by that deep net does not really have to be deep. 1 2 Training Shallow Nets to Mimic Deep Nets 2.1 Model Compression The main idea behind model compression [3] is to train a compact model to approximate the function learned by a larger, more complex model. For example, in [3], a single neural net of modest size could be trained to mimic a much larger ensemble of models—although the small neural nets contained 1000 times fewer parameters, often they were just as accurate as the ensembles they were trained to mimic. Model compression works by passing unlabeled data through the large, accurate model to collect the scores produced by that model. This synthetically labeled data is then used to train the smaller mimic model. The mimic model is not trained on the original labels—it is trained to learn the function that was learned by the larger model. If the compressed model learns to mimic the large model perfectly it makes exactly the same predictions and mistakes as the complex model. Surprisingly, often it is not (yet) possible to train a small neural net on the original training data to be as accurate as the complex model, nor as accurate as the mimic model. Compression demonstrates that a small neural net could, in principle, learn the more accurate function, but current learning algorithms are unable to train a model with that accuracy from the original training data; instead, we must train the complex intermediate model first and then train the neural net to mimic it. Clearly, when it is possible to mimic the function learned by a complex model with a small net, the function learned by the complex model wasn’t truly too complex to be learned by a small net. This suggests to us that the complexity of a learned model, and the size and architecture of the representation best used to learn that model, are different things. 2.2 Mimic Learning via Regressing Logits with L2 Loss On both TIMIT and CIFAR-10 we use model compression to train shallow mimic nets using data labeled by either a deep net, or an ensemble of deep nets, trained on the original TIMIT or CIFAR-10 training data. The deep models are trained in the usual way using softmax output and cross-entropy cost function. The shallow mimic models, however, instead of being trained with cross-entropy on the 183 p values where pk = ezk/ P j ezj output by the softmax layer from the deep model, are trained directly on the 183 log probability values z, also called logits, before the softmax activation. Training on logits, which are logarithms of predicted probabilities, makes learning easier for the student model by placing equal emphasis on the relationships learned by the teacher model across all of the targets. For example, if the teacher predicts three targets with probability [2×10−9, 4× 10−5, 0.9999] and those probabilities are used as prediction targets and cross entropy is minimized, the student will focus on the third target and tend to ignore the first and second targets. A student, however, trained on the logits for these targets, [10, 20, 30], will better learn to mimic the detailed behaviour of the teacher model. Moreover, consider a second training case where the teacher predicts logits [−10, 0, 10]. After softmax, these logits yield the same predicted probabilities as [10, 20, 30], yet clearly the teacher models the two cases very differently. By training the student model directly on the logits, the student is better able to learn the internal model learned by the teacher, without suffering from the information loss that occurs from passing through logits to probability space. We formulate the SNN-MIMIC learning objective function as a regression problem given training data {(x(1), z(1)),...,(x(T ), z(T )) }: L(W, β) = 1 2T X t ||g(x(t); W, β) −z(t)||2 2, (1) where W is the weight matrix between input features x and hidden layer, β is the weights from hidden to output units, g(x(t); W, β) = βf(Wx(t)) is the model prediction on the tth training data point and f(·) is the non-linear activation of the hidden units. The parameters W and β are updated using standard error back-propagation algorithm and stochastic gradient descent with momentum. We have also experimented with other mimic loss functions, such as minimizing the KL divergence KL(pteacher∥pstudent) cost function and L2 loss on probabilities. Regression on logits outperforms all the other loss functions and is one of the key techniques for obtaining the results in the rest of this 2 paper. We found that normalizing the logits from the teacher model by subtracting the mean and dividing the standard deviation of each target across the training set can improve L2 loss slightly during training, but normalization is not crucial for obtaining good student mimic models. 2.3 Speeding-up Mimic Learning by Introducing a Linear Layer To match the number of parameters in a deep net, a shallow net has to have more non-linear hidden units in a single layer to produce a large weight matrix W. When training a large shallow neural network with many hidden units, we find it is very slow to learn the large number of parameters in the weight matrix between input and hidden layers of size O(HD), where D is input feature dimension and H is the number of hidden units. Because there are many highly correlated parameters in this large weight matrix, gradient descent converges slowly. We also notice that during learning, shallow nets spend most of the computation in the costly matrix multiplication of the input data vectors and large weight matrix. The shallow nets eventually learn accurate mimic functions, but training to convergence is very slow (multiple weeks) even with a GPU. We found that introducing a bottleneck linear layer with k linear hidden units between the input and the non-linear hidden layer sped up learning dramatically: we can factorize the weight matrix W ∈RH×D into the product of two low-rank matrices, U ∈RH×k and V ∈Rk×D, where k << D, H. The new cost function can be written as: L(U, V, β) = 1 2T X t ||βf(UV x(t)) −z(t)||2 2 (2) The weights U and V can be learnt by back-propagating through the linear layer. This reparameterization of weight matrix W not only increases the convergence rate of the shallow mimic nets, but also reduces memory space from O(HD) to O(k(H + D)). Factorizing weight matrices has been previously explored in [16] and [20]. While these prior works focus on using matrix factorization in the last output layer, our method is applied between the input and hidden layer to improve the convergence speed during training. The reduced memory usage enables us to train large shallow models that were previously infeasible due to excessive memory usage. Note that the linear bottleneck can only reduce the representational power of the network, and it can always be absorbed into a single weight matrix W. 3 TIMIT Phoneme Recognition The TIMIT speech corpus has 462 speakers in the training set, a separate development set for crossvalidation that includes 50 speakers, and a final test set with 24 speakers. The raw waveform audio data were pre-processed using 25ms Hamming window shifting by 10ms to extract Fouriertransform-based filter-banks with 40 coefficients (plus energy) distributed on a mel-scale, together with their first and second temporal derivatives. We included +/- 7 nearby frames to formulate the final 1845 dimension input vector. The data input features were normalized by subtracting the mean and dividing by the standard deviation on each dimension. All 61 phoneme labels are represented in tri-state, i.e., three states for each of the 61 phonemes, yielding target label vectors with 183 dimensions for training. At decoding time these are mapped to 39 classes as in [13] for scoring. 3.1 Deep Learning on TIMIT Deep learning was first successfully applied to speech recognition in [14]. Following their framework, we train two deep models on TIMIT, DNN and CNN. DNN is a deep neural net consisting of three fully connected feedforward hidden layers consisting of 2000 rectified linear units (ReLU) [15] per layer. CNN is a deep neural net consisting of a convolutional layer and max-pooling layer followed by three hidden layers containing 2000 ReLU units [2]. The CNN was trained using the same convolutional architecture as in [6]. We also formed an ensemble of nine CNN models, ECNN. The accuracy of DNN, CNN, and ECNN on the final test set are shown in Table 1. The error rate of the convolutional deep net (CNN) is about 2.1% better than the deep net (DNN). The table also shows the accuracy of shallow neural nets with 8000, 50,000, and 400,000 hidden units (SNN-8k, 3 SNN-50k, and SNN-400k) trained on the original training data. Despite having up to 10X as many parameters as DNN, CNN, and ECNN, the shallow models are 1.4% to 2% less accurate than the DNN, 3.5% to 4.1% less accurate than the CNN, and 4.5% to 5.1% less accurate than the ECNN. 3.2 Learning to Mimic an Ensemble of Deep Convolutional TIMIT Models The most accurate single model that we trained on TIMIT is the deep convolutional architecture in [6]. Because we have no unlabeled data from the TIMIT distribution, we use the same 1.1M points in the train set as unlabeled data for compression by throwing away the labels.1 Re-using the 1.1M train set reduces the accuracy of the student mimic models, increasing the gap between the teacher and mimic models on test data: model compression works best when the unlabeled set is very large, and when the unlabeled samples do not fall on train points where the teacher model is likely to have overfit. To reduce the impact of the gap caused by performing compression with the original train set, we train the student model to mimic a more accurate ensemble of deep convolutional models. We are able to train a more accurate model on TIMIT by forming an ensemble of nine deep, convolutional neural nets, each trained with somewhat different train sets, and with architectures of different kernel sizes in the convolutional layers. We used this very accurate model, ECNN, as the teacher model to label the data used to train the shallow mimic nets. As described in Section 2.2 the logits (log probability of the predicted values) from each CNN in the ECNN model are averaged and the average logits are used as final regression targets to train the mimic SNNs. We trained shallow mimic nets with 8k (SNN-MIMIC-8k) and 400k (SNN-MIMIC-400k) hidden units on the re-labeled 1.1M training points. As described in Section 2.3, to speed up learning both mimic models have 250 linear units between the input and non-linear hidden layer—preliminary experiments suggest that for TIMIT there is little benefit from using more than 250 linear units. 3.3 Compression Results For TIMIT Architecture # Param. # Hidden units PER SNN-8k 8k + dropout ∼12M ∼8k 23.1% trained on original data SNN-50k 50k + dropout ∼100M ∼50k 23.0% trained on original data SNN-400k 250L-400k + dropout ∼180M ∼400k 23.6% trained on original data DNN 2k-2k-2k + dropout ∼12M ∼6k 21.9% trained on original data CNN c-p-2k-2k-2k + dropout ∼13M ∼10k 19.5% trained on original data ECNN ensemble of 9 CNNs ∼125M ∼90k 18.5% SNN-MIMIC-8k 250L-8k ∼12M ∼8k 21.6% no convolution or pooling layers SNN-MIMIC-400k 250L-400k ∼180M ∼400k 20.0% no convolution or pooling layers Table 1: Comparison of shallow and deep models: phone error rate (PER) on TIMIT core test set. The bottom of Table 1 shows the accuracy of shallow mimic nets with 8000 ReLUs and 400,000 ReLUs (SNN-MIMIC-8k and -400k) trained with model compression to mimic the ECNN. Surprisingly, shallow nets are able to perform as well as their deep counterparts when trained with model compression to mimic a more accurate model. A neural net with one hidden layer (SNN-MIMIC8k) can be trained to perform as well as a DNN with a similar number of parameters. Furthermore, if we increase the number of hidden units in the shallow net from 8k to 400k (the largest we could 1That SNNs can be trained to be as accurate as DNNs using only the original training data highlights that it should be possible to train accurate SNNs on the original training data given better learning algorithms. 4 train), we see that a neural net with one hidden layer (SNN-MIMIC-400k) can be trained to perform comparably to a CNN, even though the SNN-MIMIC-400k net has no convolutional or pooling layers. This is interesting because it suggests that a large single hidden layer without a topology custom designed for the problem is able to reach the performance of a deep convolutional neural net that was carefully engineered with prior structure and weight-sharing without any increase in the number of training examples, even though the same architecture trained on the original data could not. 76 77 78 79 80 81 82 83 1 10 100 Accuracy on TIMIT Dev Set Number of Parameters (millions) ShallowNet DeepNet ShallowMimicNet Convolutional Net Ensemble of CNNs 75 76 77 78 79 80 81 82 1 10 100 Accuracy on TIMIT Test Set Number of Parameters (millions) ShallowNet DeepNet ShallowMimicNet Convolutional Net Ensemble of CNNs Figure 1: Accuracy of SNNs, DNNs, and Mimic SNNs vs. # of parameters on TIMIT Dev (left) and Test (right) sets. Accuracy of the CNN and target ECNN are shown as horizontal lines for reference. Figure 1 shows the accuracy of shallow nets and deep nets trained on the original TIMIT 1.1M data, and shallow mimic nets trained on the ECNN targets, as a function of the number of parameters in the models. The accuracy of the CNN and the teacher ECNN are shown as horizontal lines at the top of the figures. When the number of parameters is small (about 1 million), the SNN, DNN, and SNNMIMIC models all have similar accuracy. As the size of the hidden layers increases and the number of parameters increases, the accuracy of a shallow model trained on the original data begins to lag behind. The accuracy of the shallow mimic model, however, matches the accuracy of the DNN until about 4 million parameters, when the DNN begins to fall behind the mimic. The DNN asymptotes at around 10M parameters, while the shallow mimic continues to increase in accuracy. Eventually the mimic asymptotes at around 100M parameters to an accuracy comparable to that of the CNN. The shallow mimic never achieves the accuracy of the ECNN it is trying to mimic (because there is not enough unlabeled data), but it is able to match or exceed the accuracy of deep nets (DNNs) having the same number of parameters trained on the original data. 4 Object Recognition: CIFAR-10 To verify that the results on TIMIT generalize to other learning problems and task domains, we ran similar experiments on the CIFAR-10 Object Recognition Task[12]. CIFAR-10 consists of a set of natural images from 10 different object classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck. The dataset is a labeled subset of the 80 million tiny images dataset[18] and is divided into 50,000 train and 10,000 test images. Each image is 32x32 pixels in 3 color channels, yielding input vectors with 3072 dimensions. We prepared the data by subtracting the mean and dividing the standard deviation of each image vector to perform global contrast normalization. We then applied ZCA whitening to the normalized images. This pre-processing is the same used in [9]. 4.1 Learning to Mimic an Ensemble of Deep Convolutional CIFAR-10 Models We follow the same approach as with TIMIT: An ensemble of deep CNN models is used to label CIFAR-10 images for model compression. The logit predictions from this teacher model are used as regression targets to train a mimic shallow neural net (SNN). CIFAR-10 images have a higher dimension than TIMIT (3072 vs. 1845), but the size of the CIFAR-10 training set is only 50,000 compared to 1.1 million examples for TIMIT. Fortunately, unlike TIMIT, in CIFAR-10 we have access to unlabeled data from a similar distribution by using the superset of CIFAR-10: the 80 million tiny images dataset. We add the first one million images from the 80 million set to the original 50,000 CIFAR-10 training images to create a 1.05M mimic training (transfer) set. 5 Architecture # Param. # Hidden units Err. DNN 2000-2000 + dropout ∼10M 4k 57.8% SNN-30k 128c-p-1200L-30k ∼70M ∼190k 21.8% + dropout input&hidden single-layer 4000c-p ∼125M ∼3.7B 18.4% feature extraction followed by SVM CNN[11] 64c-p-64c-p-64c-p-16lc ∼10k ∼110k 15.6% (no augmentation) + dropout on lc CNN[21] 64c-p-64c-p-128c-p-fc ∼56k ∼120k 15.13% (no augmentation) + dropout on fc and stochastic pooling teacher CNN 128c-p-128c-p-128c-p-1kfc ∼35k ∼210k 12.0% (no augmentation) + dropout on fc and stochastic pooling ECNN ensemble of 4 CNNs ∼140k ∼840k 11.0% (no augmentation) SNN-CNN-MIMIC-30k 64c-p-1200L-30k ∼54M ∼110k 15.4% trained on a single CNN with no regularization SNN-CNN-MIMIC-30k 128c-p-1200L-30k ∼70M ∼190k 15.1% trained on a single CNN with no regularization SNN-ECNN-MIMIC-30k 128c-p-1200L-30k ∼70M ∼190k 14.2% trained on ensemble with no regularization Table 2: Comparison of shallow and deep models: classification error rate on CIFAR-10. Key: c, convolution layer; p, pooling layer; lc, locally connected layer; fc, fully connected layer CIFAR-10 images are raw pixels for objects viewed from many different angles and positions, whereas TIMIT features are human-designed filter-bank features. In preliminary experiments we observed that non-convolutional nets do not perform well on CIFAR-10, no matter what their depth. Instead of raw pixels, the authors in [5] trained their shallow models on the SIFT features. Similarly, [7] used a base convolution and pooling layer to study different deep architectures. We follow the approach in [7] to allow our shallow models to benefit from convolution while keeping the models as shallow as possible, and introduce a single layer of convolution and pooling in our shallow mimic models to act as a feature extractor to create invariance to small translations in the pixel domain. The SNN-MIMIC models for CIFAR-10 thus consist of a convolution and max pooling layer followed by fully connected 1200 linear units and 30k non-linear units. As before, the linear units are there only to speed learning; they do not increase the model’s representational power and can be absorbed into the weights in the non-linear layer after learning. Results on CIFAR-10 are consistent with those from TIMIT. Table 2 shows results for the shallow mimic models, and for much deeper convolutional nets. The shallow mimic net trained to mimic the teacher CNN (SNN-CNN-MIMIC-30k) achieves accuracy comparable to CNNs with multiple convolutional and pooling layers. And by training the shallow model to mimic the ensemble of CNNs (SNN-ECNN-MIMIC-30k), accuracy is improved an additional 0.9%. The mimic models are able to achieve accuracies previously unseen on CIFAR-10 with models with so few layers. Although the deep convolutional nets have more hidden units than the shallow mimic models, because of weight sharing, the deeper nets with multiple convolution layers have fewer parameters than the shallow fully connected mimic models. Still, it is surprising to see how accurate the shallow mimic models are, and that their performance continues to improve as the performance of the teacher model improves (see further discussion of this in Section 5.2). 5 Discussion 5.1 Why Mimic Models Can Be More Accurate than Training on Original Labels It may be surprising that models trained on targets predicted by other models can be more accurate than models trained on the original labels. There are a variety of reasons why this can happen: 6 • If some labels have errors, the teacher model may eliminate some of these errors (i.e., censor the data), thus making learning easier for the student. • Similarly, if there are complex regions in p(y|X) that are difficult to learn given the features and sample density, the teacher may provide simpler, soft labels to the student. Complexity can be washed away by filtering targets through the teacher model. • Learning from the original hard 0/1 labels can be more difficult than learning from a teacher’s conditional probabilities: on TIMIT only one of 183 outputs is non-zero on each training case, but the mimic model sees non-zero targets for most outputs on most training cases, and the teacher can spread uncertainty over multiple outputs for difficult cases. The uncertainty from the teacher model is more informative to the student model than the original 0/1 labels. This benefit is further enhanced by training on logits. • The original targets may depend in part on features not available as inputs for learning, but the student model sees targets that depend only on the input features; the targets from the teacher model are a function only of the available inputs; the dependence on unavailable features has been eliminated by filtering targets through the teacher model. 74 74.5 75 75.5 76 76.5 77 77.5 0 2 4 6 8 10 12 14 Phone Recognition Accuracy Number of Epochs SNN-8k SNN-8k + dropout SNN-Mimic-8k Figure 2: Shallow mimic tends not to overfit. The mechanisms above can be seen as forms of regularization that help prevent overfitting in the student model. Typically, shallow models trained on the original targets are more prone to overfitting than deep models—they begin to overfit before learning the accurate functions learned by deeper models even with dropout (see Figure 2). If we had more effective regularization methods for shallow models, some of the performance gap between shallow and deep models might disappear. Model compression appears to be a form of regularization that is effective at reducing this gap. 5.2 The Capacity and Representational Power of Shallow Models 78 79 80 81 82 83 78 79 80 81 82 83 Accuracy of Mimic Model on Dev Set Accuracy of Teacher Model on Dev Set Mimic with 8k Non-Linear Units Mimic with 160k Non-Linear Units y=x (no student-teacher gap) Figure 3: Accuracy of student models continues to improve as accuracy of teacher models improves. Figure 3 shows results of an experiment with TIMIT where we trained shallow mimic models of two sizes (SNN-MIMIC-8k and SNNMIMIC-160k) on teacher models of different accuracies. The two shallow mimic models are trained on the same number of data points. The only difference between them is the size of the hidden layer. The x-axis shows the accuracy of the teacher model, and the y-axis is the accuracy of the mimic models. Lines parallel to the diagonal suggest that increases in the accuracy of the teacher models yield similar increases in the accuracy of the mimic models. Although the data does not fall perfectly on a diagonal, there is strong evidence that the accuracy of the mimic models continues to increase as the accuracy of the teacher model improves, suggesting that the mimic models are not (yet) running out of capacity. When training on the same targets, SNN-MIMIC-8k always perform worse than SNN-MIMIC-160K that has 10 times more parameters. Although there is a consistent performance gap between the two models due to the difference in size, the smaller shallow model was eventually able to achieve a performance comparable to the larger shallow net by learning from a better teacher, and the accuracy of both models continues to increase as teacher accuracy increases. This suggests that shallow models with a number of parameters comparable to deep models probably are capable of learning even more accurate functions 7 if a more accurate teacher and/or more unlabeled data become available. Similarly, on CIFAR-10 we saw that increasing the accuracy of the teacher model by forming an ensemble of deep CNNs yielded commensurate increase in the accuracy of the student model. We see little evidence that shallow models have limited capacity or representational power. Instead, the main limitation appears to be the learning and regularization procedures used to train the shallow models. 5.3 Parallel Distributed Processing vs. Deep Sequential Processing Our results show that shallow nets can be competitive with deep models on speech and vision tasks. In our experiments the deep models usually required 8–12 hours to train on Nvidia GTX 580 GPUs to reach the state-of-the-art performance on TIMIT and CIFAR-10 datasets. Interestingly, although some of the shallow mimic models have more parameters than the deep models, the shallow models train much faster and reach similar accuracies in only 1–2 hours. Also, given parallel computational resources, at run-time shallow models can finish computation in 2 or 3 cycles for a given input, whereas a deep architecture has to make sequential inference through each of its layers, expending a number of cycles proportional to the depth of the model. This benefit can be important in on-line inference settings where data parallelization is not as easy to achieve as it is in the batch inference setting. For real-time applications such as surveillance or real-time speech translation, a model that responds in fewer cycles can be beneficial. 6 Future Work The tiny images dataset contains 80 millions images. We are currently investigating whether, if by labeling these 80M images with a teacher, it is possible to train shallow models with no convolutional or pooling layers to mimic deep convolutional models. This paper focused on training the shallowest-possible models to mimic deep models in order to better understand the importance of model depth in learning. As suggested in Section 5.3, there are practical applications of this work as well: student models of small-to-medium size and depth can be trained to mimic very large, high-accuracy deep models, and ensembles of deep models, thus yielding better accuracy with reduced runtime cost than is currently achievable without model compression. This approach allows one to adjust flexibly the trade-off between accuracy and computational cost. In this paper we are able to demonstrate empirically that shallow models can, at least in principle, learn more accurate functions without a large increase in the number of parameters. The algorithm we use to do this—training the shallow model to mimic a more accurate deep model, however, is awkward. It depends on the availability of either a large unlabeled dataset (to reduce the gap between teacher and mimic model) or a teacher model of very high accuracy, or both. Developing algorithms to train shallow models of high accuracy directly from the original data without going through the intermediate teacher model would, if possible, be a significant contribution. 7 Conclusions We demonstrate empirically that shallow neural nets can be trained to achieve performances previously achievable only by deep models on the TIMIT phoneme recognition and CIFAR-10 image recognition tasks. Single-layer fully connected feedforward nets trained to mimic deep models can perform similarly to well-engineered complex deep convolutional architectures. The results suggest that the strength of deep learning may arise in part from a good match between deep architectures and current training procedures, and that it may be possible to devise better learning algorithms to train more accurate shallow feed-forward nets. For a given number of parameters, depth may make learning easier, but may not always be essential. Acknowledgements We thank Li Deng for generous help with TIMIT, Li Deng and Ossama AbdelHamid for the code for their deep convolutional TIMIT model, Chris Burges, Li Deng, Ran GiladBachrach, Tapas Kanungo and John Platt for discussion that significantly improved this work, David Johnson for help with the speech model, and Mike Aultman for help with the GPU cluster. 8 References [1] Ossama Abdel-Hamid, Abdel-rahman Mohamed, Hui Jiang, and Gerald Penn. Applying convolutional neural networks concepts to hybrid nn-hmm model for speech recognition. In Acoustics, Speech and Signal Processing (ICASSP), 2012 IEEE International Conference on, pages 4277–4280. IEEE, 2012. [2] Ossama Abdel-Hamid, Li Deng, and Dong Yu. Exploring convolutional neural network structures and optimization techniques for speech recognition. Interspeech 2013, 2013. [3] Cristian Bucilu, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 535–541. ACM, 2006. [4] George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems, 2(4):303–314, 1989. [5] Yann N Dauphin and Yoshua Bengio. Big neural networks waste capacity. arXiv preprint arXiv:1301.3583, 2013. [6] Li Deng, Jinyu Li, Jui-Ting Huang, Kaisheng Yao, Dong Yu, Frank Seide, Michael Seltzer, Geoff Zweig, Xiaodong He, Jason Williams, et al. Recent advances in deep learning for speech research at Microsoft. ICASSP 2013, 2013. [7] David Eigen, Jason Rolfe, Rob Fergus, and Yann LeCun. Understanding deep architectures using a recursive convolutional network. arXiv preprint arXiv:1312.1847, 2013. [8] Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? The Journal of Machine Learning Research, 11:625–660, 2010. [9] Ian Goodfellow, David Warde-Farley, Mehdi Mirza, Aaron Courville, and Yoshua Bengio. Maxout networks. In Proceedings of The 30th International Conference on Machine Learning, pages 1319–1327, 2013. [10] G.E. Hinton and R.R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006. [11] G.E. Hinton, N. Srivastava, A. Krizhevsky, I. Sutskever, and R.R. Salakhutdinov. Improving neural networks by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580, 2012. [12] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Computer Science Department, University of Toronto, Tech. Rep, 2009. [13] K.F. Lee and H.W. Hon. Speaker-independent phone recognition using hidden markov models. Acoustics, Speech and Signal Processing, IEEE Transactions on, 37(11):1641–1648, 1989. [14] Abdel-rahman Mohamed, George E Dahl, and Geoffrey Hinton. Acoustic modeling using deep belief networks. Audio, Speech, and Language Processing, IEEE Transactions on, 20(1):14–22, 2012. [15] V. Nair and G.E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proc. 27th International Conference on Machine Learning, pages 807–814. Omnipress Madison, WI, 2010. [16] Tara N Sainath, Brian Kingsbury, Vikas Sindhwani, Ebru Arisoy, and Bhuvana Ramabhadran. Low-rank matrix factorization for deep neural network training with high-dimensional output targets. In Acoustics, Speech and Signal Processing (ICASSP), 2013 IEEE International Conference on, pages 6655–6659. IEEE, 2013. [17] Frank Seide, Gang Li, and Dong Yu. Conversational speech transcription using context-dependent deep neural networks. In Interspeech, pages 437–440, 2011. [18] Antonio Torralba, Robert Fergus, and William T Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 30(11):1958–1970, 2008. [19] P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, and P.A. Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. The Journal of Machine Learning Research, 11:3371–3408, 2010. [20] Jian Xue, Jinyu Li, and Yifan Gong. Restructuring of deep neural network acoustic models with singular value decomposition. Proc. Interspeech, Lyon, France, 2013. [21] Matthew D. Zeiler and Rob Fergus. Stochastic pooling for regularization of deep convolutional neural networks. arXiv preprint arXiv:1301.3557, 2013. 9
2014
380
5,492
A Unified Semantic Embedding: Relating Taxonomies and Attributes Sung Ju Hwang∗ Disney Research Pittsburgh, PA sungju.hwang@disneyresearch.com Leonid Sigal Disney Research Pittsburgh, PA lsigal@disneyresearch.com Abstract We propose a method that learns a discriminative yet semantic space for object categorization, where we also embed auxiliary semantic entities such as supercategories and attributes. Contrary to prior work, which only utilized them as side information, we explicitly embed these semantic entities into the same space where we embed categories, which enables us to represent a category as their linear combination. By exploiting such a unified model for semantics, we enforce each category to be generated as a supercategory + a sparse combination of attributes, with an additional exclusive regularization to learn discriminative composition. The proposed reconstructive regularization guides the discriminative learning process to learn a model with better generalization. This model also generates compact semantic description of each category, which enhances interoperability and enables humans to analyze what has been learned. 1 Introduction Object categorization is a challenging problem that requires drawing boundaries between groups of objects in a seemingly continuous space. Semantic approaches have gained a lot of attention recently as object categorization became more focused on large-scale and fine-grained recognition tasks and datasets. Attributes [1, 2, 3, 4] and semantic taxonomies [5, 6, 7, 8] are two popular semantic sources which impose certain relations between the category models, including a more recently introduced analogies [9] that induce even higher-order relations between them. While many techniques have been introduced to utilize each of the individual semantic sources for object categorization, no unified model has been proposed to relate them. We propose a unified semantic model where we can learn to place categories, supercategories, and attributes as points (or vectors) in a hypothetical common semantic space, and taxonomies provide specific topological relationships between these semantic entities. Further, we propose a discriminative learning framework, based on dictionary learning and large margin embedding, to learn each of these semantic entities to be well separated and pseudo-orthogonal, such that we can use them to improve visual recognition tasks such as category or attribute recognition. However, having semantic entities embedded into a common space is not enough to utilize the vast number of relations that exist between the semantic entities. Thus, we impose a graph-based regularization between the semantic embeddings, such that each semantic embedding is regularized by sparse combination of auxiliary semantic embeddings. This additional requirement imposed on the discriminative learning model would guide the learning such that we obtain not just the optimal model for class discrimination, but to learn a semantically plausible model which has a potential to be more robust and human-interpretable; we call this model Unified Semantic Embedding (USE). ∗Now at Ulsan National Institute of Science and Technology in Ulsan, South Korea 1 Figure 1: Concept: We regularize each category to be represented by its supercategory + a sparse combination of attributes, where the regularization parameters are learned. The resulting embedding model improves the generalization ability by the specific relations between the semantic entities, and also is able to compactly represent a novel category in this manner. For example, given a novel category tiger, our model can describe it as a striped feline. The observation we make to draw the relation between the categories and attributes, is that a category can be represented as the sum of its supercategory + the category-specific modifier, which in many cases can be represented by a combination of attributes. Further, we want the representation to be compact. Instead of describing a dalmatian as a domestic animal with a lean body, four legs, a long tail, and spots, it is more efficient to say it is a spotted dog (Figure 1). It is also more exact since the higher-level category dog contains all general properties of different dog breeds, including indescribable dog-specific properties, such as the shape of the head, and its posture. This exemplifies how a human would describe an object, to efficiently communicate and understand the concept. Such decomposition of a category into attributes+supercategory can hold for categories at any level. For example, supercategory feline can be described as a stalking carnivore. With the addition of this new generative objective, our goal is to learn a discriminative model that can be compactly represented as a combination of semantic entities, which helps learn a model that is semantically more reasonable. We want to balance between these two discriminative and generative objectives when learning a model for each object category. For object categories that have scarce training examples, we can put more weight on the generative part of the model. Contributions: Our contributions are threefold: (1) We show a multitask learning formulation for object categorization that learns a unified semantic space for supercategories and attributes, while drawing relations between them. (2) We propose a novel sparse-coding based regularization that enforces the object category representation to be reconstructed as the sum of a supercategory and a sparse combination of attributes. (3) We show from the experiments that the generative learning with the sparse-coding based regularization helps improve object categorization performance, especially in the one or few-shot learning case, by generating semantically plausible predictions. 2 Related Work Semantic methods for object recognition. For many years, vision researchers have sought to exploit external semantic knowledge about the object to incorporate semantics into learning of the model. Taxonomies, or class hierarchies were the first to be explored by vision researchers [5, 6], and were mostly used to efficiently rule out irrelevant category hypotheses leveraging class hierarchical structure [8, 10]. Attributes are visual or semantic properties of an object that are common across multiple categories, mostly regarded as describable mid-level representations. They have been used to directly infer categories [1, 2], or as additional supervision to aid the main categorization problem in the multitask learning framework [3]. While many methods have been proposed to leverage either of these two popular types of semantic knowledge, little work has been done to relate the two, which our paper aims to address. Discriminative embedding for object categorization. Since the conventional kernel-based multiclass SVM does not scale due to its memory and computational requirements for today’s large-scale classification tasks, embedding-based methods have gained recent popularity. Embedding-based methods perform classification on a low dimensional shared space optimized for class discrimination. Most methods learn two linear projections, for data instances and class labels, to a common lower-dimensional space optimized by ranking loss. Bengio et al. [10] solves the problem using stochastic gradient, and also provides a way to learn a tree structure which enables one to efficiently predict the class label at the test time. Mensink et al. [11] eliminated the need of class embedding by replacing them with the class mean, which enabled generalization to new classes at near zero cost. There are also efforts in incorporating semantic information into the learned embedding space. Weinberger et al. [7] used the taxonomies to preserve the inter-class similarities in the learned space, 2 in terms of distance. Akata et al. [4] used attributes and taxonomy information as labels, replacing the conventional unit-vector based class representation with more structured labels to improve on zero-shot performance. One most recent work in this direction is DEVISE [12], which learns embeddings that maximize the ranking loss, as an additional layer on top of the deep network for both images and labels. However, these models impose structure only on the output space, and structure on the learned space is not explicitly enforced, which is our goal. Recently, Hwang et al. [9] introduced one such model, which regularizes the category quadruplets, that form an analogy, to form a parallelogram. Our goal is similar, but we explore a more general compositional relationship, which we learn without any manual supervision. Multitask learning. Our work can be viewed as a multitask learning method, since we relate each model for different semantic entities by learning both the joint semantic space and enforcing geometric constraints between them. Perhaps the most similar work is [13], where the parameter of each model is regularized while fixing the parameter for its parent-level models. We use similar strategy but instead of enforcing sharing between the models, we simply learn each model to be close to its approximation obtained using higher-level (more abstract) concepts. Sparse coding. Our method to approximate each category embedding as a sum of its direct supercategory plus a sparse combination of attributes, is similar to the objective of sparse coding. One work that is specifically relevant to ours is Mairal et al. [14], where the learning objective is to reduce both the classification and reconstruction error, given class labels. In our model, however, the dictionary atoms are also discriminatively learned with supervision, and are assembled to be a semantically meaningful combination of a supercategory + attributes, while [14] learns the dictionary atoms in an unsupervised way. 3 Approach We now explain our unified semantic embedding model, which learns a discriminative common low-dimensional space to embed both the images and semantic concepts including object categories, while enforcing relationships between them using semantic reconstruction. Suppose that we have a d-dimensional image descriptor and m-dimensional vector describing labels associated with the instances, including category labels at different semantic granularities and attributes. Our goal then is to embed both images and the labels onto a single unified semantic space, where the images are associated with their corresponding semantic labels. To formally state the problem, given a training set D that has N labeled examples, i.e. D = {xi, yi}N i=1, where xi ∈Rd denotes image descriptors and yi ∈{1, . . . , m} are their labels associated with m unique concepts, we want to embed each xi as zi, and each label yi as uyi in the de-dimensional space, such that the similarity between zi and uyi, S(zi, uyi) is maximized. One way to solve the above problem is to use regression, using S(zi, uyi) = −∥zi −uyi∥2 2. That is, we estimate the data embedding zi as zi = W xi, and minimize their distances to the correct label embeddings uyi ∈Rm where the dimension for yi is set to 1 and every other dimension is set to 0: min W m X c=1 N X i=1 ∥W xi −uyi∥2 2 + λ∥W ∥2 F . (1) The above ridge regression will project each instance close to its correct embedding. However, it does not guarantee that the resulting embeddings are well separated. Therefore, most embedding methods for categorization add in discriminative constraints which ensure that the projected instances have higher similarity to their own category embedding than to others. One way to enforce this is to use large-margin constraints on distance: ∥W xi−uyi∥2 2+1 ≤∥W xi−uc∥2 2+ξic, yi ̸= c which can be translated into to the following discriminative loss: LC(W , U, xi, yi) = X c [1 + ∥W xi −uyi∥2 2 −∥W xi −uc∥2 2]+, ∀c ̸= yi, (2) where U is the columwise concatenation of each label embedding vector, such that uj denotes jth column of U. After replacing the generative loss in the ridge regression formula with the discriminative loss, we get the following discriminative learning problem: min W ,U N X i LC(W , U, xi, yi) + λ∥W ∥2 F + λ∥U∥2 F , yi ∈{1, . . . , m}, (3) 3 where λ regularizes W and U from shooting to infinity. This is one of the most common objective used for learning discriminative category embeddings for multi-class classification [10, 7], while ranking loss-based [15] models have been also explored for LC. Bilinear model on a single variable W has been also used in Akata et al. [4], which uses structured labels (attributes) as uyi. 3.1 Embedding auxiliary semantic entities. Now we describe how we embed the supercategories and attributes onto the learned shared space. Supercategories. While our objective is to better categorize entry level categories, categories in general can appear at different semantic granularities. For example, a zebra could be both an equus, and an odd-toed ungulate. To learn the embeddings for the supercategories, we map each data instance to be closer to its correct supercategory embedding than to its siblings: ∥W xi−us∥2 2+1 ≤ ∥W xi −uc∥2 2 + ξsc, ∀s ∈Pyi and c ∈Ss where Pyi denotes the set of superclasses at all levels for class s, and Ss is the set of its siblings. The constraints can be translated into the following loss term: LS(W , U, xi, yi) = X s∈Pyi X c∈Ss [1 + ∥W xi −us∥2 2 −∥W xi −uc∥2 2]+. (4) Attributes. Attributes can be considered normalized basis vectors for the semantic space, whose combination represents a category. Basically, we want to maximize the correlation between the projected instance that possess the attribute, and its correct attribute embedding, as follows: LA(W , U, xi, yi) = 1 − X a (W xi)Tya i ua, ∥ua∥2 ≤1, ya i ∈{0, 1}, ∀a ∈Ayi, (5) where Ac is the set of all attributes for class c and ua is an embedding vector for an attribute a. 3.2 Relationship between the categories, supercategories, and attributes Simply summing up all previously defined loss functions while adding {us} and {ua} as additional columns of U will result in a multi-task formulation that implicitly associate the semantic entities, through the shared data embedding W . However, we want to further utilize the relationships between the semantic entities, to explicitly impose structural regularization on the semantic embeddings U. One simple and intuitive relation is that an object class can be represented as the combination of its parent level category plus a sparse combination of attributes, which translates into the following constraint: uc = up + U Aβc, c ∈Cp, ∥βc∥0 ⪯γ1, βc ⪰0, ∀c ∈{1, . . . , C}, (6) where U A is the aggregation of all attribute embeddings {ua}, Cp is the set of children classes for class p, γ1 is the sparsity parameter, and C is the number of categories. We require β to be nonnegative, since it makes more sense and more efficient to describe an object with attributes that it might have, rather than describing it by attributes that it might not have. We rewrite Eq. 7 into a regularization term as follows, replacing the ℓ0-norm constraints with ℓ1norm regularizations for tractable optimization: R(U, B) = C X c ∥uc −up −U Aβc∥2 2 + γ2∥βc + βo∥2 2, c ∈Cp, o ∈Pc ∪Sc, 0 ⪯βc ⪯γ1, ∀c ∈{1, . . . , C}, (7) where B is the matrix whose jth column vector βj is the reconstruction weight for class j, Sc is the set of all sibling classes for class c, and γ2 is the parameters to enforce exclusivity. The exclusive regularization term is used to prevent the semantic reconstruction βc for class c from fitting to the same attributes fitted by its parents and siblings. This is because attributes common across parent and child, and between siblings, are less discriminative. This regularization is especially useful for discrimination between siblings, which belong to the same superclass and only differ by the category-specific modifier. By generating unique semantic decomposition for each class, we can better discriminate between any two categories using a semantic combination of discriminatively learned auxiliary entities. 4 With the sparsity regularization enforced by γ1, the simple sum of the two weights will prevent the two (super)categories from having high weight for a single attribute, which will let each category embedding to fit to exclusive attribute set. This, in fact, is the exclusive lasso regularizer introduced in [16], except for the nonnegativity constraint on βc, which makes the problem easier to solve. 3.3 Unified semantic embeddings for object categorization After augmenting the categorization objective in Eq. 3 with the superclass and attributes loss and the sparse-coding based regularization in Eq. 7, we obtain the following multitask learning formulation that jointly learns all the semantic entities along with the sparse-coding based regularization: min W ,U,B N X i=1 LC(W , U, xi, yi) + µ1 (LS(W , U, xi, yi) + LA(W , U, xi, yi)) + µ2R(U, B); ∥wj∥2 2 ≤λ, ∥uk∥2 2 ≤λ, 0 ⪯βc ⪯γ1∀j ∈{1, . . . , d}, ∀k ∈{1, . . . , m}, ∀c ∈{1, . . . , C + S}, (8) where S is the number of supercategories, wj is W ’s jth column, and µ1 and µ2 are parameters to balance between the main and auxiliary tasks, and discriminative and generative objective. Eq. 8 could be also used for knowledge transfer when learning a model for a novel set of categories, by replacing U A in R(U, B) with U S, learned on class set S to transfer the knowledge from. 3.4 Numerical optimization Eq. 8 is not jointly convex in all variables, and has both discriminative and generative terms. This problem is similar to the problem in [14], where the objective is to learn the dictionary, sparse coefficients, and classifier parameters together, and can be optimized using a similar alternating optimization, while each subproblem differs. We first describe how we optimize for each variable. Learning of W and U. The optimization of both embedding models are similar, except for the reconstructive regularization on U. and the main bottleneck lies in the minimization of the O(Nm) large-margin losses. Since the losses are non-differentiable, we solve the problems using stochastic subgradient method. Specifically, we implement the proximal gradient algorithm in [17], handling the ℓ-2 norm constraints with proximal operators. Learning B. This is similar to the sparse coding problem, but simpler. We use projected gradient method, where at each iteration t, we project the solution of the objective β t+ 1 2 c for category c to ℓ-1 norm ball and nonnegative orthant, to obtain βt c that satisfies the constraints. Alternating optimization. We decompose Eq. 8 to two convex problems: 1) Optimization of the data embedding W and approximation parameter B (Since the two variable do not have direct link between them) , and 2) Optimization of the category embedding U. We alternate the process of optimizing each of the convex problems while fixing the remaining variables, until the convergence criterion 1 is met, or the maximum number of iteration is reached. Run-time complexity. Training: Optimization of W and U using proximal stochastic gradient [17], have time complexities of O(ded(k + 1)) and O(de(dk + C)) respectively. Both terms are dominated by the gradient computation for k(k ≪N) sampled constraints, that is O(dedk). Outer loop for alternation converges within 5-10 iterations depending on ϵ. Test: Test time complexity is exactly the same as in LME, which is O(de(C + d)). 4 Results We validate our method for multiclass categorization performance on two different datasets generated from a public image collection, and also test for knowledge transfer on few-shot learning. 4.1 Datasets We use Animals with Attributes dataset [1], which consists of 30, 475 images of 50 animal classes, with 85 class-level attributes 2. We use the Wordnet hierarchy to generate supercategories. Since 1∥W t+1 −W t∥2 + ∥U t+1 −U t∥2 + ∥Bt+1 −Bt∥2 < ϵ 2Attributes are defined on color (black, orange), texture (stripes, spots), parts (longneck, hooves), and other high-level behavioral properties (slow, hibernate, domestic) of the animals 5 there is no fixed training/test split, we use {30,30,30} random split for training/validation/test. We generate the following two datasets using the provided features. 1) AWA-PCA: We compose a 300dimensional feature vectors by performing PCA on each of 6 types of features provided, including SIFT, rgSIFT, SURF, HoG, LSS, and CQ to have 50 dimensions per each feature type, and concatenating them. 2) AWA-DeCAF: For the second dataset, we use the provided 4096-D DeCAF features [18] obtained from the layer just before the output layer of a deep convolutional neural network. 4.2 Baselines We compare our proposed method against multiple existing embedding-based categorization approaches, that either do not use any semantic information, or use semantic information but do not explicitly embed semantic entities. For non-semantics baselines, we use the following: 1)Ridge Regression: A linear regression with ℓ-2 norm (Eq. 1). 2) NCM: Nearest mean classifier from [11], which uses the class mean as category embeddings (uc = xµ c ). We use the code provided by the authors3. 3) LME: A base large-margin embedding (Eq. 3) solved using alternating optimization. For implicit semantic baselines, we consider two different methods. 4) LMTE: Our implementation of the Weinberger et al. [7], which enforces the semantic similarity between class embeddings as distance constraints [7], where U is regularized to preserve the pairwise class similarities from a given taxonomy. 5-7) ALE, HLE, AHLE: Our implementation of the attribute label embedding in Akata et al. [4], which encodes the semantic information by representing each class with structured labels that indicate the class’ association with superclasses and attributes. We implement variants that use attributes (ALE), leaf level + superclass labels (HLE), and both (AHLE) labels. For our models, we implement multiple variants to analyze the impact of each semantic entity and the proposed regularization. 1) LME-MTL-S: The multitask semantic embedding model learned with supercategories. 2) LME-MTL-A: The multitask embedding model learned with attributes. 3) USE-No Reg.: The unified semantic embedding model learned using both attributes and supercategories, without semantic regularization. 4) USE-Reg: USE with the sparse coding regularization. For parameters, the projection dimension de = 50 for all our models. 4 For other parameters, we find the optimal value by cross-validation on the validation set. We set µ1 = 1 that balances the main and auxiliary task equally, and search for µ2 for discriminative/generative tradeoff, in the range of {0.01, 0.1, 0.2 . . . , 1, 10}, and set ℓ-2 norm regularization parameter λ = 1. For sparsity parameter γ1, we set it to select on average several (3 or 4) attributes per class, and for disjoint parameter γ2, we use 10γ1, without tuning for performance. Flat hit @ k (%) Hierarchical precision @ k (%) Method 1 2 5 2 5 No semantics Ridge Regression 19.31 ± 1.15 28.34 ± 1.53 44.17 ± 2.33 28.95 ± 0.54 39.39 ± 0.17 NCM [11] 18.93 ± 1.71 29.75 ± 0.92 47.33 ± 1.60 30.81 ± 0.53 43.43 ± 0.53 LME 19.87 ± 1.56 30.47 ± 1.56 48.07 ± 1.06 30.98 ± 0.62 42.63 ± 0.56 Implicit semantics LMTE [7] 20.76 ± 1.64 30.71 ± 1.35 47.76 ± 2.25 31.05 ± 0.71 43.13 ± 0.29 ALE [4] 15.72 ± 1.14 25.63 ± 1.44 43.42 ± 1.67 29.26 ± 0.50 43.71 ± 0.34 HLE [4] 17.09 ± 1.09 27.52 ± 1.20 45.49 ± 0.61 30.51 ± 0.48 44.76 ± 0.20 AHLE [4] 16.65 ± 0.47 26.55 ± 0.77 43.05 ± 1.22 29.49 ± 0.89 43.41 ± 0.65 Explicit semantics LME-MTL-S 20.77 ± 1.41 32.09 ± 1.67 50.94 ± 1.21 33.71 ± 0.94 45.73 ± 0.71 LME-MTL-A 20.65 ± 0.83 31.51 ± 0.72 49.40 ± 0.62 31.69 ± 0.49 43.47 ± 0.23 USE USE-No Reg. 21.07 ± 1.53 31.59 ± 1.57 50.11 ± 1.51 33.67 ± 0.55 45.41 ± 0.43 USE-Reg. 21.64 ± 1.02 32.69 ± 0.83 52.04 ± 1.02 33.37 ± 0.74 47.17 ± 0.91 Table 1: Multiclass classification performance on AWA-PCA dataset (300-D PCA features). 4.3 Multiclass categorization We first evaluate the suggested multitask learning framework for categorization performance. We report the average classification performance and standard error over 5 random training/test splits in Table 1 and 2, using both flat hit@k, which is the accuracy for the top-k predictions made, and hierarchical precision@k from [12], which is a precision the given label is correct at k, at all levels. Non-semantic baselines, ridge regression and NCM, were outperformed by our most basic LME model. For implicit semantic baselines, ALE-variants underperformed even the ridge regression 3http://staff.science.uva.nl/˜tmensink/code.php 4Except for ALE variants where de=m, the number of semantic entities. 6 Flat hit @ k (%) Hierarchical precision @ k (%) Method 1 2 5 2 5 No semantics Ridge Regression 38.39 ± 1.48 48.61 ± 1.29 62.12 ± 1.20 38.51 ± 0.61 41.73 ± 0.54 NCM [11] 43.49 ± 1.23 57.45 ± 0.91 75.48 ± 0.58 45.25 ± 0.52 50.32 ± 0.47 LME 44.76 ± 1.77 58.08 ± 2.05 75.11 ± 1.48 44.84 ± 0.98 49.87 ± 0.39 Implicit semantics LMTE [7] 38.92 ± 1.12 49.97 ± 1.16 63.35 ± 1.38 38.67 ± 0.46 41.72 ± 0.45 ALE [4] 36.40 ± 1.03 50.43 ± 1.92 70.25 ± 1.97 42.52 ± 1.17 52.46 ± 0.37 HLE [4] 33.56 ± 1.64 45.93 ± 2.56 64.66 ± 1.77 46.11 ± 2.65 56.79 ± 2.05 AHLE [4] 38.01 ± 1.69 52.07 ± 1.19 71.53 ± 1.41 44.43 ± 0.66 54.39 ± 0.55 Explicit semantics LME-MTL-S 45.03 ± 1.32 57.73 ± 1.75 74.43 ± 1.26 46.05 ± 0.89 51.08 ± 0.36 LME-MTL-A 45.55 ± 1.71 58.60 ± 1.76 74.97 ± 1.15 44.23 ± 0.95 48.52 ± 0.29 USE USE-No Reg. 45.93 ± 1.76 59.37 ± 1.32 74.97 ± 1.15 47.13 ± 0.62 51.04 ± 0.46 USE-Reg. 46.42 ± 1.33 59.54 ± 0.73 76.62 ± 1.45 47.39 ± 0.82 53.35 ± 0.30 Table 2: Multiclass classification performance on AWA-DeCAF dataset (4096-D DeCAF features). baseline with regard to the top-1 classification accuracy 5, while they improve upon the top-2 recognition accuracy and hierarchical precision. This shows that hard-encoding structures in the label space do not necessarily improve the discrimination performance, while it helps to learn a more semantic space. LMTE makes substantial improvement on 300-D features, but not on DeCAF features. Explicit embedding of semantic entities using our method improved both the top-1 accuracy and the hierarchical precision, with USE variants achieving the best performance in both. Specifically, adding superclass embeddings as auxiliary entities improves the hierarchical precision, while using attributes improves the flat top-k classification accuracy. USE-Reg, especially, made substantial improvements on flat hit and hierarchical precision @ 5, which shows the proposed regularization’s effectiveness in learning a semantic space that also discriminates well. Category Ground-truth attributes Supercategory + learned attributes Otter An animal that swims, fish, water, new world, small, flippers, furry, black, brown, tail, ... A musteline mammal that is quadrapedal, flippers, furry, ocean Skunk An animal that is smelly, black, stripes, white, tail, furry, ground, quadrapedal, new world, walks, ... A musteline mammal that has stripes Deer An animal that is brown, fast, horns, grazer, forest, quadrapedal, vegetation, timid, hooves, walks, ... A deer that has spots, nestspot, longneck, yellow, hooves Moose An animal that has horns, brown, big, quadrapedal, new world, vegetation, grazer, hooves, strong, ground,.. . A deer that is arctic, stripes, black Equine N/A An odd-toed ungulate, that is lean and active Primate N/A An animal, that has hands and bipedal Table 3: Semantic description generated using ground truth attributes labels and learned semantic decomposition of each categorys. For ground truth labels, we show top-10 ranked by their human-ranked relevance. For our method, we rank the attributes by their learned weights. Incorrect attributes are colored in red. 4.3.1 Qualitative analysis Besides learning a space that is both discriminative and generalizes well, our method’s main advantage, over existing methods, is its ability to generate compact, semantic descriptions for each category it has learned. This is a great caveat, since in most models, including the state-of-the art deep convolutional networks, humans cannot understand what has been learned; by generating human-understandable explanation, our model can communicate with the human, allowing understanding of the rationale behind the categorization decisions, and to possibly allow feedback for correction. To show the effectiveness of using supercategory+attributes in the description, we report the learned reconstruction for our model, compared against the description generated by its ground-truth attributes in Table 3. The results show that our method generates compact description of each category, focusing on its discriminative attributes. For example, our method select attributes such as flippers for otter, and stripes for skunk, instead of attributes common and nondescriminative such as tail. Note that some attributes that are ranked less relevant by humans were selected for their discriminativity, e.g., yellow for dear and black for moose, both of which human annotators regarded 5We did extensive parameter search for the ALE variants. 7 antelope: lean agility active grizzly bear: cave big mountains k. whale: meatteeth meat lean beaver: swims pads stripes dalmatian: spots longleg hairless Persian cat: domestic pads claws horse: toughskin brown plains G. shepherd: longleg gray stalker blue whale: inactive Siamese: inactive stalker meatteeth skunk: horns slow hooves mole: plankton tunnels tiger: group orange hippopotamus: strainteeth fish swims leopard: spots fish moose: inactive spider monkey: horns grazer humpback: tail elephant: plankton tusks bush gorilla: bipedal bulbous ox: bush bulbous hairless fox: horns orange fish sheep: fish domestic pads seal: mountains small walks chimpanzee: toughskin insects hands hamster: patches walks inactive squirrel: pads stalker bipedal rhinoceros: jungle tusks rabbit: plankton bush bat: plankton flys hairless giraffe: yellow orange longneck wolf: arctic muscle Chihuahua: weak domestic gray rat: fierce fields meatteeth weasel: longneck grazer otter: tusks group coastal buffalo: slow toughskin zebra: stripes longneck bush giant panda: tusks plankton slow deer: spots lean hooves bobcat: strong yellow spots pig: weak tunnels white lion: desert bulbous smelly mouse: forest group domestic polar bear: ocean smelly arctic collie: domestic meatteeth walrus: tusks grazer buckteeth raccoon: stripes spots fast cow: horns c. dolphin: active domestic swims bear plankton longneck strainteeth dolphin plankton longneck rodent plankton domestic plankton longneck toughskin equine hunter meatteeth small sheperd baleen musteln strainteeth longneck plankton big cat toughskin longneck big deer muscle g.ape bovine small meatteeth pinnpd walks ground stalker procyonid longneck toughskin strainteeth bovid hooves horns grazer whale longleg plains fields dog strainteeth toughskin longneck cat strainteeth toughskin hairless odd−toed ungulate plankton meatteeth hunter primate plankton hands bipedal ruminant plankton meatteeth hunter aquatic plankton ocean swims canine longneck feline plankton yellow orange even−toed hunter carnivore pads stalker paws ungulate horns hooves longneck placental Figure 2: Learned discriminative attributes association on the AWA-PCA dataset. Incorrect attributes are colored in red. 0 2 4 6 8 10 15 20 25 30 35 40 45 Number of training examples Accuracy (%) AWA−PCA No transfer AHLE USE USE−Reg. 0 2 4 6 8 10 20 30 40 50 60 70 Number of training examples Accuracy (%) AWA−DeCAF No transfer AHLE USE USE−Reg. Class Learned decomposition Humpback whale A baleen whale, with plankton, flippers, blue, skimmer, arctic Leopard A big cat that is orange, claws, black Hippopotamus An even-toed ungulate, that is gray, bulbous, water, smelly, hands Chimpanzee A primate, that is mountains, strong, stalker, black Persian Cat A domestic cat, that is arctic, nestspot, fish, bush Figure 3: Few-shot experiment result on the AWA dataset, and generated semantic decompositions. as brown. Further, our method selects discriminative attributes for each supercategory, while there is no provided attribute label for supercategories. Figure 2 shows the discriminative attributes disjointly selected at each node on the class hierarchy. We observe that coarser grained categories fit to attributes that are common throughout all its children (e.g. pads, stalker and paws for carnivore), while the finer grained categories fit to attributes that help for finer-grained distinctions (e.g. orange for tiger, spots for leopard, and desert for lion). 4.4 One-shot/Few-shot learning Our method is expected to be especially useful for few-shot learning, by generating a richer description than existing methods, that approximate the new input category using either trained categories or attributes. For this experiment, we divide the 50 categories into predefined 40/10 training/test split, and compare with the knowledge transfer using AHLE. We assume that no attribute label is provided for test set. For AHLE, and USE, we regularize the learning of W with W S learned on training class set S by adding λ2∥W −W S∥2 2, to LME (Eq. 3). For USE-Reg we use the reconstructive regularizer to regularize the model to generate semantic decomposition using U S. Figure 3 shows the result, and the learned semantic decomposition of each novel category. While all methods make improvements over the no-transfer baseline, USE-Reg achieves the most improvement, improving two-shot result on AWA-DeCAF from 38.93% to 49.87%, where USE comes in second with 44.87%. Most learned reconstructions look reasonable, and fit to discriminative traits that help to discriminate between the test classes, which in this case are colors; orange for leopard, gray for hippopotamus, blue for humpback whale, and arctic (white) for Persian cat. 5 Conclusion We propose a unified semantic space model that learns a discriminative space for object categorization, with the help of auxiliary semantic entities such as supercategories and attributes. The auxiliary entities aid object categorization both indirectly, by sharing a common data embedding, and directly, by a sparse-coding based regularizer that enforces the category to be generated by its supercategory + a sparse combination of attributes. Our USE model improves both the flat-hit accuracy and hierarchical precision on the AWA dataset, and also generates semantically meaningful decomposition of categories, that provides human-interpretable rationale. 8 References [1] Christoph Lampert, Hannes Nickisch, and Stefan Harmeling. Learning to Detect Unseen Object Classes by Between-Class Attribute Transfer. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009. [2] Ali Farhadi, Ian Endres, Derek Hoiem, and David Forsyth. Describing Objects by their Attributes. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2009. [3] Sung Ju Hwang, Fei Sha, and Kristen Grauman. Sharing features between objects and their attributes. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1761–1768, 2011. [4] Zeynep Akata, Florent Perronnin, Zaid Harchaoui, and Cordelia Schmid. Label-Embedding for Attribute-Based Classification. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 819–826, 2013. [5] Marcin Marszalek and Cordelia Schmid. Constructing category hierarchies for visual recognition. In European Conference on Computer Vision (ECCV), 2008. [6] Gregory Griffin and Pietro Perona. Learning and using taxonomies for fast visual categorization. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 1–8, 2008. [7] Kilian Q. Weinberger and Olivier Chapelle. Large margin taxonomy embedding for document categorization. In Neural Information Processing Systems (NIPS), pages 1737–1744, 2009. [8] Tianshi Gao and Daphne Koller. Discriminative learning of relaxed hierarchy for large-scale visual recognition. International Conference on Computer Vision (ICCV), pages 2072–2079, 2011. [9] Sung Ju Hwang, Kristen Grauman, and Fei Sha. Analogy-preserving semantic embedding for visual object categorization. In International Conference on Machine Learning (ICML), pages 639–647, 2013. [10] Samy Bengio, Jason Weston, and David Grangier. Label Embedding Trees for Large MultiClass Task. In Neural Information Processing Systems (NIPS), 2010. [11] Thomas Mensink, Jakov Verbeek, Florent Perronnin, and Gabriela Csurka. Distance-based image classification: Generalizing to new classes at near zero cost. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI), 35(11), 2013. [12] Andrea Frome, Greg Corrado, Jon Shlens, Samy Bengio, Jeffrey Dean, Marc’Aurelio Ranzato, and Tomas Mikolov. Devise: A deep visual-semantic embedding model. In Neural Information Processing Systems (NIPS), 2013. [13] Alon Zweig and Daphna Weinshall. Hierarchical regularization cascade for joint learning. In International Conference on Machine Learning (ICML), volume 28, pages 37–45, 2013. [14] Julien Mairal, Francis Bach, Jean Ponce, Guillermo Sapiro, and Andrew Zisserman. Supervised dictionary learning. In Neural Information Processing Systems (NIPS), pages 1033– 1040, 2008. [15] Jason Weston, Samy Bengio, and Nicolas Usunier. Wsabie: Scaling up to large vocabulary image annotation. In International Joint Conferences on Artificial Intelligence (IJCAI), 2011. [16] Yang Zhou, Rong Jin, and Steven C. H. Hoi. Exclusive lasso for multi-task feature selection. Journal of Machine Learning Research, 9:988–995, 2010. [17] John Duchi and Yoram Singer. Efficient online and batch learning using forward backward splitting. Journal of Machine Learning Research, 10, 2009. [18] Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. DeCAF: A deep convolutional activation feature for generic visual recognition. In International Conference on Machine Learning (ICML), 2014. 9
2014
381
5,493
Parallel Double Greedy Submodular Maximization Xinghao Pan1 Stefanie Jegelka1 Joseph Gonzalez1 Joseph Bradley1 Michael I. Jordan1,2 1Department of Electrical Engineering and Computer Science, and 2Department of Statistics University of California, Berkeley, Berkeley, CA USA 94720 {xinghao,stefje,jegonzal,josephkb,jordan}@eecs.berkeley.edu Abstract Many machine learning problems can be reduced to the maximization of submodular functions. Although well understood in the serial setting, the parallel maximization of submodular functions remains an open area of research with recent results [1] only addressing monotone functions. The optimal algorithm for maximizing the more general class of non-monotone submodular functions was introduced by Buchbinder et al. [2] and follows a strongly serial double-greedy logic and program analysis. In this work, we propose two methods to parallelize the double-greedy algorithm. The first, coordination-free approach emphasizes speed at the cost of a weaker approximation guarantee. The second, concurrency control approach guarantees a tight 1/2-approximation, at the quantifiable cost of additional coordination and reduced parallelism. As a consequence we explore the tradeoff space between guaranteed performance and objective optimality. We implement and evaluate both algorithms on multi-core hardware and billion edge graphs, demonstrating both the scalability and tradeoffs of each approach. 1 Introduction Many important problems including sensor placement [3], image co-segmentation [4], MAP inference for determinantal point processes [5], influence maximization in social networks [6], and document summarization [7] may be expressed as the maximization of a submodular function. The submodular formulation enables the use of targeted algorithms [2, 8] that offer theoretical worst-case guarantees on the quality of the solution. For several maximization problems of monotone submodular functions (satisfying F(A) ≤F(B) for all A ⊆B), a simple greedy algorithm [8] achieves the optimal approximation factor of 1 −1 e. The optimal result for the wider, important class of non-monotone functions — an approximation guarantee of 1/2 — is much more recent, and achieved by a double greedy algorithm by Buchbinder et al. [2]. While theoretically optimal, in practice these algorithms do not scale to large real world problems, since the inherently serial nature of the algorithms poses a challenge to leveraging advances in parallel hardware. This limitation raises the question of parallel algorithms for submodular maximization that ideally preserve the theoretical bounds, or weaken them gracefully, in a quantifiable manner. In this paper, we address the challenge of parallelization of greedy algorithms, in particular the double greedy algorithm, from the perspective of parallel transaction processing systems. This alternative perspective allows us to apply advances in database research ranging from fast coordination-free approaches with limited guarantees to sophisticated concurrency control techniques which ensure a direct correspondence between parallel and serial executions at the expense of increased coordination. We develop two parallel algorithms for the maximization of non-monotone submodular functions that operate at different points along the coordination tradeoff curve. We propose CF-2g as a coordinationfree algorithm and characterize the effect of reduced coordination on the approximation ratio. By bounding the possible outcomes of concurrent transactions we introduce the CC-2g algorithm which 1 guarantees serializable parallel execution and retains the optimality of the double greedy algorithm at the expense of increased coordination. The primary contributions of this paper are: 1. We propose two parallel algorithms for unconstrained non-monotone submodular maximization, which trade off parallelism and tight approximation guarantees. 2. We provide approximation guarantees for CF-2g and analytically bound the expected loss in objective value for set-cover with costs and max-cut as running examples. 3. We prove that CC-2g preserves the optimality of the serial double greedy algorithm and analytically bound the additional coordination overhead for covering with costs and max-cut. 4. We demonstrate empirically using two synthetic and four real datasets that our parallel algorithms perform well in terms of both speed and objective values. The rest of the paper is organized as follows. Sec. 2 discusses the problem of submodular maximization and introduces the double greedy algorithm. Sec. 3 provides background on concurrency control mechanisms. We describe and provide intuition for our CF-2g and CC-2g algorithms in Sec. 4 and Sec. 5, and then analyze the algorithms both theoretically (Sec. 6) and empirically (Sec. 7). 2 Submodular Maximization A set function F : 2V →R defined over subsets of a ground set V is submodular if it satisfies diminishing marginal returns: for all A ⊆B ⊆V and e /∈B, it holds that F(A ∪{e}) − F(A) ≥F(B ∪{e}) −F(B). Throughout this paper, we will assume that F is nonnegative and F(∅) = 0. Submodular functions have emerged in areas such as game theory [9], graph theory [10], combinatorial optimization [11], and machine learning [12, 13]. Casting machine learning problems as submodular optimization enables the use of algorithms for submodular maximization [2, 8] that offer theoretical worst-case guarantees on the quality of the solution. While those algorithms confer strong guarantees, their design is inherently serial, limiting their usability in large-scale problems. Recent work has addressed faster [14] and parallel [1, 15, 16] versions of the greedy algorithm by Nemhauser et al. [8] for maximizing monotone submodular functions that satisfy F(A) ≤F(B) for any A ⊆B ⊆V . However, many important applications in machine learning lead to non-monotone submodular functions. For example, graphical model inference [5, 17], or trading off any submodular gain maximization with costs (functions of the form F(S) = G(S) −λM(S), where G(S) is monotone submodular and M(S) a linear (modular) cost function), such as for utility-privacy tradeoffs [18], require maximizing non-monotone submodular functions. For non-monotone functions, the simple greedy algorithm in [8] can perform arbitrarily poorly (see Appendix H.1 for an example). Intuitively, the introduction of additional elements with monotone submodular functions never decreases the objective while introducing elements with non-monotone submodular functions can decrease the objective to its minimum. For non-monotone functions, Buchbinder et al. [2] recently proposed an optimal double greedy algorithm that works well in a serial setting. In this paper, we study parallelizations of this algorithm. The serial double greedy algorithm. The serial double greedy algorithm of Buchbinder et al. [2] (Ser-2g, in Alg. 3) maintains two sets Ai ⊆Bi. Initially, A0 = ∅and B0 = V . In iteration i, the set Ai−1 contains the items selected before item/iteration i, and Bi−1 contains Ai and the items that are so far undecided. The algorithm serially passes through the items in V and determines online whether to keep item i (add to Ai) or discard it (remove from Bi), based on a threshold that trades off the gain ∆+(i) = F(Ai−1 ∪i) −F(Ai−1) of adding i to the currently selected set Ai−1, and the gain ∆−(i) = F(Bi−1 \ i) −F(Bi−1) of removing i from the candidate set, estimating its complementarity to other remaining elements. For any element ordering, this algorithm achieves a tight 1/2-approximation in expectation. 3 Concurrency Patterns for Parallel Machine Learning In this paper we adopt a transactional view of the program state and explore parallelization strategies through the lens of parallel transaction processing systems. We recast the program state (the sets A and B) as data, and the operations (adding elements to A and removing elements from B) as 2 transactions. More precisely we reformulate the double greedy algorithm (Alg. 3) as a series of exchangeable, Read-Write transactions of the form: Te(A, B) ≜ ( (A ∪e, B) if ue ≤ [∆+(A,e)]+ [∆+(A,e)]++[∆−(B,e)]+ (A, B\e) otherwise. (1) The transaction Te is a function from the sets A and B to new sets A and B based on the element e ∈V and the predetermined random bits ue for that element. By composing the transactions Tn(Tn−1(. . . T1(∅, V ))) we recover the serial double-greedy algorithm defined in Alg. 3. In fact, any ordering of the serial composition of the transactions recovers a permuted execution of Alg. 3 and therefore the optimal approximation algorithm. However, this raises the question: is it possible to apply transactions in parallel? If we execute transactions Ti and Tj, with i ̸= j, in parallel we need a method to merge the resulting program states. In the context of the double greedy algorithm, we could define the parallel execution of two transactions as: Ti(A, B) + Tj(A, B) ≜(Ti(A, B)A ∪Tj(A, B)A, Ti(A, B)B ∩Tj(A, B)B) , (2) the union of the resulting A and the intersection of the resulting B. While we can easily generalize Eq. (2) to many parallel transactions, we cannot always guarantee that the result will correspond to a serial composition of transactions. As a consequence, we cannot directly apply the analysis of Buchbinder et al. [2] to derive strong approximation guarantees for the parallel execution. Fortunately, several decades of research [19, 20] in database systems have explored efficient parallel transaction processing. In this paper we adopt a coordinated bounds approach to parallel transaction processing in which parallel transactions are constructed under bounds on the possible program state. If the transaction could violate the bound then it is processed serially on the server. By adjusting the definition of the bound we can span a space of coordination-free to serializable executions. Algorithm 1: Generalized transactions 1 for p ∈{1, . . . , P} do in parallel 2 while ∃element to process do 3 e = next element to process 4 (ge, i) = requestGuarantee(e) 5 ∂i = propose(e, ge) 6 commit(e, i, ∂i) // Non-blocking Algorithm 2: Commit transaction i 1 wait until ∀j < i, processed(j) = true 2 Atomically 3 if ∂i = FAIL then // Deferred proposal 4 ∂i = propose(e, S) // Advance the program state 5 S ←∂i(S) Figure 1: Algorithm for generalized transactions. Each transaction requests its position i in the commit ordering, as well as the bounds ge that are guaranteed to hold when it commits. Transactions are also guaranteed to be committed according to the given ordering. In Fig. 1 we describe the coordinated bounds transaction pattern. The clients (Alg. 1), in parallel, construct and commit transactions under bounded assumptions about the program state S (i.e., the sets A and B). Transactions are constructed by requesting the latest bound ge on S at logical time i and computing a change ∂i to S (e.g., Add e to A). If the bound is insufficient to construct the transaction then ∂i = FAIL is returned. The client then sends the proposed change ∂i to the server to be committed atomically and proceeds to the next element without waiting for a response. The server (Alg. 2) serially applies the transactions advancing the program state (i.e., adding elements to A or removing elements from B). If the bounds were insufficient and the transaction failed at the client (i.e., ∂i = FAIL) then the server serially reconstructs and applies the transaction under the true program state. Moreover, the server is responsible for deriving bounds, processing transactions in the logical order i, and producing the serializable output ∂n(∂n−1(. . . ∂1(S))). This model achieves a high degree of parallelism when the cost of constructing the transaction dominates the cost of applying the transaction. For example, in the case of submodular maximization, the cost of constructing the transaction depends on evaluating the marginal gains with respect to changes in A and B while the cost of applying the transaction reduces to setting a bit. It is also essential that only a few transactions fail at the client. Indeed, the analysis of these systems focuses on ensuring that the majority of the transactions succeed. 3 Algorithm 3: Ser-2g: serial double greedy 1 A0 = ∅, B0 = V 2 for i = 1 to n do 3 ∆+(i) = F(Ai−1 ∪i) −F(Ai−1) 4 ∆−(i) = F(Bi−1\i) −F(Bi−1) 5 Draw ui ∼Unif(0, 1) 6 if ui < [∆+(i)]+ [∆+(i)]++[∆−(i)]+ then 7 Ai := Ai−1 ∪i; Bi := Bi−1 8 else Ai := Ai−1; Bi := Bi−1\i Algorithm 4: CF-2g: coord-free double greedy 1 b A = ∅, bB = V 2 for p ∈{1, . . . , P} do in parallel 3 while ∃element to process do 4 e = next element to process 5 b Ae = b A; bBe = bB 6 ∆max + (e) = F( b Ae ∪e) −F( b Ae) 7 ∆max − (e) = F( bBe\e) −F( bBe) 8 Draw ue ∼Unif(0, 1) 9 if ue < [∆max + (e)]+ [∆max + (e)]++[∆max − (e)]+ then 10 b A(e) ←1 11 else bB(e) ←0 Algorithm 5: CC-2g: concurrency control 1 b A = e A = ∅, bB = eB = V 2 for i = 1, . . . , |V | do processed(i) = false 3 ι = 0 4 for p ∈{1, . . . , P} do in parallel 5 while ∃element to process do 6 e = next element to process 7 ( b Ae, e Ae, bBe, eBe, i) = getGuarantee(e) 8 (result, ue) = propose(e, b Ae, e Ae, bBe, eBe) 9 commit(e, i, ue, result) Algorithm 6: CC-2g getGuarantee(e) 1 e A(e) ←1; eB(e) ←0 2 i = ι; ι ←ι + 1 3 b Ae = b A; bBe = bB 4 e Ae = e A; eBe = eB 5 return ( b Ae, e Ae, bBe, eBe, i) Algorithm 7: CC-2g propose 1 ∆min + (e) = F( e Ae) −F( e Ae\e) 2 ∆max + (e) = F( b Ae ∪e) −F( b Ae) 3 ∆min −(e) = F( eBe) −F( eBe ∪e) 4 ∆max − (e) = F( bBe\e) −F( bBe) 5 Draw ue ∼Unif(0, 1) 6 if ue < [∆min + (e)]+ [∆min + (e)]++[∆max − (e)]+ then 7 result ←1 8 else if ue > [∆max + (e)]+ [∆max + (e)]++[∆min − (e)]+ then 9 result ←−1 10 else result ←FAIL 11 return (result, ue) Algorithm 8: CC-2g: commit(e, i, ue, result) 1 wait until ∀j < i, processed(j) = true 2 if result = FAIL then 3 ∆exact + (e) = F( b A ∪e) −F( b A) 4 ∆exact − (e) = F( bB\e) −F( bB) 5 if ue < [∆exact + (e)]+ [∆exact + (e)]++[∆exact − (e)]+ then result ←1 6 else result ←−1 7 if result = 1 then b A(e) ←1; eB(e) ←1 8 else e A(e) ←0; bB(e) ←0 9 processed(i) = true 4 Coordination-Free Double Greedy Algorithm The coordination-free approach attempts to reduce the need to coordinate guarantees and the logical ordering. This is achieved by operating on potentially stale states: the transaction guarantee reduces to requiring ge be a stale version of S, and the logical ordering is implicitly defined by the time of commit. In using these weak guarantees, CF-2g is overly optimistically assuming that concurrent transactions are independent, which could potentially lead to erroneous decisions. Alg. 4 is the coordination-free parallel double greedy algorithm.1 CF-2g closely resembles the serial Ser-2g, but the elements e ∈V are no longer processed in a fixed order. Thus, the sets A, B are replaced by potentially stale local estimates (bounds) bA, bB, where bA is a subset of the true A and bB is a superset of the actual B on each iteration. These bounding sets allow us to compute bounds ∆max + , ∆max − which approximate ∆+, ∆−from the serial algorithm. We now formalize this idea. To analyze the CF-2g algorithm we order the elements e ∈V according to the commit time (i.e., when Alg. 4 line 8 is executed). Let ι(e) be the position of e in this total ordering on elements. This 1We present only the parallelized probabilistic versions of [2]. Both parallel algorithms can be easily extended to the deterministic version of [2]; CF-2g can also be extended to the multilinear version of [2]. 4 ui Add A! Rem. B! 0 1 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 Algorithm 3: Seq-2g: Sequential double greedy 1 A0 = ;, B0 = V 2 for i = 1 to n do 3 ∆+(i) = F(Ai−1 [ i) −F(Ai−1) 4 ∆−(i) = F(Bi−1\i) −F(Bi−1) 5 Draw ui ⇠Unif(0, 1) 6 if ui < [∆+(i)]+ [∆+(i)]++[∆−(i)]+ then 7 Ai := Ai−1 [ i; Bi := Bi−1 8 else Ai := Ai−1; Bi := Bi−1\i Algorithm 4: CF-2g: coord-free double greedy 1 ˆA = ;, ˆB = V 2 for p 2 {1, . . . , P} do in parallel 3 while 9 element to process do 4 e = next element to process 5 ∆max + (e) = F( ˆA [ e) −F( ˆA) 6 ∆max − (e) = F( ˆB\e) −F( ˆB) 7 Draw ue ⇠Unif(0, 1) 8 if ue < [∆max + (e)]+ [∆max + (e)]++[∆max − (e)]+ then 9 ˆA(e) 1 10 else ˆB(e) 0 Algorithm 5: CC-2g: concurrency control 1 ˆA = ˜A = ;, ˆB = ˜B = V 2 for i = 1, . . . , |V | do processed(i) = false 3 ◆= 0 4 for p 2 {1, . . . , P} do in parallel 5 while 9 element to process do 6 e = next element to process 7 ( ˆAe, ˜Ae, ˆBe, ˜Be, i) = getGuarantee(e) 8 (result, ue) = propose(e, ˆAe, ˜Ae, ˆBe, ˜Be) 9 commit(e, i, ue, result) Algorithm 6: CC-2g getGuarantee(e) 1 ˜A(e) 1; ˜B(e) 0 2 i = ◆; ◆ ◆+ 1 3 ˆAe = ˆA; ˆBe = ˆB 4 ˜Ae = ˜A; ˜Be = ˜B 5 return ( ˆAe, ˜Ae, ˆBe, ˜Be, i) Algorithm 7: CC-2g propose 1 ∆min + (e) = F( ˜Ae) −F( ˜Ae\e) 2 ∆max + (e) = F( ˆAe [ e) −F( ˆAe) 3 ∆min −(e) = F( ˜Be) −F( ˜Be [ e) 4 ∆max − (e) = F( ˆBe\e) −F( ˆBe) 5 Draw ue ⇠Unif(0, 1) 6 if ue < [∆min + (e)]+ [∆min + (e)]++[∆max − (e)]+ then 7 result 1 8 else if ue > [∆max + (e)]+ [∆max + (e)]++[∆min − (e)]+ then 9 result −1 10 else result fail 11 return (result, ue) Algorithm 8: CC-2g: commit(e, i, ue, result) 1 wait until 8j < i, processed(j) = true 2 if result = fail then 3 ∆exact + (e) = F( ˆA [ e) −F( ˆA) 4 ∆exact − (e) = F( ˆB\e) −F( ˆB) 5 if ue < [∆exact + (e)]+ [∆exact + (e)]++[∆exact − (e)]+ then result 1 6 else result −1 7 if result = 1 then ˆA(e) 1; ˜B(e) 1 8 else ˜A(e) 0; ˆB(e) 0 9 processed(i) = true (a) (b) (c) 4 Coordination Free Double Greedy Algorithm The coordination-free approach attempts to reduce the need to coordinate guarantees and logical ordering. This is achieved by operating on potentially stale states – the guarantee reduces to requiring ge be a stale version of S, and logical ordering is implicitly defined by the time of commit. In using these weak guarantees, CF-2g is overly optimistically assuming that concurrent transactions are independent, which could potentially lead to erroneous decisions. Alg. 4 is the coordination free parallel double greedy algorithm.1 CF-2g closely resembles the serial Seq-2g, but the elements e 2 V are no longer processed in a fixed order. Thus, the sets A, B are replaced by potentially stale “ bounds” ˆA, ˆB, where ˆA is a subset of the “ true” A and ˆB is a superset 1We present only the parallelized probabilistic versions of [1]. Both parallel algorithms can be easily extended to the deterministic version of [1]; CF-2g can also be extended to the multilinear version of [1]. 4 (a) Ser-2g ue Add A! Rem. B! 0 1 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 Algorithm 4: CF-2g: coord-free double greedy 1 ˆA = ;, ˆB = V 2 for p 2 {1, . . . , P} do in parallel 3 while 9 element to process do 4 e = next element to process 5 ∆max + (e) = F( ˆA [ e) −F( ˆA) 6 ∆max − (e) = F( ˆB\e) −F( ˆB) 7 Draw ue ⇠Unif(0, 1) 8 if ue < [∆max + (e)]+ [∆max + (e)]++[∆max − (e)]+ then 9 ˆA(e) 1 10 else ˆB(e) 0 Algorithm 5: CC-2g: concurrency control 1 ˆA = ˜A = ;, ˆB = ˜B = V 2 for i = 1, . . . , |V | do processed(i) = false 3 ◆= 0 4 for p 2 {1, . . . , P} do in parallel 5 while 9 element to process do 6 e = next element to process 7 ( ˆAe, ˜Ae, ˆBe, ˜Be, i) = getGuarantee(e) 8 (result, ue) = propose(e, ˆAe, ˜Ae, ˆBe, ˜Be) 9 commit(e, i, ue, result) 3 ∆min −(e) = F( ˜Be) −F( ˜Be [ e) 4 ∆max − (e) = F( ˆBe\e) −F( ˆBe) 5 Draw ue ⇠Unif(0, 1) 6 if ue < [∆min + (e)]+ [∆min + (e)]++[∆max − (e)]+ then 7 result 1 8 else if ue > [∆max + (e)]+ [∆max + (e)]++[∆min − (e)]+ then 9 result −1 10 else result fail 11 return (result, ue) Algorithm 8: CC-2g: commit(e, i, ue, result) 1 wait until 8j < i, processed(j) = true 2 if result = fail then 3 ∆exact + (e) = F( ˆA [ e) −F( ˆA) 4 ∆exact − (e) = F( ˆB\e) −F( ˆB) 5 if ue < [∆exact + (e)]+ [∆exact + (e)]++[∆exact − (e)]+ then result 1 6 else result −1 7 if result = 1 then ˆA(e) 1; ˜B(e) 1 8 else ˜A(e) 0; ˆB(e) 0 9 processed(i) = true (a) (b) (c) 4 Coordination Free Double Greedy Algorithm The coordination-free approach attempts to reduce the need to coordinate guarantees and logical ordering. This is achieved by operating on potentially stale states – the guarantee reduces to requiring ge be a stale version of S, and logical ordering is implicitly defined by the time of commit. In using these weak guarantees, CF-2g is overly optimistically assuming that concurrent transactions are independent, which could potentially lead to erroneous decisions. Alg. 4 is the coordination free parallel double greedy algorithm.1 CF-2g closely resembles the serial Seq-2g, but the elements e 2 V are no longer processed in a fixed order. Thus, the sets A, B are replaced by potentially stale “ bounds” ˆA, ˆB, where ˆA is a subset of the “ true” A and ˆB is a superset 1We present only the parallelized probabilistic versions of [1]. Both parallel algorithms can be easily extended to the deterministic version of [1]; CF-2g can also be extended to the multilinear version of [1]. 4 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 Algorithm 3: Ser-2g: serial double greedy 1 A0 = ;, B0 = V 2 for i = 1 to n do 3 ∆+(i) = F(Ai−1 [ i) −F(Ai−1) 4 ∆−(i) = F(Bi−1\i) −F(Bi−1) 5 Draw ui ⇠Unif(0, 1) 6 if ui < [∆+(e)]+ [∆+(e)]++[∆−(e)]+ then 7 8 Ai := Ai−1 [ i; Bi := Bi−1 9 else Ai := Ai−1; Bi := Bi−1\i Algorithm 4: CF-2g: coord-free double greedy 1 ˆA = ;, ˆB = V 2 for p 2 {1, . . . , P} do in parallel 3 while 9 element to process do 4 e = next element to process 5 ˆAe = ˆA; ˆBe = ˆB 6 ∆max + (e) = F( ˆAe [ e) −F( ˆAe) 7 ∆max − (e) = F( ˆBe\e) −F( ˆBe) 8 Draw ue ⇠Unif(0, 1) 9 if ue < [∆max + (e)]+ [∆max + (e)]++[∆max − (e)]+ then 10 ˆA(e) 1 11 else ˆB(e) 0 Algorithm 5: CC-2g: concurrency control 1 ˆA = ˜A = ;, ˆB = ˜B = V 2 for i = 1, . . . , |V | do processed(i) = false 3 ◆= 0 4 for p 2 {1, . . . , P} do in parallel 5 while 9 element to process do 6 e = next element to process 7 ( ˆAe, ˜Ae, ˆBe, ˜Be, i) = getGuarantee(e) 8 (result, ue) = propose(e, ˆAe, ˜Ae, ˆBe, ˜Be) 9 commit(e, i, ue, result) Algorithm 6: CC-2g getGuarantee(e) 1 ˜A(e) 1; ˜B(e) 0 2 i = ◆; ◆ ◆+ 1 3 ˆAe = ˆA; ˆBe = ˆB 4 ˜Ae = ˜A; ˜Be = ˜B 5 return ( ˆAe, ˜Ae, ˆBe, ˜Be, i) Algorithm 7: CC-2g propose 1 ∆min + (e) = F( ˜Ae) −F( ˜Ae\e) 2 ∆max + (e) = F( ˆAe [ e) −F( ˆAe) 3 ∆min −(e) = F( ˜Be) −F( ˜Be [ e) 4 ∆max − (e) = F( ˆBe\e) −F( ˆBe) 5 Draw ue ⇠Unif(0, 1) 6 if ue < [∆min + (e)]+ [∆min + (e)]++[∆max − (e)]+ then 7 result 1 8 else if ue > [∆max + (e)]+ [∆max + (e)]++[∆min − (e)]+ then 9 result −1 10 else result FAIL 11 return (result, ue) Algorithm 8: CC-2g: commit(e, i, ue, result) 1 wait until 8j < i, processed(j) = true 2 if result = FAIL then 3 ∆exact + (e) = F( ˆA [ e) −F( ˆA) 4 ∆exact − (e) = F( ˆB\e) −F( ˆB) 5 if ue < [∆exact + (e)]+ [∆exact + (e)]++[∆exact − (e)]+ then result 1 6 else result −1 7 if result = 1 then ˆA(e) 1; ˜B(e) 1 8 else ˜A(e) 0; ˆB(e) 0 9 processed(i) = true 4 Coordination-Free Double Greedy Algorithm The coordination-free approach attempts to reduce the need to coordinate guarantees and the logical ordering. This is achieved by operating on potentially stale states: the transaction guarantee reduces to requiring ge be a stale version of S, and the logical ordering is implicitly defined by the time of commit. In using these weak guarantees, CF-2g is overly optimistically assuming that concurrent transactions are independent, which could potentially lead to erroneous decisions. Alg. 4 is the coordination-free parallel double greedy algorithm.1 CF-2g closely resembles the serial Ser-2g, but the elements e 2 V are no longer processed in a fixed order. Thus, the sets A, B are replaced by potentially stale local estimates (bounds) ˆA, ˆB, where ˆA is a subset of the true A and ˆB is a superset of the actual B on each iteration. These bounding sets allow us to compute bounds ∆max + , ∆max − which approximate ∆+, ∆−from the serial algorithm. We now formalize this idea. 1We present only the parallelized probabilistic versions of [2]. Both parallel algorithms can be easily extended to the deterministic version of [2]; CF-2g can also be extended to the multilinear version of [2]. 4 (b) CF-2g ue Add A! Rem. B! 0 1 Uncertainty ! 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 4 ∆(i) F(B \i) F(B ) 5 Draw ui ⇠Unif(0, 1) 6 if ui < [∆+(i)]+ [∆+(i)]++[∆−(i)]+ then 7 Ai := Ai−1 [ i; Bi := Bi−1 8 else Ai := Ai−1; Bi := Bi−1\i Algorithm 4: CF-2g: coord-free double greedy 1 ˆA = ;, ˆB = V 2 for p 2 {1, . . . , P} do in parallel 3 while 9 element to process do 4 e = next element to process 5 ∆max + (e) = F( ˆA [ e) −F( ˆA) 6 ∆max − (e) = F( ˆB\e) −F( ˆB) 7 Draw ue ⇠Unif(0, 1) 8 if ue < [∆max + (e)]+ [∆max + (e)]++[∆max − (e)]+ then 9 ˆA(e) 1 10 else ˆB(e) 0 Algorithm 5: CC-2g: concurrency control 1 ˆA = ˜A = ;, ˆB = ˜B = V 2 for i = 1, . . . , |V | do processed(i) = false 3 ◆= 0 4 for p 2 {1, . . . , P} do in parallel 5 while 9 element to process do 6 e = next element to process 7 ( ˆAe, ˜Ae, ˆBe, ˜Be, i) = getGuarantee(e) 8 (result, ue) = propose(e, ˆAe, ˜Ae, ˆBe, ˜Be) 9 commit(e, i, ue, result) 4 ˜Ae = ˜A; ˜Be = ˜B 5 return ( ˆAe, ˜Ae, ˆBe, ˜Be, i) Algorithm 7: CC-2g propose 1 ∆min + (e) = F( ˜Ae) −F( ˜Ae\e) 2 ∆max + (e) = F( ˆAe [ e) −F( ˆAe) 3 ∆min −(e) = F( ˜Be) −F( ˜Be [ e) 4 ∆max − (e) = F( ˆBe\e) −F( ˆBe) 5 Draw ue ⇠Unif(0, 1) 6 if ue < [∆min + (e)]+ [∆min + (e)]++[∆max − (e)]+ then 7 result 1 8 else if ue > [∆max + (e)]+ [∆max + (e)]++[∆min − (e)]+ then 9 result −1 10 else result fail 11 return (result, ue) Algorithm 8: CC-2g: commit(e, i, ue, result) 1 wait until 8j < i, processed(j) = true 2 if result = fail then 3 ∆exact + (e) = F( ˆA [ e) −F( ˆA) 4 ∆exact − (e) = F( ˆB\e) −F( ˆB) 5 if ue < [∆exact + (e)]+ [∆exact + (e)]++[∆exact − (e)]+ then result 1 6 else result −1 7 if result = 1 then ˆA(e) 1; ˜B(e) 1 8 else ˜A(e) 0; ˆB(e) 0 9 processed(i) = true (a) (b) (c) 4 Coordination Free Double Greedy Algorithm The coordination-free approach attempts to reduce the need to coordinate guarantees and logical ordering. This is achieved by operating on potentially stale states – the guarantee reduces to requiring ge be a stale version of S, and logical ordering is implicitly defined by the time of commit. In using these weak guarantees, CF-2g is overly optimistically assuming that concurrent transactions are independent, which could potentially lead to erroneous decisions. Alg. 4 is the coordination free parallel double greedy algorithm.1 CF-2g closely resembles the serial Seq-2g, but the elements e 2 V are no longer processed in a fixed order. Thus, the sets A, B are replaced by potentially stale “ bounds” ˆA, ˆB, where ˆA is a subset of the “ true” A and ˆB is a superset 1We present only the parallelized probabilistic versions of [1]. Both parallel algorithms can be easily extended to the deterministic version of [1]; CF-2g can also be extended to the multilinear version of [1]. 4 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 5 Draw ui ⇠Unif(0, 1) 6 if ui < [∆+(i)]+ [∆+(i)]++[∆−(i)]+ then 7 Ai := Ai−1 [ i; Bi := Bi−1 8 else Ai := Ai−1; Bi := Bi−1\i Algorithm 4: CF-2g: coord-free double greedy 1 ˆA = ;, ˆB = V 2 for p 2 {1, . . . , P} do in parallel 3 while 9 element to process do 4 e = next element to process 5 ∆max + (e) = F( ˆA [ e) −F( ˆA) 6 ∆max − (e) = F( ˆB\e) −F( ˆB) 7 Draw ue ⇠Unif(0, 1) 8 if ue < [∆max + (e)]+ [∆max + (e)]++[∆max − (e)]+ then 9 ˆA(e) 1 10 else ˆB(e) 0 Algorithm 5: CC-2g: concurrency control 1 ˆA = ˜A = ;, ˆB = ˜B = V 2 for i = 1, . . . , |V | do processed(i) = false 3 ◆= 0 4 for p 2 {1, . . . , P} do in parallel 5 while 9 element to process do 6 e = next element to process 7 ( ˆAe, ˜Ae, ˆBe, ˜Be, i) = getGuarantee(e) 8 (result, ue) = propose(e, ˆAe, ˜Ae, ˆBe, ˜Be) 9 commit(e, i, ue, result) 5 return ( ˆAe, ˜Ae, ˆBe, ˜Be, i) Algorithm 7: CC-2g propose 1 ∆min + (e) = F( ˜Ae) −F( ˜Ae\e) 2 ∆max + (e) = F( ˆAe [ e) −F( ˆAe) 3 ∆min −(e) = F( ˜Be) −F( ˜Be [ e) 4 ∆max − (e) = F( ˆBe\e) −F( ˆBe) 5 Draw ue ⇠Unif(0, 1) 6 if ue < [∆min + (e)]+ [∆min + (e)]++[∆max − (e)]+ then 7 result 1 8 else if ue > [∆max + (e)]+ [∆max + (e)]++[∆min − (e)]+ then 9 result −1 10 else result fail 11 return (result, ue) Algorithm 8: CC-2g: commit(e, i, ue, result) 1 wait until 8j < i, processed(j) = true 2 if result = fail then 3 ∆exact + (e) = F( ˆA [ e) −F( ˆA) 4 ∆exact − (e) = F( ˆB\e) −F( ˆB) 5 if ue < [∆exact + (e)]+ [∆exact + (e)]++[∆exact − (e)]+ then result 1 6 else result −1 7 if result = 1 then ˆA(e) 1; ˜B(e) 1 8 else ˜A(e) 0; ˆB(e) 0 9 processed(i) = true (a) (b) (c) 4 Coordination Free Double Greedy Algorithm The coordination-free approach attempts to reduce the need to coordinate guarantees and logical ordering. This is achieved by operating on potentially stale states – the guarantee reduces to requiring ge be a stale version of S, and logical ordering is implicitly defined by the time of commit. In using these weak guarantees, CF-2g is overly optimistically assuming that concurrent transactions are independent, which could potentially lead to erroneous decisions. Alg. 4 is the coordination free parallel double greedy algorithm.1 CF-2g closely resembles the serial Seq-2g, but the elements e 2 V are no longer processed in a fixed order. Thus, the sets A, B are replaced by potentially stale “ bounds” ˆA, ˆB, where ˆA is a subset of the “ true” A and ˆB is a superset 1We present only the parallelized probabilistic versions of [1]. Both parallel algorithms can be easily extended to the deterministic version of [1]; CF-2g can also be extended to the multilinear version of [1]. 4 (c) CC-2g Figure 2: Illustration of algorithms. (a) Ser-2g computes a threshold based on the true values ∆+, ∆−, and chooses an action based by comparing a uniform random ui against the threshold. (b) CF-2g approximates the threshold based on stale b A, bB, possibly choosing the wrong action. (c) CC-2g computes two thresholds based on the bounds on A, B, which defines an uncertainty region where it is not possible to choose the correct action locally. If the random value ue falls inside the uncertainty interval than the transaction FAILS and must be recomputed serially by the server; otherwise the transaction holds under all possible global states. ordering allows us to define monotonically non-decreasing sets Ai = {e′ : e′ ∈A, ι(e′) < i} where A is the final returned set, and monotonically non-increasing sets Bi = Ai ∪{e′ : ι(e′) ≥i}. The sets Ai, Bi provide a serialization against which we can compare CF-2g; in this serialization, Alg. 3 computes ∆+(e) = F(Aι(e)−1 ∪e) −F(Aι(e)−1) and ∆−(e) = F(Bι(e)−1\e) −F(Bι(e)−1). On the other hand, CF-2g uses stale versions2 bAe, bBe: Alg. 4 computes ∆max + (e) = F( bAe ∪e) −F( bAe) and ∆max − (e) = F( bBe\e) −F( bBe). The next lemma shows that bAe, bBe are bounding sets for the serialization’s sets Aι(e)−1, Bι(e)−1. Intuitively, the bounds hold because bAe, bBe are stale versions of Aι(e)−1, Bι(e)−1, which are monotonically non-decreasing and non-increasing sets. Appendix A gives a detailed proof. Lemma 4.1. In CF-2g, for any e ∈V , bAe ⊆Aι(e)−1, and bBe ⊇Bι(e)−1. Corollary 4.2. Submodularity of F implies for CF-2g ∆+(e) ≤∆max + (e), and ∆−(e) ≤∆max − (e). The error in CF-2g depends on the tightness of the bounds in Cor. 4.2. We analyze this in Sec. 6.1. 5 Concurrency Control for the Double Greedy Algorithm The concurrency control-based double greedy algorithm1, CC-2g, is presented in Alg. 5, and closely follows the meta-algorithm of Alg. 1 and Alg. 2. Unlike in CF-2g, the concurrency control mechanisms of CC-2g ensure that concurrent transactions are serialized when they are not independent. Serializability is achieved by maintaining sets bA, eA, bB, eB, which serve as upper and lower bounds on the true state of A and B at commit time. Each thread can determine locally if a decision to include or exclude an element can be taken safely. Otherwise, the proposal is deferred to the commit process (Alg. 8) which waits until it is certain about A and B before proceeding. The commit order is given by ι(e), which is the value of ι in line 2 of Alg. 5. We define Aι(e)−1, Bι(e)−1 as before with CF-2g. Additionally, let bAe, bBe, eAe, and eBe be the sets that are returned by Alg. 6.2 Indeed, these sets are guaranteed to be bounds on Aι(e)−1, Bι(e)−1: Lemma 5.1. In CC-2g, ∀e ∈V , bAe ⊆Aι(e)−1 ⊆eAe\e, and bBe ⊇Bι(e)−1 ⊇eBe ∪e. Intuitively, these bounds are maintained by recording potential effects of concurrent transactions in eA, eB, and only recording the actual effects in bA, bB; we leave the full proof to Appendix A. Furthermore, by committing transactions in order ι, we have bA = Aι(e)−1 and bB = Bι(e)−1 during commit. Lemma 5.2. In CC-2g, when committing element e, we have bA = Aι(e)−1 and bB = Bι(e)−1. 2 For clarity, we present the algorithm as creating a copy of b A, bB, e A, and eB for each element. In practice, it is more efficient to update and access them in shared memory. Nevertheless, our theorems hold for both settings. 5 Corollary 5.3. Submodularity of F implies that the ∆’s computed by CC-2g satisfy ∆min + (e) ≤ ∆exact + (e) = ∆+(e) ≤∆max + (e) and ∆min −(e) ≤∆exact − (e) = ∆−(e) ≤∆max − (e). By using these bounds, CC-2g can determine when it is safe to construct the transaction locally. For failed transactions, the server is able to construct the correct transaction using the true program state. As a consequence we can guarantee that the parallel execution of CC-2g is serializable. 6 Analysis of Algorithms Our two algorithms trade off performance and strong approximation guarantees. The CF-2g algorithm emphasizes speed at the expense of the approximation objective. On the other hand, CC-2g emphasizes the tight 1/2-approximation at the expense of increased coordination. In this section we characterize the reduction in the approximation objective as well as the increased coordination. Our analysis connects the degradation in CC-2g scalability with the degradation in the CF-2g approximation factor via the maximum inter-processor message delay τ. 6.1 Approximation of CF-2g double greedy Theorem 6.1. Let F be a non-negative submodular function. CF-2g solves the unconstrained problem maxA⊂V F(A) with worst-case approximation factor E[F(ACF )] ≥1 2F ∗−1 4 PN i=1 E[ρi], where ACF is the output of the algorithm, F ∗is the optimal value, and ρi = max{∆max + (e) − ∆+(e), ∆max − (e) −∆−(e)} is the maximum discrepancy in the marginal gain due to the bounds. The proof (Appendix C) of Thm. 6.1 follows the structure in [2]. Thm. 6.1 captures the deviation from optimality as a function of width of the bounds which we characterize for two common applications. Example: max graph cut. For the max cut objective we bound the expected discrepancy in the marginal gain ρi in terms of the sparsity of the graph and the maximum inter-processor message delay τ. By applying Thm. 6.1 we obtain the approximation factor E[F(AN)] ≥1 2F ∗−τ #edges 2N which decreases linearly in both the message delays and graph density. In a complete graph, F ∗= 1 2#edges, so E[F(AN)] ≥F ∗ 1 2 −τ N  , which makes it possible to scale τ linearly with N while retaining the same approximation factor. Example: set cover. Consider the simple set cover function, F(A) = PL l=1 min(1, |A ∩Sl|) − λ|A| = |{l : A ∩Sl ̸= ∅}| −λ|A|, with 0 < λ ≤1. We assume that there is some bounded delay τ. Suppose also the Sl’s form a partition, so each element e belongs to exactly one set. Then, P e E[ρe] ≥τ + L(1 −λτ), which is linear in τ but independent of N. 6.2 Correctness of CC-2g Theorem 6.2. CC-2g is serializable and therefore solves the unconstrained submodular maximization problem maxA⊂V F(A) with approximation E[F(ACC)] ≥1 2F ∗, where ACC is the output of the algorithm, and F ∗is the optimal value. The key challenge in the proof (Appendix B) of Thm. 6.2 is to demonstrate that CC-2g guarantees a serializable execution. It suffices to show that CC-2g takes the same decision as Ser-2g for each element – locally if it is safe to do so, and otherwise deferring the computation to the server. As an immediate consequence of serializability, we recover the optimal approximation guarantees of the serial Ser-2g algorithm. 6.3 Scalability of CC-2g Whenever a transaction is reconstructed on the server, the server needs to wait for all earlier elements to be committed, and is also blocked from committing all later elements. Each failed transaction effectively constitutes a barrier to the parallel processing. Hence, the scalability of CC-2g is dependent on the number of failed transactions. We can directly bound the number of failed transactions (details in Appendix D) for both the max-cut and set cover example problems. For the max-cut problem with a maximum inter-processor message 6 delay τ we obtain the upper bound 2τ #edges N . Similarly for set cover the expected number of failed transactions is upper-bounded by 2τ. As a consequence, the coordination costs of CC-2g grows at the same rate as the reduction in accuracy of CF-2g. Moreover, the CC-2g algorithm will slow down in settings where the CF-2g algorithm produces sub-optimal solutions. 7 Evaluation We implemented the parallel and serial double greedy algorithms in Java / Scala. Experiments were conducted on Amazon EC2 using one cc2.8xlarge machine, up to 16 threads, for 10 repetitions. We measured the runtime and speedup (ratio of runtime on 1 thread to runtime on p threads). For CF-2g, we measured F(ACF ) −F(ASer), the difference between the objective value on the sets returned by CF-2g and Ser-2g. We verified the correctness of CC-2g by comparing the output of CC-2g with Ser-2g. We also measured the fraction of transactions that fail in CC-2g. Our parallel algorithms were tested on the max graph cut and set cover problems with two synthetic graphs and three real datasets (Table 1). We found that vertices were typically indexed such that nearby vertices in the graph were also close in their indices. To reduce this dependency, we randomly permuted the ordering of vertices. Graph # vertices # edges Description Erdos-Renyi 20,000,000 ≈2 × 109 Each edge is included with probability 5 × 10−6. ZigZag 25,000,000 2,025,000,000 Expander graph. The 81-regular zig-zag product between the Cayley graph on Z2500000 with generating set {±1, . . . , ±5}, and the complete graph K10. Friendster 10,000,000 625,279,786 Subgraph of social network. [21] Arabic-2005 22,744,080 631,153,669 2005 crawl of Arabic web sites [22, 23, 24]. UK-2005 39,459,925 921,345,078 2005 crawl of the .uk domain [22, 23, 24]. IT-2004 41,291,594 1,135,718,909 2004 crawl of the .it domain [22, 23, 24]. Table 1: Synthetic and real graphs used in the evaluation of our parallel algorithms. 0 5 10 15 0 0.5 1 1.5 2 2.5 3 # threads Runtime relative to sequential Runtime, relative to sequential Ser−2g CC−2g CF−2g (a) 0 5 10 15 0 5 10 15 # threads Speedup Speedup for Max Graph Cut Ideal CC−2g, IT−2004 CF−2g, IT−2004 CC−2g, ZigZag CF−2g, ZigZag (b) 0 5 10 15 0 5 10 15 # threads Speedup Speedup for Set Cover Ideal CC−2g, IT−2004 CF−2g, IT−2004 CC−2g, ZigZag CF−2g, ZigZag (c) 0 5 10 15 −1 0 1 2 3 4x 10 −3 # threads % decrease in F(A) CF−2g % Decrease in F(A) Max Graph Cut Friendster Arabic−2005 UK−2005 IT−2004 ZigZag Erdos−Renyi (d) 0 5 10 15 0 1 2 3 4x 10 −4 # threads % decrease in F(A) CF−2g % Decrease in F(A) Set Cover Friendster Arabic−2005 UK−2005 IT−2004 ZigZag Erdos−Renyi (e) 0 5 10 15 0 0.005 0.01 0.015 # threads % failed txns CC−2g % Failed Txns Max Graph Cut Friendster Arabic−2005 UK−2005 IT−2004 ZigZag Erdos−Renyi (f) Figure 3: Experimental results. Fig. 3a – runtime of the parallel algorithms as a ratio to that of the serial algorithm. Each curve shows the runtime of a parallel algorithm on a particular graph for a particular function F. Fig. 3b, 3c – speedup (ratio of runtime on one thread to that on p threads). Fig. 3d, 3e – % difference between objective values of Ser-2g and CF-2g, i.e. [F(ACF )/F(ASer) −1] × 100%. Fig. 3f – percentage of transactions that fail in CC-2g on the max graph cut problem. We summarize of the key results here with more detailed experiments and discussion in Appendix G. Runtime, Speedup: Both parallel algorithms are faster than the serial algorithm with three or more threads, and show good speedup properties as more threads are added (∼10x or more for all graphs and both functions). Objective value: The objective value of CF-2g decreases with the number of threads, but differs from the serial objective value by less than 0.01%. Failed transactions: CC-2g fails more transactions as threads are added, but even with 16 threads, less than 0.015% transactions fail, which has negligible effect on the runtime / speedup. 7 0 5 10 15 0 50 100 150 200 250 300 Runtime on EC2: Ring Set Cover Number of threads Runtime / s Ser−2g CC−2g CF−2g (a) 0 5 10 15 0 5 10 15 Speed−up on EC2: Ring Set Cover Number of threads Speed−up factor Ideal CC−2g CF−2g (b) 0 5 10 15 0 0.2 0.4 0.6 0.8 1 CC−2g: Fraction of txns failed Number of threads Ring Set Cover 0 5 10 15 0 0.2 0.4 0.6 0.8 1 CF−2g: Fraction of F(A) decrease CC−2g: failed txns CC2F: F(A) decrease (c) Figure 4: Experimental results for set cover problem on a ring expander graph demonstrating that for adversarially constructed inputs we can reduce the optimality of CF-2g and increase coordination costs for CC-2g. 7.1 Adversarial ordering To highlight the differences in approaches between the two parallel algorithms, we conducted experiments on a ring Cayley expander graph on Z106 with generating set {±1, . . . , ±1000}. The algorithms are presented with an adversarial ordering, without permutation, so vertices close in the ordering are adjacent to one another, and tend to be processed concurrently. This causes CF-2g to make more mistakes, and CC-2g to fail more transactions. While more sophisticated partitioning schemes could improve scalability and eliminate the effect of adversarial ordering, we use the default data partitioning in our experiments to highlight the differences between the two algorithms. As Fig. 4 shows, CC-2g sacrifices speed to ensure a serializable execution, eventually failing on > 90% of transactions. On the other hand, CF-2g focuses on speed, resulting in faster runtime, but achieves an objective value that is 20% of F(ASer). We emphasize that we contrived this example to highlight differences between CC-2g and CF-2g, and we do not expect to see such orderings in practice. 8 Related Work Similar approach: Coordination-free solutions have been proposed for stochastic gradient descent [25] and collapsed Gibbs sampling [26]. More generally, parameter servers [27, 28] apply the CF approach to larger classes of problems. Pan et al. [29] applied concurrency control to parallelize some unsupervised learning algorithms. Similar problem: Distributed and parallel greedy submodular maximization is addressed in [1, 15, 16], but only for monotone functions. 9 Conclusion and Future Work By adopting the transaction processing model from parallel database systems, we presented two approaches to parallelizing the double greedy algorithm for unconstrained submodular maximization. We quantified the weaker approximation guarantee of CF-2g and the additional coordination of CC-2g, allowing one to trade off between performance and objective optimality. Our evaluation on large scale data demonstrates the scalability and tradeoffs of the two approaches. Moreover, as the approximation quality of the CF-2g algorithm decreases so does the scalability of the CC-2g algorithm. The choice between the algorithm then reduces to a choice of guaranteed performance and guaranteed optimality. We believe there are a number of areas for future work. One can imagine a system that allows a smooth interpolation between CF-2g and CC-2g. While both CF-2g and CC-2g can be immediately implemented as distributed algorithms, higher communication costs and delays may pose additional challenges. Finally, other problems such as constrained maximization of monotone / non-monotone functions could potentially be parallelized with the CF and CC frameworks. Acknowledgments. This research is supported in part by NSF CISE Expeditions Award CCF-1139158, LBNL Award 7076018, and DARPA XData Award FA8750-12-2-0331, and gifts from Amazon Web Services, Google, SAP, The Thomas and Stacey Siebel Foundation, Adobe, Apple, Inc., Bosch, C3Energy, Cisco, Cloudera, EMC, Ericsson, Facebook, GameOnTalis, Guavus, HP, Huawei, Intel, Microsoft, NetApp, Pivotal, Splunk, Virdata, VMware, and Yahoo!. This research was in part funded by the Office of Naval Research under contract/grant number N00014-11-1-0688. X. Pan’s work is also supported by a DSO National Laboratories Postgraduate Scholarship. 8 References [1] B. Mirzasoleiman, A. Karbasi, R. Sarkar, and A. Krause. Distributed submodular maximization: Identifying representative elements in massive data. In Advances in Neural Information Processing Systems 26. 2013. [2] N. Buchbinder, M. Feldman, J. Naor, and R. Schwartz. A tight linear time (1/2)-approximation for unconstrained submodular maximization. In FOCS, 2012. [3] A. Krause and C. Guestrin. Submodularity and its applications in optimized information gathering: An introduction. ACM Transactions on Intelligent Systems and Technology, 2(4), 2011. [4] G. Kim, E. P. Xing, F. Li, and T. Kanade. Distributed cosegmentation via submodular optimization on anisotropic diffusion. In Int. Conference on Computer Vision (ICCV), 2011. [5] J. Gillenwater, A. Kulesza, and B. Taskar. Near-optimal MAP inference for determinantal point processes. In Advances in Neural Information Processing Systems (NIPS), 2012. [6] D. Kempe, J. Kleinberg, and E. Tardos. Maximizing the spread of influence through a social network. In ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), 2003. [7] H. Lin and J. Bilmes. A class of submodular functions for document summarization. In The 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, 2011. [8] 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. [9] L. S. Shapley. Cores of convex games. International Journal of Game Theory, 1(1):11–26, 1971. [10] A. Frank. Submodular functions in graph theory. Discrete Mathematics, 111:231–243, 1993. [11] A. Schrijver. Combinatorial Optimization – Polyhedra and efficiency. Springer, 2002. [12] A. Krause and S. Jegelka. Submodularity in machine learning – new directions. ICML Tutorial, 2013. [13] J. Bilmes. Deep mathematical properties of submodularity with applications to machine learning. NIPS Tutorial, 2013. [14] A. Badanidiyuru and J. Vondr´ak. Fast algorithms for maximizing submodular functions. In SODA, 2014. [15] R. Kumar, B. Moseley, S. Vassilvitskii, and A. Vattani. Fast greedy algorithms in MapReduce and streaming. In SPAA, 2013. [16] K. Wei, R. Iyer, and J. Bilmes. Fast multi-stage submodular maximization. In Int. Conference on Machine Learning (ICML), 2014. [17] C. Reed and Z. Ghahramani. Scaling the Indian Buffet Process via submodular maximization. In Int. Conference on Machine Learning (ICML), 2013. [18] A. Krause and E. Horvitz. A utility-theoretic approach to privacy in online services. JAIR, 39, 2010. [19] M. Tamer Ozsu. Principles of Distributed Database Systems. Prentice Hall Press, Upper Saddle River, NJ, USA, 3rd edition, 2007. ISBN 9780130412126. [20] H. Kung and J.T. Robinson. On optimistic methods for concurrency control. TODS, 6(2), 1981. [21] J. Leskovec. Stanford network analysis project, 2011. URL http://snap.stanford.edu/. [22] P. Boldi and S. Vigna. The WebGraph framework I: Compression techniques. In WWW, 2004. [23] P. Boldi, M. Rosa, M. Santini, and S. Vigna. Layered label propagation: A multiresolution coordinate-free ordering for compressing social networks. In WWW. ACM Press, 2011. [24] P. Boldi, B. Codenotti, M. Santini, and S. Vigna. Ubicrawler: A scalable fully distributed web crawler. Software: Practice & Experience, 34(8):711–726, 2004. [25] B. Recht, C. Re, S.J. Wright, and F. Niu. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In Advances in Neural Information Processing Systems (NIPS) 24, Granada, 2011. [26] A. Ahmed, M. Aly, J. Gonzalez, S. Narayanamurthy, and A.J. Smola. Scalable inference in latent variable models. In Proc. of the 5th ACM International Conference on Web Search and Data Mining, 2012. [27] Mu Li, Li Zhou, Zichao Yang, Aaron Li, Fei Xia, David G Andersen, and Alexander Smola. Parameter server for distributed machine learning. In Big Learn workshop, at NIPS, Lake Tahoe, 2013. [28] Q. Ho, J. Cipar, H. Cui, S. Lee, J.K. Kim, P.B. Gibbons, G.A. Gibson, G. Ganger, and E. Xing. More effective distributed ml via a stale synchronous parallel parameter server. In NIPS. 2013. [29] X. Pan, J.E. Gonzalez, S. Jegelka, T. Broderick, and M.I. Jordan. Optimistic concurrency control for distributed unsupervised learning. In Advances in Neural Information Processing Systems 26. 2013. 9
2014
382
5,494
Efficient Optimization for Average Precision SVM Pritish Mohapatra IIIT Hyderabad pritish.mohapatra@research.iiit.ac.in C.V. Jawahar IIIT Hyderabad jawahar@iiit.ac.in M. Pawan Kumar Ecole Centrale Paris & INRIA Saclay pawan.kumar@ecp.fr Abstract The accuracy of information retrieval systems is often measured using average precision (AP). Given a set of positive (relevant) and negative (non-relevant) samples, the parameters of a retrieval system can be estimated using the AP-SVM framework, which minimizes a regularized convex upper bound on the empirical AP loss. However, the high computational complexity of loss-augmented inference, which is required for learning an AP-SVM, prohibits its use with large training datasets. To alleviate this deficiency, we propose three complementary approaches. The first approach guarantees an asymptotic decrease in the computational complexity of loss-augmented inference by exploiting the problem structure. The second approach takes advantage of the fact that we do not require a full ranking during loss-augmented inference. This helps us to avoid the expensive step of sorting the negative samples according to their individual scores. The third approach approximates the AP loss over all samples by the AP loss over difficult samples (for example, those that are incorrectly classified by a binary SVM), while ensuring the correct classification of the remaining samples. Using the PASCAL VOC action classification and object detection datasets, we show that our approaches provide significant speed-ups during training without degrading the test accuracy of AP-SVM. 1 Introduction Information retrieval systems require us to rank a set of samples according to their relevance to a query. The parameters of a retrieval system can be estimated by minimizing the prediction risk on a training dataset, which consists of positive and negative samples. Here, positive samples are those that are relevant to a query, and negative samples are those that are not relevant to the query. Several risk minimization frameworks have been proposed in the literature, including structured support vector machines (SSVM) [15, 16], neural networks [14], decision forests [11] and boosting [13]. In this work, we focus on SSVMs for clarity while noting the methods we develop are also applicable to other learning frameworks. The SSVM framework provides a linear prediction rule to obtain a structured output for a structured input. Specifically, the score of a putative output is the dot product of the parameters of an SSVM with the joint feature vector of the input and the output. The prediction requires us to maximize the score over all possible outputs for an input. During training, the parameters of an SSVM are estimated by minimizing a regularized convex upper bound on a user-specified loss function. The loss function measures the prediction risk, and should be chosen according to the evaluation criterion for the system. While in theory the SSVM framework can be employed in conjunction with any loss function, in practice its feasibility depends on the computational efficiency of the corresponding lossaugmented inference. In other words, given the current estimate of the parameters, it is important to be able to efficiently maximize the sum of the score and the loss function over all possible outputs. 1 A common measure of accuracy for information retrieval is average precision (AP), which is used in several standard challenges such as the PASCAL VOC object detection, image classification and action classification tasks [7], and the TREC Web Track corpora. The popularity of AP inspired Yue et al. [19] to propose the AP-SVM framework, which is a special case of SSVM. The input of APSVM is a set of samples, the output is a ranking and the loss function is one minus the AP of the ranking. In order to learn the parameters of an AP-SVM, Yue et al. [19] developed an optimal greedy algorithm for loss-augmented inference. Their algorithm consists of two stages. First, it sorts the positive samples P and the negative samples N separately in descending order of their individual scores. The individual score of a sample is equal to the dot product of the parameters with the feature vector of the sample. Second, starting from the negative sample with the highest score, it iteratively finds the optimal interleaving rank for each of the |N| negative samples. The interleaving rank for a negative sample is the index of the highest ranked positive sample ranked below it. which requires at most O(|P|) time per iteration. The overall algorithm is described in detail in the next section. Note that, typically |N| ≫|P|, that is, the negative samples significantly outnumber the positive samples. While the AP-SVM has been successfully applied for ranking using high-order information in mid to large size datasets [5], many methods continue to use the simpler binary SVM framework for large datasets. Unlike AP-SVM, a binary SVM optimizes the surrogate 0-1 loss. Its main advantage is the efficiency of the corresponding loss-augmented inference algorithm, which has a complexity of O(|P| + |N|). However, this gain in training efficiency often comes at the cost of a loss in testing accuracy, which is especially significant when training with weakly supervised datasets [1]. In order to facilitate the use of AP-SVM, we present three complementary approaches to speed-up its learning. Our first approach exploits an interesting structure in the problem corresponding to the computation of the rank of the j-th negative sample. Specifically, we show that when j > |P|, the rank of the j-th negative sample is obtained by maximizing a discrete unimodal function. Here, a discrete function defined over points {1, · · · , p} is said to be unimodal if it is non-decreasing from {1, · · · , k} and non-increasing from {k, · · · , p} for some k ∈{1, · · · , p}. Since the mode of a discrete unimodal function can be computed efficiently using binary search, it reduces the computational complexity of computing the rank of the j-th negative sample from O(|P|) to O(log(|P|)). To the best of our knowledge, ours is the first work to improve the speed of loss-augmented inference for AP-SVM by taking advantage of the special structure of the problem. Unlike [2] which proposes an efficient method for a similar framework of structured output ranking, our method optimizes the APloss. Our second approach relies on the fact that in many cases we do not need to explicitly compute the optimal interleaving rank for all the negative samples. Specifically, we only need to compute the interleaving rank for the set of negative samples that would have an interleaving rank of less than |P| + 1. We identify this set using a binary search over the list of negative samples. While training, after the initial few training iterations the size of this set rapidly reduces, allowing us to significantly reduce the training time in practice. Our third approach uses the intuition that the 0-1 loss and the AP loss differ only when some of the samples are difficult to classify (that is, some positive samples that can be confused as negatives and vice versa). In other words, when the 0-1 loss over the training dataset is 0, then the AP loss is also 0. Thus, instead of optimizing the AP loss over all the samples, we adopt a two-stage approximate strategy. In the first stage, we identify a subset of difficult samples (specifically, those that are incorrectly classified by a binary SVM). In the second stage, we optimize the AP loss over the subset of difficult samples, while ensuring the correct classification of the remaining easy samples. Using the PASCAL VOC action classification and object detection datasets, we empirically demonstrate that each of our approaches greatly reduces the training time of AP-SVM while not decreasing the testing accuracy. 2 The AP-SVM Framework We provide a brief overview of the AP-SVM framework, highlighting only those aspects that are necessary for the understanding of this paper. For a detailed description, we refer the reader to [19]. Input and Output. The input of an AP-SVM is a set of n samples, which we denote by X = {xi, i = 1, · · · , n}. Each sample can either belong to the positive class (that is, the sample is 2 relevant) or the negative class (that is, the sample is not relevant). The indices for the positive and negative samples are denoted by P and N respectively. In other words, if i ∈P and j ∈N then xi belongs to positive class and xj belongs to the negative class. The desired output is a ranking matrix R of size n × n, such that (i) Rij = 1 if xi is ranked higher than xj; (ii) Rij = −1 if xi is ranked lower than xj; and (iii) Rij = 0 if xi and xj are assigned the same rank. During training, the ground-truth ranking matrix R∗is defined as: (i) R∗ ij = 1 and R∗ ji = −1 for all i ∈P and j ∈N; (ii) R∗ ii′ = 0 and R∗ jj′ = 0 for all i, i′ ∈P and j, j′ ∈N. Joint Feature Vector. For a sample xi, let ψ(xi) denote its feature vector. The joint feature vector of the input X and an output R is specified as Ψ(X, R) = 1 |P||N| X i∈P X j∈N Rij(ψ(xi) −ψ(xj)). (1) In other words, the joint feature vector is the scaled sum of the difference between the features of all pairs of samples, where one sample is positive and the other is negative. Parameters and Prediction. The parameter vector of AP-SVM is denoted by w, and is of the same size as the joint feature vector. Given the parameters w, the ranking of an input X is predicted by maximizing the score, that is, R = argmax R w⊤Ψ(X, R). (2) Yue et al. [19] showed that the above optimization can be performed efficiently by sorting the samples xk in descending order of their individual scores, that is, sk = w⊤ψ(xk). Parameter Estimation. Given the input X and the ground-truth ranking matrix R∗, we estimate the AP-SVM parameters by optimizing a regularized upper bound on the empirical AP loss. The AP loss of an output R is defined as 1 −AP(R∗, R), where AP(·, ·) corresponds to the AP of the ranking R with respect to the true ranking R∗. Specifically, the parameters are obtained by solving the following convex optimization problem: min w 1 2||w||2 + Cξ, (3) s.t. w⊤Ψ(X, R∗) −w⊤Ψ(X, R) ≥∆(R∗, R) −ξ, ∀R The computational complexity of solving the above problem depends on the complexity of the corresponding loss-augmented inference, that is, ˆR = argmax R w⊤Ψ(X, R) + ∆(R∗, R). (4) For a given set of parameters w, the above problem requires us to find the most violated ranking, that is, the ranking that maximizes the sum of the score and the AP loss. To be more precise, what we require is the joint feature vector Ψ(X, ˆR) and the AP loss ∆(R∗, ˆR) corresponding to the most violated ranking. Yue et al. [19] provided an optimal greedy algorithm for problem (4), which is summarized in Algorithm 1. It consists of two stages. First, it sorts the positive and the negative samples separately in descending order of their scores (steps 1-2). This takes O(|P| log(|P|) + |N| log(|N|)) time. Second, starting with the highest scoring negative sample, it iteratively finds the interleaving rank of each negative sample xj. This involves maximizing the quantity δj(i), defined in equation (5), over all i ∈{1, · · · , |P|} (steps 3-7), which takes O(|P||N|) time. 3 Efficient Optimization for AP-SVM In this section, we propose three methods to speed up the training procedure of AP-SVM. The first two methods are exact. Specifically, they reduce the time taken to perform loss-augmented inference while ensuring the computation of the same most violated ranking as Algorithm 1. The third method provides a framework for a sensible trade-off between training efficiency and test accuracy. 3.1 Efficient Search for Loss-Augmented Inference In order to find the most violated ranking, the greedy algorithm of Yue et al. [19] iteratively computes the optimal interleaving rank optj ∈{1, · · · , |P| + 1} for each negative sample xj (step 5 3 Algorithm 1 The optimal greedy algorithm for loss-augmented inference for training AP-SVM. input Training samples X containing positive samples P and negative samples N, parameters w. 1: Sort the positive samples in descending order of the scores sp i = w⊤ψ(xi), i ∈{1, . . . , |P|}. 2: Sort the negative samples in descending order of the scores sn j = w⊤ψ(xj), j ∈{1, . . . , |N|}. 3: Set j = 1. 4: repeat 5: Compute the interleaving rank optj = argmaxi∈{1,··· ,|P|} δj(i), where δj(i) = |P| X k=i  1 |P|  j j + k − j −1 j + k −1  −2(sp k −sn j ) |P||N|  . (5) The j-th negative sample is ranked between the (optj −1)-th and the optj-th positive sample. 6: Set j ←j + 1. 7: until j > |N|. of Algorithm 1). The interleaving rank optj specifies that the negative sample xj must be ranked between the (optj −1)-th and the optj-th positive sample. The computation of the optimal interleaving rank for a particular negative sample requires us to maximize the discrete function δj(i) over the domain i ∈{1, · · · , |P|}. Yue et al. [19] use a simple linear algorithm for this step, which takes O(|P|) time. In contrast, we propose a more efficient algorithm to maximize δj(·), which exploits the special structure of this discrete function. Before we describe our efficient algorithm in detail, we require the definition of a unimodal function. A discrete function f : {1, · · · , p} ←R is said to be unimodal if and only if there exists a k ∈ {1, · · · , p} such that f(i) ≤f(i + 1), ∀i ∈{1, · · · , k −1}, f(i −1) ≥f(i), ∀i ∈{k + 1, · · · , p}. (6) In other words, a unimodal discrete function is monotonically non-decreasing in the interval [1, k] and monotonically non-increasing in the interval [k, p]. The maximization of a unimodal discrete function over its domain {1, · · · , p} simply requires us to find the index k that satisfies the above properties. The maximization can be performed efficiently, in O(log(p)) time, using binary search. We are now ready to state the main result that allows us to compute the optimal interleaving rank of a negative sample efficiently. Proposition 1. The discrete function δj(i), defined in equation (5), is unimodal in the domain {1, · · · , p}, where p = min{|P|, j}. The proof of the above proposition is provided in Appendix A (supplementary material). Algorithm 2 Efficient search for the optimal interleaving rank of a negative sample. input {δj(i), i = 1, · · · , |P|}. 1: p = min{|P|, j}. 2: Compute an interleaving rank i1 as ii = argmax i∈{1,··· ,p} δj(i). (7) 3: Compute an interleaving rank i2 as i2 = argmax i∈{p+1,··· ,|P|} δj(i). (8) 4: Compute the optimal interleaving rank optj as optj =  i1 if δj(i1) ≥δj(i2), i2 otherwise. (9) 4 Using the above proposition, the discrete function δj(i) can be optimized over the domain {1, · · · , |P|} efficiently as described in Algorithm 2. Briefly, our efficient search algorithm finds an interleaving ranking i1 over the domain {1, · · · , p}, where p is set to min{|P|, j} in order to ensure that the function δj(·) is unimodal (step 2 of Algorithm 2). Since i1 can be computed using binary search, the computational complexity of this step is O(log(p)). Furthermore, we find an interleaving ranking i2 over the domain {p + 1, · · · , |P|} (step 3 of Algorithm 2). Since i2 needs to be computed using linear search, the computational complexity of this step is O(|P| −p) when p < |P| and 0 otherwise. The optimal interleaving ranking optj of the negative sample xj can then be computed by comparing the values of δj(i1) and δj(i2) (step 4 of Algorithm 2). Note that, in a typical training dataset, the negative samples significantly outnumber the positive samples, that is, |N| ≫|P|. For all the negative samples xj where j ≥|P|, p will be equal to |P|. Hence, the maximization of δj(·) can be performed efficiently over the entire domain {1, · · · , |P|} using binary search in O(log(|P|)) as opposed to the O(|P|) time suggested in [19]. 3.2 Selective Ranking for Loss-Augmented Inference While the efficient search algorithm described in the previous subsection allows us to find the optimal interleaving rank for a particular negative sample, the overall loss-augmented inference would still remain computationally inefficient when the number of negative samples is large (as is typically the case). This is due to the following two reasons. First, loss-augmented inference spends a considerable amount of time sorting the negative samples according to their individual scores (step 2 of Algorithm 1). Second, if we were to apply our efficient search algorithm to every negative sample, the total computational complexity of the second stage of loss-augmented inference (step 3-7 of Algorithm 1) will still be O(|P|2 + (|N| −|P|) log(|P|)). In order to overcome the above computational issues, we exploit two key properties of lossaugmented inference in AP-SVM. First, if a negative sample xj has the optimal interleaving rank optj = |P| + 1, then all the negative samples that have lower score than xj would also have the same optimal interleaving rank (that is, optk = optj = |P| + 1 for all k > j). This property follows directly from the analysis of Yue et al. [19] who showed that, for k < j, optk ≥optj and for any negative sample xj, optj ∈[1, |P| + 1]. We refer the reader to [19] for a detailed proof. Second, we note that the desired output of loss-augmented inference is not the most violated ranking ˆR, but the joint feature vector Ψ(X, ˆR) and the AP loss AP(R∗, ˆR). From the definition of the joint feature vector and the AP loss, it follows that they do not depend on the relative ranking of the negative samples that share the same optimal interleaving rank. Specifically, both the joint feature vector and the AP loss only depend on the number of negatives that are ranked higher and lower than each positive sample. Figure 1: A row corresponds to the interleaving ranks of the negative samples after a training iteration. Here, there are 4703 negative samples, and 131 training iterations. The interleaving ranks are represented using a heat map where the deepest red represents interleaving rank of |P| + 1. (The figure is best viewed in colour.) The above two observations suggest the following alternate strategy to Algorithm 1. Instead of explicitly computing the optimal interleaving rank for each negative sample (which can be computationally expensive), we compute it only for negative samples that are expected to have optimal interleaving rank less than |P|+ 1. Algorithm 3 outlines the procedure we propose in detail. We first find the score ˆs such that every negative sample xj with score sn j < ˆs has optj = |P| + 1. We do a binary search over the list of scores of negative samples to find ˆs (step 4 of algorithm 3). We do not need to sort the scores of all the negative samples, as we use the quick select algorithm to find the k-th highest score wherever required. If the output of the loss-augmented inference is such that a large number of negative samples have optimal interleaving rank as |P| + 1, then this alternate strategy would result in a significant speed-up during training. In our experiments, we found that in later iterations of the optimization, this is indeed the case in practice. Figure 1 shows how the number of negative samples with optimal interleaving rank equal to |P| + 1, rapidly increases after 5 Algorithm 3 The selective ranking algorithm for loss-augmented inference in AP-SVM. input Sx, S ¯x, |P|, |N| 1: Sort the positive samples in descending order of their scores Sx. 2: Do binary search over S ¯x to find ˆs. 3: Set Nl =  j ∈N|sn j < ˆs 4: Sort Nl in descending order of the scores. 5: for all j ∈Nl do 6: Compute optj using Algorithm 2. 7: end for 8: Set Nr = N −Nl. 9: for all j ∈Nr do 10: Set optj = |P| + 1. 11: end for output optj , ∀j ∈N a few training iterations for a typical experiment. A large number of negative samples have optimal interleaving rank equal to |P| + 1, while the negative samples that have other values of optimal interleaving rank decrease considerably. It would be worth taking note that here, even though we take advantage of the fact that a long sequence of negative samples at the end of the list take the same optimal interleaving rank, such sequences also occur at other locations throughout the list. This can be leveraged for further speedup by computing the interleaving rank for only the boundary samples of such sequences and setting all the intermediate samples to the same interleaving rank as the boundary samples. We can use a method similar to the one presented in this section to search for such sequences by using the quick select algorithm to compute the interleaving rank for any particular negative sample on the list. 3.3 Efficient Approximation of AP-SVM The previous two subsections provide exact algorithms for loss-augmented inference that reduce the time require for training an AP-SVM. However, despite these improvements, AP-SVM might be slower to learn compared to simpler frameworks such as the binary SVM, which optimizes the surrogate 0-1 loss. The disadvantage of using the binary SVM is that, in general, the 0-1 loss is a poor approximation for the AP loss. However, the quality of the approximation is not uniformly poor for all samples, but depends heavily on their separability. Specifically, when the 0-1 loss of a set of samples is 0 (that is, they are linearly separable by a binary SVM), their AP loss is also 0. This observation inspires us to approximate the AP loss over the entire set of training samples using the AP loss over the subset of difficult samples. In this work, we define the subset of difficult samples as those that are incorrectly classified by a simple binary SVM. Formally, given the complete input X and the ground-truth ranking matrix R∗, we represent individual samples as xi and their class as yi. In other words, yi = 1 if i ∈P and yi = −1 if i ∈N. In order to approximate the AP-SVM, we adopt a two stage strategy. In the first stage, we learn a binary SVM by minimizing the regularized convex upper bound on the 0-1 loss over the entire training set. Since the loss-augmented inference for 0-1 loss is very fast, the parameters w0 of the binary SVM can be estimated efficiently. We use the binary SVM to define the set of easy samples as Xe = {xi, yiw⊤ 0 φi(x) ≥1}. In other words, a positive sample is easy if it is assigned a score that is greater than 1 by the binary SVM. Similarly, a negative sample is easy if it is assigned a score that is less than -1 by the binary SVM. The remaining difficult samples are denoted by Xd = X −Xe and the corresponding ground-truth ranking matrix by R∗ d. In the second stage, we approximate the AP loss over the entire set of samples X by the AP loss over the difficult samples Xd while ensuring that the samples Xe are correctly classified. In order to accomplish this, we solve the following optimization problem: min w 1 2||w||2 + Cξ s.t. w⊤Ψ(Xd, R∗ d) −w⊤Ψ(Xd, Rd) ≥∆(R∗ d, Rd) −ξ, ∀Rd, yi w⊤φ(xi)  > 1, ∀xi ∈Xe. (10) 6 In practice, we can choose to retain only the top k% of Xe ranked in descending order of their score and push the remaining samples into the difficult set Xd. This gives the AP-SVM more flexibility to update the parameters at the cost of some additional computation. 4 Experiments We demonstrate the efficacy of our methods, described in the previous section, on the challenging problems of action classification and object detection. 4.1 Action Classification Dataset. We use the PASCAL VOC 2011 [7] action classification dataset for our experiments. This dataset consists of 4846 images, which include 10 different action classes. The dataset is divided into two parts: 3347 ‘trainval’ person bounding boxes and 3363 ‘test’ person bounding boxes. We use the ‘trainval’ bounding boxes for training since their ground-truth action classes are known. We evaluate the accuracy of the different instances of SSVM on the ‘test’ bounding boxes using the PASCAL evaluation server. Features. We use the standard poselet [12] activation features to define the sample feature for each person bounding box. The feature vector consists of 2400 action poselet activations and 4 object detection scores. We refer the reader to [12] for details regarding the feature vector. Methods. We present results on five different methods. First, the standard binary SVM, which optimizes the 0-1 loss. Second, the standard AP-SVM, which uses the inefficient loss-augmented inference described in Algorithm 1. Third, AP-SVM-SEARCH, which uses efficient search to compute the optimal interleaving rank for each negative sample using Algorithm 2. Fourth, AP-SVMSELECT, which uses the selective ranking strategy outlined in Algorithm 3. Fifth, AP-SVM-APPX, which employs the approximate AP-SVM framework described in subsection 3.3. Note that, APSVM, AP-SVM-SEARCH and AP-SVM-SELECT are guaranteed to provide the same set of parameters since both efficient search and selective ranking are exact methods. The hyperparameters of all five methods are fixed using 5-fold cross-validation on the ‘trainval’ set. Results. Table 1 shows the AP for the rankings obtained by the five methods for ‘test’ set. Note that AP-SVM (and therefore, AP-SVM-SEARCH and AP-SVM-SELECT) consistently outperforms binary SVM by optimizing a more appropriate loss function during training. The approximate AP-SVMAPPX provides comparable results to the exact AP-SVM formulations by optimizing the AP loss over difficult samples, while ensuring the correct classification of easy samples. The time required to compute the most violated rankings for each of the five methods in shown in Table 2. Note that all three methods described in this paper result in substantial improvement in training time. The overall time required for loss-augmented inference is reduced by a factor of 5 −10 compared to the original AP-SVM approach. It can also be observed that though each loss-augmented inference step for binary SVM is significantly more efficient than for AP-SVM (Table 3), in some cases we observe that we required more cutting plane iterations for binary SVM to converge. As a result, in some cases training binary SVM is slower than training AP-SVM with our proposed speed-ups. Object class Binary SVM AP-SVM AP-SVM-APPX k=25% k=50% k=75% Jumping 52.580 55.230 54.660 55.640 54.570 Phoning 32.090 32.630 31.380 30.660 29.610 Playing instrument 35.210 41.180 40.510 38.650 37.260 Reading 27.410 26.600 27.100 25.530 24.980 Riding bike 72.240 81.060 80.660 79.950 78.660 Running 73.090 76.850 75.720 74.670 72.550 Taking photo 21.880 25.980 25.360 23.680 22.860 Using computer 30.620 32.050 32.460 32.810 32.840 Walking 54.400 57.090 57.380 57.430 55.790 Riding horse 79.820 83.290 83.650 83.560 82.390 Table 1: Test AP for the different action classes of PASCAL VOC 2011 action dataset. For AP-SVMAPPX, we report test results for 3 different values of k, which is the percentage of samples that are included in the easy set among all the samples that the binary SVM had classified with margin > 1. 7 Binary SVM AP-SVM AP-SVM-SEARCH AP-SVM-SELECT AP-SVM-APPX (K=50) ALL 0.1068 0.5660 0.0671 0.0404 0.2341 0.0251 Table 2: Computation time (in seconds) for computing the most violated ranking when using the different methods. The reported time is averaged over the training for all the action classes. Binary SVM AP-SVM AP-SVM-SEARCH AP-SVM-SELECT AP-SVM-APPX (K=50) ALL 0.637 13.192 1.565 0.942 8.217 0.689 Table 3: Computation time (in milli-seconds) for computing the most violated ranking per iteration when using the different methods. The reported time is averaged over all training iterations and over all the action classes. 4.2 Object Detection Dataset. We use the PASCAL VOC 2007 [6] object detection dataset, which consists of a total of 9963 images. The dataset is divided into a ‘trainval’ set of 5011 images and a ‘test’ set of 4952 images. All the images are labelled to indicate the presence or absence of the instances of 20 different object categories. In addition, we are also provided with tight bounding boxes around the object instances, which we ignore during training and testing. Instead, we treat the location of the objects as a latent variable. In order to reduce the latent variable space, we use the selective-search algorithm [17] in its fast mode, which generates an average of 2000 candidate windows per image. Features. For each of the candidate windows, we use a feature representation that is extracted from a trained Convolutional Neural Network (CNN). Specifically, we pass the image as input to the CNN and use the activation vector of the penultimate layer of the CNN as the feature vector. Inspired by the work of Girshick et al. [9], we use the CNN that is trained on the ImageNet dataset [4], by rescaling each candidate window to a fixed size of 224 × 224. The length of the resulting feature vector is 4096. Methods. We train latent AP-SVMs [1] as object detectors for 20 object categories. In our experiments, we determine the value of the hyperparameters using 5-fold cross-validation. During testing, we evaluate each candidate window generated by selective search, and use non-maxima suppression to prune highly overlapping detections. Results. This experiment places high computational demands due to the size of the dataset (5011 ‘trainval’ images), as well as the size of the latent space (2000 candidate windows per image). We compare the computational efficiency of the loss-augmented inference algorithm proposed in [19] and the exact methods proposed by us. The total time taken for loss-augmented inference during training, averaged over the all the 20 classes, is 0.3302 sec for our exact methods (SEARCH+SELECT) which is significantly better than the 6.237 sec taken by the algorithm used in [19]. 5 Discussion We proposed three complementary approaches to improve the efficiency of learning AP-SVM. The first two approaches exploit the problem structure to speed-up the computation of the most violated ranking using exact loss-augmented inference. The third approach provides an accurate approximation of AP-SVM, which facilitates the trade-off of test accuracy and training time. As mentioned in the introduction, our approaches can also be used in conjunction with other learning frameworks, such as the popular deep convolutional neural networks. A combination of methods proposed in this paper and the speed-ups proposed in [10] may prove to be effective in such a framework. The efficacy of optimizing AP efficiently using other frameworks needs to be empirically evaluated. Another computational bottleneck of all SSVM frameworks is the computation of the joint feature vector. An interesting direction of future research would be to combine our approaches with those of sparse feature coding [3, 8, 18] to improve the speed to AP-SVM learning further. 6 Acknowledgement This work is partially funded by the European Research Council under the European Community’s Seventh Framework Programme (FP7/2007-2013)/ERC Grant agreement number 259112. Pritish is supported by the TCS Research Scholar Program. 8 References [1] A. Behl, C. V. Jawahar, and M. P. Kumar. Optimizing average precision using weakly supervised data. In CVPR, 2014. [2] M. Blaschko, A. Mittal, and E. Rahtu. An O(n log n) cutting plane algorithm for structured output ranking. In GCPR, 2014. [3] X. Boix, G. Roig, C. Leistner, and L. Van Gool. Nested sparse quantization for efficient feature coding. In ECCV. 2012. [4] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR, 2009. [5] P. Dokania, A. Behl, C. V. Jawahar, and M. P. Kumar. Learning to rank using high-order information. In ECCV, 2014. [6] M. Everingham, L. Van Gool, C. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2007 (VOC2007) Results. http://www.pascalnetwork.org/challenges/VOC/voc2007/workshop/index.html. [7] M. Everingham, L. Van Gool, C. Williams, J. Winn, and A. Zisserman. The PASCAL visual object classes (VOC) challenge. IJCV, 2010. [8] T. Ge, Q. Ke, and J. Sun. Sparse-coded features for image retrieval. In BMVC, 2013. [9] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, 2014. [10] M. Jaderberg, A. Vedaldi, and A. Zisserman. Speeding up convolutional neural networks with low rank expansions. In BMVC, 2014. [11] D. Kim. Minimizing structural risk on decision tree classification. In Multi-Objective Machine Learning, Springer. 2006. [12] S. Maji, L. Bourdev, and J. Malik. Action recognition from a distributed representation of pose and appearance. In CVPR, 2011. [13] C. Shen, H. Li, and N. Barnes. Totally corrective boosting for regularized risk minimization. arXiv preprint arXiv:1008.5188, 2010. [14] C. Szegedy, A. Toshev, and D. Erhan. Deep neural networks for object detection. In NIPS, 2013. [15] B. Taskar, C. Guestrin, and D. Koller. Max-margin Markov networks. In NIPS, 2003. [16] I. Tsochantaridis, T. Hofmann, Y. Altun, and T. Joachims. Support vector machine learning for interdependent and structured output spaces. In ICML, 2004. [17] J. Uijlings, K. van de Sande, T. Gevers, and A. Smeulders. Selective search for object recognition. IJCV, 2013. [18] J. Yang, K. Yu, and T. Huang. Efficient highly over-complete sparse coding using a mixture model. In ECCV. 2010. [19] Y. Yue, T. Finley, F. Radlinski, and T. Joachims. A support vector method for optimizing average precision. In SIGIR, 2007. 9
2014
383
5,495
SAGA: A Fast Incremental Gradient Method With Support for Non-Strongly Convex Composite Objectives Aaron Defazio Ambiata ∗ Australian National University, Canberra Francis Bach INRIA - Sierra Project-Team ´Ecole Normale Sup´erieure, Paris, France Simon Lacoste-Julien INRIA - Sierra Project-Team ´Ecole Normale Sup´erieure, Paris, France Abstract In this work we introduce a new optimisation method called SAGA in the spirit of SAG, SDCA, MISO and SVRG, a set of recently proposed incremental gradient algorithms with fast linear convergence rates. SAGA improves on the theory behind SAG and SVRG, with better theoretical convergence rates, and has support for composite objectives where a proximal operator is used on the regulariser. Unlike SDCA, SAGA supports non-strongly convex problems directly, and is adaptive to any inherent strong convexity of the problem. We give experimental results showing the effectiveness of our method. 1 Introduction Remarkably, recent advances [1, 2] have shown that it is possible to minimise strongly convex finite sums provably faster in expectation than is possible without the finite sum structure. This is significant for machine learning problems as a finite sum structure is common in the empirical risk minimisation setting. The requirement of strong convexity is likewise satisfied in machine learning problems in the typical case where a quadratic regulariser is used. In particular, we are interested in minimising functions of the form f(x) = 1 n n X i=1 fi(x), where x ∈Rd, each fi is convex and has Lipschitz continuous derivatives with constant L. We will also consider the case where each fi is strongly convex with constant µ, and the “composite” (or proximal) case where an additional regularisation function is added: F(x) = f(x) + h(x), where h: Rd →Rd is convex but potentially non-differentiable, and where the proximal operation of h is easy to compute — few incremental gradient methods are applicable in this setting [3][4]. Our contributions are as follows. In Section 2 we describe the SAGA algorithm, a novel incremental gradient method. In Section 5 we prove theoretical convergence rates for SAGA in the strongly convex case better than those for SAG [1] and SVRG [5], and a factor of 2 from the SDCA [2] convergence rates. These rates also hold in the composite setting. Additionally, we show that ∗The first author completed this work while under funding from NICTA. This work was partially supported by the MSR-Inria Joint Centre and a grant by the European Research Council (SIERRA project 239993). 1 like SAG but unlike SDCA, our method is applicable to non-strongly convex problems without modification. We establish theoretical convergence rates for this case also. In Section 3 we discuss the relation between each of the fast incremental gradient methods, showing that each stems from a very small modification of another. 2 SAGA Algorithm We start with some known initial vector x0 ∈Rd and known derivatives f ′ i(φ0 i ) ∈Rd with φ0 i = x0 for each i. These derivatives are stored in a table data-structure of length n, or alternatively a n × d matrix. For many problems of interest, such as binary classification and least-squares, only a single floating point value instead of a full gradient vector needs to be stored (see Section 4). SAGA is inspired both from SAG [1] and SVRG [5] (as we will discuss in Section 3). SAGA uses a step size of γ and makes the following updates, starting with k = 0: SAGA Algorithm: Given the value of xk and of each f ′ i(φk i ) at the end of iteration k, the updates for iteration k + 1 is as follows: 1. Pick a j uniformly at random. 2. Take φk+1 j = xk, and store f ′ j(φk+1 j ) in the table. All other entries in the table remain unchanged. The quantity φk+1 j is not explicitly stored. 3. Update x using f ′ j(φk+1 j ), f ′ j(φk j ) and the table average: wk+1 = xk −γ " f ′ j(φk+1 j ) −f ′ j(φk j ) + 1 n n X i=1 f ′ i(φk i ) # , (1) xk+1 = proxh γ wk+1 . (2) The proximal operator we use above is defined as proxh γ (y) := argmin x∈Rd  h(x) + 1 2γ ∥x −y∥2  . (3) In the strongly convex case, when a step size of γ = 1/(2(µn+L)) is chosen, we have the following convergence rate in the composite and hence also the non-composite case: E xk −x∗ 2 ≤  1 − µ 2(µn + L) k  x0 −x∗ 2 + n µn + L  f(x0) − f ′(x∗), x0 −x∗ −f(x∗)  . We prove this result in Section 5. The requirement of strong convexity can be relaxed from needing to hold for each fi to just holding on average, but at the expense of a worse geometric rate (1 − µ 6(µn+L)), requiring a step size of γ = 1/(3(µn + L)). In the non-strongly convex case, we have established the convergence rate in terms of the average iterate, excluding step 0: ¯xk = 1 k Pk t=1 xt. Using a step size of γ = 1/(3L) we have E  F(¯xk)  −F(x∗) ≤4n k 2L n x0 −x∗ 2 + f(x0) − f ′(x∗), x0 −x∗ −f(x∗)  . This result is proved in the supplementary material. Importantly, when this step size γ = 1/(3L) is used, our algorithm automatically adapts to the level of strong convexity µ > 0 naturally present, giving a convergence rate of (see the comment at the end of the proof of Theorem 1): E xk −x∗ 2 ≤  1 −min  1 4n , µ 3L k  x0 −x∗ 2 + 2n 3L  f(x0) − f ′(x∗), x0 −x∗ −f(x∗)  . Although any incremental gradient method can be applied to non-strongly convex problems via the addition of a small quadratic regularisation, the amount of regularisation is an additional tunable parameter which our method avoids. 3 Related Work We explore the relationship between SAGA and the other fast incremental gradient methods in this section. By using SAGA as a midpoint, we are able to provide a more unified view than is available in the existing literature. A brief summary of the properties of each method considered in this section is given in Figure 1. The method from [3], which handles the non-composite setting, is not listed as its rate is of the slow type and can be up to n times smaller than the one for SAGA or SVRG [5]. 2 SAGA SAG SDCA SVRG FINITO Strongly Convex (SC)      Convex, Non-SC*    ? ? Prox Reg.  ? [6]   Non-smooth      Low Storage Cost      Simple(-ish) Proof      Adaptive to SC    ? ? Figure 1: Basic summary of method properties. Question marks denote unproven, but not experimentally ruled out cases. (*) Note that any method can be applied to non-strongly convex problems by adding a small amount of L2 regularisation, this row describes methods that do not require this trick. SAGA: midpoint between SAG and SVRG/S2GD In [5], the authors make the observation that the variance of the standard stochastic gradient (SGD) update direction can only go to zero if decreasing step sizes are used, thus preventing a linear convergence rate unlike for batch gradient descent. They thus propose to use a variance reduction approach (see [7] and references therein for example) on the SGD update in order to be able to use constant step sizes and get a linear convergence rate. We present the updates of their method called SVRG (Stochastic Variance Reduced Gradient) in (6) below, comparing it with the non-composite form of SAGA rewritten in (5). They also mention that SAG (Stochastic Average Gradient) [1] can be interpreted as reducing the variance, though they do not provide the specifics. Here, we make this connection clearer and relate it to SAGA. We first review a slightly more generalized version of the variance reduction approach (we allow the updates to be biased). Suppose that we want to use Monte Carlo samples to estimate EX and that we can compute efficiently EY for another random variable Y that is highly correlated with X. One variance reduction approach is to use the following estimator θα as an approximation to EX: θα := α(X−Y )+EY , for a step size α ∈[0, 1]. We have that Eθα is a convex combination of EX and EY : Eθα = αEX + (1 −α)EY . The standard variance reduction approach uses α = 1 and the estimate is unbiased Eθ1 = EX. The variance of θα is: Var(θα) = α2[Var(X) + Var(Y ) −2 Cov(X, Y )], and so if Cov(X, Y ) is big enough, the variance of θα is reduced compared to X, giving the method its name. By varying α from 0 to 1, we increase the variance of θα towards its maximum value (which usually is still smaller than the one for X) while decreasing its bias towards zero. Both SAGA and SAG can be derived from such a variance reduction viewpoint: here X is the SGD direction sample f ′ j(xk), whereas Y is a past stored gradient f ′ j(φk j ). SAG is obtained by using α = 1/n (update rewritten in our notation in (4)), whereas SAGA is the unbiased version with α = 1 (see (5) below). For the same φ’s, the variance of the SAG update is 1/n2 times the one of SAGA, but at the expense of having a non-zero bias. This non-zero bias might explain the complexity of the convergence proof of SAG and why the theory has not yet been extended to proximal operators. By using an unbiased update in SAGA, we are able to obtain a simple and tight theory, with better constants than SAG, as well as theoretical rates for the use of proximal operators. (SAG) xk+1 = xk −γ " f ′ j(xk) −f ′ j(φk j ) n + 1 n n X i=1 f ′ i(φk i ) # , (4) (SAGA) xk+1 = xk −γ " f ′ j(xk) −f ′ j(φk j ) + 1 n n X i=1 f ′ i(φk i ) # , (5) (SVRG) xk+1 = xk −γ " f ′ j(xk) −f ′ j(˜x) + 1 n n X i=1 f ′ i(˜x) # . (6) The SVRG update (6) is obtained by using Y = f ′ j(˜x) with α = 1 (and is thus unbiased – we note that SAG is the only method that we present in the related work that has a biased update direction). The vector ˜x is not updated every step, but rather the loop over k appears inside an outer loop, where ˜x is updated at the start of each outer iteration. Essentially SAGA is at the midpoint between SVRG and SAG; it updates the φj value each time index j is picked, whereas SVRG updates all of φ’s as a batch. The S2GD method [8] has the same update as SVRG, just differing in how the number of inner loop iterations is chosen. We use SVRG henceforth to refer to both methods. 3 SVRG makes a trade-off between time and space. For the equivalent practical convergence rate it makes 2x-3x more gradient evaluations, but in doing so it does not need to store a table of gradients, but a single average gradient. The usage of SAG vs. SVRG is problem dependent. For example for linear predictors where gradients can be stored as a reduced vector of dimension p −1 for p classes, SAGA is preferred over SVRG both theoretically and in practice. For neural networks, where no theory is available for either method, the storage of gradients is generally more expensive than the additional backpropagations, but this is computer architecture dependent. SVRG also has an additional parameter besides step size that needs to be set, namely the number of iterations per inner loop (m). This parameter can be set via the theory, or conservatively as m = n, however doing so does not give anywhere near the best practical performance. Having to tune one parameter instead of two is a practical advantage for SAGA. Finito/MISOµ To make the relationship with other prior methods more apparent, we can rewrite the SAGA algorithm (in the non-composite case) in term of an additional intermediate quantity uk, with u0 := x0 + γ Pn i=1 f ′ i(x0), in addition to the usual xk iterate as described previously: SAGA: Equivalent reformulation for non-composite case: Given the value of uk and of each f ′ i(φk i ) at the end of iteration k, the updates for iteration k + 1, is as follows: 1. Calculate xk: xk = uk −γ n X i=1 f ′ i(φk i ). (7) 2. Update u with uk+1 = uk + 1 n(xk −uk). 3. Pick a j uniformly at random. 4. Take φk+1 j = xk, and store f ′ j(φk+1 j ) in the table replacing f ′ j(φk j ). All other entries in the table remain unchanged. The quantity φk+1 j is not explicitly stored. Eliminating uk recovers the update (5) for xk. We now describe how the Finito [9] and MISOµ [10] methods are closely related to SAGA. Both Finito and MISOµ use updates of the following form, for a step length γ: xk+1 = 1 n X i φk i −γ n X i=1 f ′ i(φk i ). (8) The step size used is of the order of 1/µn. To simplify the discussion of this algorithm we will introduce the notation ¯φ = 1 n P i φk i . SAGA can be interpreted as Finito, but with the quantity ¯φ replaced with u, which is updated in the same way as ¯φ, but in expectation. To see this, consider how ¯φ changes in expectation: E ¯φk+1 = E  ¯φk + 1 n xk −φk j  = ¯φk + 1 n xk −¯φk . The update is identical in expectation to the update for u, uk+1 = uk + 1 n(xk −uk). There are three advantages of SAGA over Finito/MISOµ. SAGA does not require strong convexity to work, it has support for proximal operators, and it does not require storing the φi values. MISO has proven support for proximal operators only in the case where impractically small step sizes are used [10]. The big advantage of Finito/MISOµ is that when using a per-pass re-permuted access ordering, empirical speed-ups of up-to a factor of 2x has been observed. This access order can also be used with the other methods discussed, but with smaller empirical speed-ups. Finito/MISOµ is particularly useful when fi is computationally expensive to compute compared to the extra storage costs required over the other methods. SDCA The Stochastic Dual Coordinate Descent (SDCA) [2] method on the surface appears quite different from the other methods considered. It works with the convex conjugates of the fi functions. However, in this section we show a novel transformation of SDCA into an equivalent method that only works with primal quantities, and is closely related to the MISOµ method. 4 Consider the following algorithm: SDCA algorithm in the primal Step k + 1: 1. Pick an index j uniformly at random. 2. Compute φk+1 j = proxfj γ (z), where γ = 1 µn and z = −γ Pn i̸=j f ′ i(φk i ). 3. Store the gradient f ′ j(φk+1 j ) = 1 γ z −φk+1 j  in the table at location j. For i ̸= j, the table entries are unchanged (f ′ i(φk+1 i ) = f ′ i(φk i )). At completion, return xk = −γ Pn i f ′ i(φk i ) . We claim that this algorithm is equivalent to the version of SDCA where exact block-coordinate maximisation is used on the dual.1 Firstly, note that while SDCA was originally described for onedimensional outputs (binary classification or regression), it has been expanded to cover the multiclass predictor case [11] (called Prox-SDCA there). In this case, the primal objective has a separate strongly convex regulariser, and the functions fi are restricted to the form fi(x) := ψi(XT i x), where Xi is a d×p feature matrix, and ψi is the loss function that takes a p dimensional input, for p classes. To stay in the same general setting as the other incremental gradient methods, we work directly with the fi(x) functions rather than the more structured ψi(XT i x). The dual objective to maximise then becomes D(α) =  −µ 2 1 µn n X i=1 αi 2 −1 n n X i=1 f ∗ i (−αi)  , where αi’s are d-dimensional dual variables. Generalising the exact block-coordinate maximisation update that SDCA performs to this form, we get the dual update for block j (with xk the current primal iterate): αk+1 j = αk j + argmax ∆aj∈Rd ( −f ∗ j −αk j −∆αj  −µn 2 xk + 1 µn∆αj 2) . (9) In the special case where fi(x) = ψi(XT i x), we can see that (9) gives exactly the same update as Option I of Prox-SDCA in [11, Figure 1], which operates instead on the equivalent p-dimensional dual variables ˜αi with the relationship that αi = Xi˜αi.2 As noted by Shalev-Shwartz & Zhang [11], the update (9) is actually an instance of the proximal operator of the convex conjugate of fj. Our primal formulation exploits this fact by using a relation between the proximal operator of a function and its convex conjugate known as the Moreau decomposition: proxf ∗(v) = v −proxf(v). This decomposition allows us to compute the proximal operator of the conjugate via the primal proximal operator. As this is the only use in the basic SDCA method of the conjugate function, applying this decomposition allows us to completely eliminate the “dual” aspect of the algorithm, yielding the above primal form of SDCA. The dual variables are related to the primal representatives φi’s through αi = −f ′ i(φi). The KKT conditions ensure that if the αi values are dual optimal then xk = γ P i αi as defined above is primal optimal. The same trick is commonly used to interpret Dijkstra’s set intersection as a primal algorithm instead of a dual block coordinate descent algorithm [12]. The primal form of SDCA differs from the other incremental gradient methods described in this section in that it assumes strong convexity is induced by a separate strongly convex regulariser, rather than each fi being strongly convex. In fact, SDCA can be modified to work without a separate regulariser, giving a method that is at the midpoint between Finito and SDCA. We detail such a method in the supplementary material. 1More precisely, to Option I of Prox-SDCA as described in [11, Figure 1]. We will simply refer to this method as “SDCA” in this paper for brevity. 2This is because f ∗ i (αi) = inf ˜αi s.t. αi=Xi ˜αi ψ∗ i (˜αi). 5 SDCA variants The SDCA theory has been expanded to cover a number of other methods of performing the coordinate step [11]. These variants replace the proximal operation in our primal interpretation in the previous section with an update where φk+1 j is chosen so that: f ′ j(φk+1 j ) = (1−β)f ′ j(φk j )+βf ′ j(xk), where xk = −1 µn P i f ′ i(φk i ). The variants differ in how β ∈[0, 1] is chosen. Note that φk+1 j does not actually have to be explicitly known, just the gradient f ′ j(φk+1 j ), which is the result of the above interpolation. Variant 5 by Shalev-Shwartz & Zhang [11] does not require operations on the conjugate function, it simply uses β = µn L+µn. The most practical variant performs a line search involving the convex conjugate to determine β. As far as we are aware, there is no simple primal equivalent of this line search. So in cases where we can not compute the proximal operator from the standard SDCA variant, we can either introduce a tuneable parameter into the algorithm (β), or use a dual line search, which requires an efficient way to evaluate the convex conjugates of each fi. 4 Implementation We briefly discuss some implementation concerns: • For many problems each derivative f ′ i is just a simple weighting of the ith data vector. Logistic regression and least squares have this property. In such cases, instead of storing the full derivative f ′ i for each i, we need only to store the weighting constants. This reduces the storage requirements to be the same as the SDCA method in practice. A similar trick can be applied to multi-class classifiers with p classes by storing p −1 values for each i. • Our algorithm assumes that initial gradients are known for each fi at the starting point x0. Instead, a heuristic may be used where during the first pass, data-points are introduced oneby-one, in a non-randomized order, with averages computed in terms of those data-points processed so far. This procedure has been successfully used with SAG [1]. • The SAGA update as stated is slower than necessary when derivatives are sparse. A just-intime updating of u or x may be performed just as is suggested for SAG [1], which ensures that only sparse updates are done at each iteration. • We give the form of SAGA for the case where each fi is strongly convex. However in practice we usually have only convex fi, with strong convexity in f induced by the addition of a quadratic regulariser. This quadratic regulariser may be split amongst the fi functions evenly, to satisfy our assumptions. It is perhaps easier to use a variant of SAGA where the regulariser µ 2 ||x||2 is explicit, such as the following modification of Equation (5): xk+1 = (1 −γµ) xk −γ " f ′ j(xk) −f ′ j(φk j ) + 1 n X i f ′ i(φk i ) # . For sparse implementations instead of scaling xk at each step, a separate scaling constant βk may be scaled instead, with βkxk being used in place of xk. This is a standard trick used with stochastic gradient methods. For sparse problems with a quadratic regulariser the just-in-time updating can be a little intricate. In the supplementary material we provide example python code showing a correct implementation that uses each of the above tricks. 5 Theory In this section, all expectations are taken with respect to the choice of j at iteration k + 1 and conditioned on xk and each f ′ i(φk i ) unless stated otherwise. We start with two basic lemmas that just state properties of convex functions, followed by Lemma 1, which is specific to our algorithm. The proofs of each of these lemmas is in the supplementary material. Lemma 1. Let f(x) = 1 n Pn i=1 fi(x). Suppose each fi is µ-strongly convex and has Lipschitz continuous gradients with constant L. Then for all x and x∗: ⟨f ′(x), x∗−x⟩≤L −µ L [f(x∗) −f(x)] −µ 2 ∥x∗−x∥2 6 − 1 2Ln X i ∥f ′ i(x∗) −f ′ i(x)∥2 −µ L ⟨f ′(x∗), x −x∗⟩. Lemma 2. We have that for all φi and x∗: 1 n X i ∥f ′ i(φi) −f ′ i(x∗)∥2 ≤2L " 1 n X i fi(φi) −f(x∗) −1 n X i ⟨f ′ i(x∗), φi −x∗⟩ # . Lemma 3. It holds that for any φk i , x∗, xk and β > 0, with wk+1 as defined in Equation 1: E wk+1 −xk −γf ′(x∗) 2 ≤γ2(1 + β−1)E f ′ j(φk j ) −f ′ j(x∗) 2 + γ2(1 + β)E f ′ j(xk) −f ′ j(x∗) 2 −γ2β f ′(xk) −f ′(x∗) 2 . Theorem 1. With x∗the optimal solution, define the Lyapunov function T as: T k := T(xk, {φk i }n i=1) := 1 n X i fi(φk i ) −f(x∗) −1 n X i f ′ i(x∗), φk i −x∗ + c xk −x∗ 2 . Then with γ = 1 2(µn+L), c = 1 2γ(1−γµ)n, and κ = 1 γµ, we have the following expected change in the Lyapunov function between steps of the SAGA algorithm (conditional on T k): E[T k+1] ≤(1 −1 κ)T k. Proof. The first three terms in T k+1 are straight-forward to simplify: E " 1 n X i fi(φk+1 i ) # = 1 nf(xk) +  1 −1 n  1 n X i fi(φk i ). E " −1 n X i f ′ i(x∗), φk+1 i −x∗ # = −1 n f ′(x∗), xk −x∗ −  1−1 n  1 n X i f ′ i(x∗), φk i −x∗ . For the change in the last term of T k+1, we apply the non-expansiveness of the proximal operator3: c xk+1 −x∗ 2 = c proxγ(wk+1) −proxγ(x∗−γf ′(x∗)) 2 ≤c wk+1 −x∗+ γf ′(x∗) 2 . We expand the quadratic and apply E[wk+1] = xk −γf ′(xk) to simplify the inner product term: cE wk+1 −x∗+ γf ′(x∗) 2 = cE xk −x∗+ wk+1 −xk + γf ′(x∗) 2 = c xk −x∗ 2 + 2cE  wk+1 −xk + γf ′(x∗), xk −x∗  + cE wk+1 −xk + γf ′(x∗) 2 = c xk −x∗ 2 −2cγ f ′(xk) −f ′(x∗), xk −x∗ + cE wk+1 −xk + γf ′(x∗) 2 ≤c xk −x∗ 2 −2cγ f ′(xk), xk −x∗ + 2cγ f ′(x∗), xk −x∗ −cγ2β f ′(xk) −f ′(x∗) 2 + 1 + β−1 cγ2E f ′ j(φk j ) −f ′ j(x∗) 2 + (1 + β) cγ2E f ′ j(xk) −f ′ j(x∗) 2 . (Lemma 3) The value of β shall be fixed later. Now we apply Lemma 1 to bound −2cγ f ′(xk), xk −x∗ and Lemma 2 to bound E f ′ j(φk j ) −f ′ j(x∗) 2: cE xk+1 −x∗ 2 ≤(c −cγµ) xk −x∗ 2 +  (1 + β)cγ2 −cγ L  E f ′ j(xk) −f ′ j(x∗) 2 −2cγ(L −µ) L  f(xk) −f(x∗) − f ′(x∗), xk −x∗  −cγ2β f ′(xk) −f ′(x∗) 2 + 2 1 + β−1 cγ2L " 1 n X i fi(φk i ) −f(x∗) −1 n X i f ′ i(x∗), φk i −x∗ # . 3Note that the first equality below is the only place in the proof where we use the fact that x∗is an optimality point. 7 Function sub-optimality 5 10 15 20 10−4 10−8 10−12 5 10 15 20 10−4 10−8 10−12 5 10 15 20 10−4 10−8 10−12 5 10 15 20 100 10−4 10−8 10−12 5 10 15 20 10−1 10−2 5 10 15 20 3×10−2 2×10−2 5 10 15 20 102 101 100 10−1 10−2 5 10 15 20 100 10−1 Gradient evaluations / n 5101520 100 10−4 10−8 10−12 10−16 Finito perm Finito SAGA SVRG SAG SDCA LBFGS Figure 2: From left to right we have the MNIST, COVTYPE, IJCNN1 and MILLIONSONG datasets. Top row is the L2 regularised case, bottom row the L1 regularised case. We can now combine the bounds that we have derived for each term in T, and pull out a fraction 1 κ of T k (for any κ at this point). Together with the inequality − f ′(xk) −f ′(x∗) 2 ≤ −2µ  f(xk) −f(x∗) − f ′(x∗), xk −x∗  [13, Thm. 2.1.10], that yields: E[T k+1] −T k ≤−1 κT k +  1 n −2cγ(L −µ) L −2cγ2µβ  h f(xk) −f(x∗) − D f ′(x∗), xk −x∗Ei +  1 κ + 2(1 + β−1)cγ2L −1 n  " 1 n X i fi(φk i ) −f(x∗) −1 n X i D f ′ i(x∗), φk i −x∗E# +  1 κ −γµ  c xk −x∗ 2 +  (1 + β)γ −1 L  cγE f ′ j(xk) −f ′ j(x∗) 2 . (10) Note that each of the terms in square brackets are positive, and it can be readily verified that our assumed values for the constants (γ = 1 2(µn+L), c = 1 2γ(1−γµ)n, and κ = 1 γµ), together with β = 2µn+L L ensure that each of the quantities in round brackets are non-positive (the constants were determined by setting all the round brackets to zero except the second one — see [14] for the details). Adaptivity to strong convexity result: Note that when using the γ = 1 3L step size, the same c as above can be used with β = 2 and 1 κ = min  1 4n, µ 3L to ensure non-positive terms. Corollary 1. Note that c xk −x∗ 2 ≤T k, and therefore by chaining the expectations, plugging in the constants explicitly and using µ(n −0.5) ≤µn to simplify the expression, we get: E  xk −x∗ 2 ≤  1 − µ 2(µn + L) k  x0 −x∗ 2 + n µn + L  f(x0) − f ′(x∗), x0 −x∗ −f(x∗)  . Here the expectation is over all choices of index jk up to step k. 6 Experiments We performed a series of experiments to validate the effectiveness of SAGA. We tested a binary classifier on MNIST, COVTYPE, IJCNN1 and a least squares predictor on MILLIONSONG. Details of these datasets can be found in [9]. We used the same code base for each method, just changing the main update rule. SVRG was tested with the recalibration pass used every n iterations, as suggested in [8]. Each method had its step size parameter chosen so as to give the fastest convergence. We tested with a L2 regulariser, which all methods support, and with a L1 regulariser on a subset of the methods. The results are shown in Figure 2. We can see that Finito (perm) performs the best on a per epoch equivalent basis, but it can be the most expensive method per step. SVRG is similarly fast on a per epoch basis, but when considering the number of gradient evaluations per epoch is double that of the other methods for this problem, it is middle of the pack. SAGA can be seen to perform similar to the non-permuted Finito case, and to SDCA. Note that SAG is slower than the other methods at the beginning. To get the optimal results for SAG, an adaptive step size rule needs to be used rather than the constant step size we used. In general, these tests confirm that the choice of methods should be done based on their properties as discussed in Section 3, rather than their convergence rate. 8 References [1] Mark Schmidt, Nicolas Le Roux, and Francis Bach. Minimizing finite sums with the stochastic average gradient. Technical report, INRIA, hal-0086005, 2013. [2] Shai Shalev-Shwartz and Tong Zhang. Stochastic dual coordinate ascent methods for regularized loss minimization. JMLR, 14:567–599, 2013. [3] Paul Tseng and Sangwoon Yun. Incrementally updated gradient methods for constrained and regularized optimization. Journal of Optimization Theory and Applications, 160:832:853, 2014. [4] Lin Xiao and Tong Zhang. A proximal stochastic gradient method with progressive variance reduction. Technical report, Microsoft Research, Redmond and Rutgers University, Piscataway, NJ, 2014. [5] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. NIPS, 2013. [6] Taiji Suzuki. Stochastic dual coordinate ascent with alternating direction method of multipliers. Proceedings of The 31st International Conference on Machine Learning, 2014. [7] Evan Greensmith, Peter L. Bartlett, and Jonathan Baxter. Variance reduction techniques for gradient estimates in reinforcement learning. JMLR, 5:1471–1530, 2004. [8] Jakub Koneˇcn´y and Peter Richt´arik. Semi-stochastic gradient descent methods. ArXiv e-prints, arXiv:1312.1666, December 2013. [9] Aaron Defazio, Tiberio Caetano, and Justin Domke. Finito: A faster, permutable incremental gradient method for big data problems. Proceedings of the 31st International Conference on Machine Learning, 2014. [10] Julien Mairal. Incremental majorization-minimization optimization with application to largescale machine learning. Technical report, INRIA Grenoble Rhˆone-Alpes / LJK Laboratoire Jean Kuntzmann, 2014. [11] Shai Shalev-Shwartz and Tong Zhang. Accelerated proximal stochastic dual coordinate ascent for regularized loss minimization. Technical report, The Hebrew University, Jerusalem and Rutgers University, NJ, USA, 2013. [12] Patrick Combettes and Jean-Christophe Pesquet. Proximal Splitting Methods in Signal Processing. In Fixed-Point Algorithms for Inverse Problems in Science and Engineering. Springer, 2011. [13] Yu. Nesterov. Introductory Lectures On Convex Programming. Springer, 1998. [14] Aaron Defazio. New Optimization Methods for Machine Learning. PhD thesis, (draft under examination) Australian National University, 2014. http://www.aarondefazio.com/pubs.html. 9
2014
384
5,496
A Differential Equation for Modeling Nesterov’s Accelerated Gradient Method: Theory and Insights Weijie Su1 Stephen Boyd2 Emmanuel J. Cand`es1,3 1Department of Statistics, Stanford University, Stanford, CA 94305 2Department of Electrical Engineering, Stanford University, Stanford, CA 94305 3Department of Mathematics, Stanford University, Stanford, CA 94305 {wjsu, boyd, candes}@stanford.edu Abstract We derive a second-order ordinary differential equation (ODE), which is the limit of Nesterov’s accelerated gradient method. This ODE exhibits approximate equivalence to Nesterov’s scheme and thus can serve as a tool for analysis. We show that the continuous time ODE allows for a better understanding of Nesterov’s scheme. As a byproduct, we obtain a family of schemes with similar convergence rates. The ODE interpretation also suggests restarting Nesterov’s scheme leading to an algorithm, which can be rigorously proven to converge at a linear rate whenever the objective is strongly convex. 1 Introduction As data sets and problems are ever increasing in size, accelerating first-order methods is both of practical and theoretical interest. Perhaps the earliest first-order method for minimizing a convex function f is the gradient method, which dates back to Euler and Lagrange. Thirty years ago, in a seminar paper [11] Nesterov proposed an accelerated gradient method, which may take the following form: starting with x0 and y0 = x0, inductively define xk = yk−1 −s∇f(yk−1) yk = xk + k −1 k + 2(xk −xk−1). (1.1) For a fixed step size s = 1/L, where L is the Lipschitz constant of ∇f, this scheme exhibits the convergence rate f(xk) −f ⋆≤O L∥x0 −x⋆∥2 k2  . Above, x⋆is any minimizer of f and f ⋆= f(x⋆). It is well-known that this rate is optimal among all methods having only information about the gradient of f at consecutive iterates [12]. This is in contrast to vanilla gradient descent methods, which can only achieve a rate of O(1/k) [17]. This improvement relies on the introduction of the momentum term xk −xk−1 as well as the particularly tuned coefficient (k −1)/(k + 2) ≈1 −3/k. Since the introduction of Nesterov’s scheme, there has been much work on the development of first-order accelerated methods, see [12, 13, 14, 1, 2] for example, and [19] for a unified analysis of these ideas. In a different direction, there is a long history relating ordinary differential equations (ODE) to optimization, see [6, 4, 8, 18] for references. The connection between ODEs and numerical optimization is often established via taking step sizes to be very small so that the trajectory or solution path converges to a curve modeled by an ODE. The conciseness and well-established theory of ODEs provide deeper insights into optimization, which has led to many interesting findings [5, 7, 16]. 1 In this work, we derive a second-order ordinary differential equation, which is the exact limit of Nesterov’s scheme by taking small step sizes in (1.1). This ODE reads ¨X + 3 t ˙X + ∇f(X) = 0 (1.2) for t > 0, with initial conditions X(0) = x0, ˙X(0) = 0; here, x0 is the starting point in Nesterov’s scheme, ˙X denotes the time derivative or velocity dX/dt and similarly ¨X = d2X/dt2 denotes the acceleration. The time parameter in this ODE is related to the step size in (1.1) via t ≈k√s. Case studies are provided to demonstrate that the homogeneous and conceptually simpler ODE can serve as a tool for analyzing and generalizing Nesterov’s scheme. To the best of our knowledge, this work is the first to model Nesterov’s scheme or its variants by ODEs. We denote by FL the class of convex functions f with L–Lipschitz continuous gradients defined on Rn, i.e., f is convex, continuously differentiable, and obeys ∥∇f(x) −∇f(y)∥≤L∥x −y∥ for any x, y ∈Rn, where ∥· ∥is the standard Euclidean norm and L > 0 is the Lipschitz constant throughout this paper. Next, Sµ denotes the class of µ–strongly convex functions f on Rn with continuous gradients, i.e., f is continuously differentiable and f(x) −µ∥x∥2/2 is convex. Last, we set Sµ,L = FL ∩Sµ. 2 Derivation of the ODE Assume f ∈FL for L > 0. Combining the two equations of (1.1) and applying a rescaling give xk+1 −xk √s = k −1 k + 2 xk −xk−1 √s −√s∇f(yk). (2.1) Introduce the ansatz xk ≈X(k√s) for some smooth curve X(t) defined for t ≥0. For fixed t, as the step size s goes to zero, X(t) ≈xt/√s = xk and X(t + √s) ≈x(t+√s)/√s = xk+1 with k = t/√s. With these approximations, we get Taylor expansions: (xk+1 −xk)/√s = ˙X(t) + 1 2 ¨X(t)√s + o(√s) (xk −xk−1)/√s = ˙X(t) −1 2 ¨X(t)√s + o(√s) √s∇f(yk) = √s∇f(X(t)) + o(√s), where in the last equality we use yk −X(t) = o(1). Thus (2.1) can be written as ˙X(t) + 1 2 ¨X(t)√s + o(√s) =  1 −3√s t  ˙X(t) −1 2 ¨X(t)√s + o(√s)  −√s∇f(X(t)) + o(√s). (2.2) By comparing the coefficients of √s in (2.2), we obtain ¨X + 3 t ˙X + ∇f(X) = 0 for t > 0. The first initial condition is X(0) = x0. Taking k = 1 in (2.1) yields (x2 −x1)/√s = −√s∇f(y1) = o(1). Hence, the second initial condition is simply ˙X(0) = 0 (vanishing initial velocity). In the formulation of [1] (see also [20]), the momentum coefficient (k −1)/(k + 2) is replaced by θk(θ−1 k−1 −1), where θk are iteratively defined as θk+1 = p θ4 k + 4θ2 k −θ2 k 2 (2.3) starting from θ0 = 1. A bit of analysis reveals that θk(θ−1 k−1 −1) asymptotically equals 1 −3/k + O(1/k2), thus leading to the same ODE as (1.1). 2 Classical results in ODE theory do not directly imply the existence or uniqueness of the solution to this ODE because the coefficient 3/t is singular at t = 0. In addition, ∇f is typically not analytic at x0, which leads to the inapplicability of the power series method for studying singular ODEs. Nevertheless, the ODE is well posed: the strategy we employ for showing this constructs a series of ODEs approximating (1.2) and then chooses a convergent subsequence by some compactness arguments such as the Arzel´a-Ascoli theorem. A proof of this theorem can be found in the supplementary material for this paper. Theorem 2.1. For any f ∈F∞≜∪L>0FL and any x0 ∈Rn, the ODE (1.2) with initial conditions X(0) = x0, ˙X(0) = 0 has a unique global solution X ∈C2((0, ∞); Rn) ∩C1([0, ∞); Rn). 3 Equivalence between the ODE and Nesterov’s scheme We study the stable step size allowed for numerically solving the ODE in the presence of accumulated errors. The finite difference approximation of (1.2) by the forward Euler method is X(t + ∆t) −2X(t) + X(t −∆t) ∆t2 + 3 t X(t) −X(t −∆t) ∆t + ∇f(X(t)) = 0, (3.1) which is equivalent to X(t + ∆t) =  2 −3∆t t  X(t) −∆t2∇f(X(t)) −  1 −3∆t t  X(t −∆t). Assuming that f is sufficiently smooth, for small perturbations δx, ∇f(x + δx) ≈∇f(x) + ∇2f(x)δx, where ∇2f(x) is the Hessian of f evaluated at x. Identifying k = t/∆t, the characteristic equation of this finite difference scheme is approximately det  λ2 −  2 −∆t2∇2f −3∆t t  λ + 1 −3∆t t  = 0. (3.2) The numerical stability of (3.1) with respect to accumulated errors is equivalent to this: all the roots of (3.2) lie in the unit circle [9]. When ∇2f ⪯LIn (i.e., LIn −∇2f is positive semidefinite), if ∆t/t small and ∆t < 2/ √ L, we see that all the roots of (3.2) lie in the unit circle. On the other hand, if ∆t > 2/ √ L, (3.2) can possibly have a root λ outside the unit circle, causing numerical instability. Under our identification s = ∆t2, a step size of s = 1/L in Nesterov’s scheme (1.1) is approximately equivalent to a step size of ∆t = 1/ √ L in the forward Euler method, which is stable for numerically integrating (3.1). As a comparison, note that the corresponding ODE for gradient descent with updates xk+1 = xk − s∇f(xk), is ˙X(t) + ∇f(X(t)) = 0, whose finite difference scheme has the characteristic equation det(λ −(1 −∆t∇2f)) = 0. Thus, to guarantee −In ⪯1 −∆t∇2f ⪯In in worst case analysis, one can only choose ∆t ≤2/L for a fixed step size, which is much smaller than the step size 2/ √ L for (3.1) when ∇f is very variable, i.e., L is large. Next, we exhibit approximate equivalence between the ODE and Nesterov’s scheme in terms of convergence rates. We first recall the original result from [11]. Theorem 3.1 (Nesterov). For any f ∈FL, the sequence {xk} in (1.1) with step size s ≤1/L obeys f(xk) −f ⋆≤2∥x0 −x⋆∥2 s(k + 1)2 . Our first result indicates that the trajectory of ODE (1.2) closely resembles the sequence {xk} in terms of the convergence rate to a minimizer x⋆. Theorem 3.2. For any f ∈F∞, let X(t) be the unique global solution to (1.2) with initial conditions X(0) = x0, ˙X(0) = 0. For any t > 0, f(X(t)) −f ⋆≤2∥x0 −x⋆∥2 t2 . 3 Proof of Theorem 3.2. Consider the energy functional defined as E(t) ≜t2(f(X(t)) −f ⋆) + 2∥X + t 2 ˙X −x⋆∥2, whose time derivative is ˙E = 2t(f(X) −f ⋆) + t2⟨∇f, ˙X⟩+ 4⟨X + t 2 ˙X −x⋆, 3 2 ˙X + t 2 ¨X⟩. (3.3) Substituting 3 ˙X/2 + t ¨X/2 with −t∇f(X)/2, (3.3) gives ˙E = 2t(f(X) −f ⋆) + 4⟨X −x⋆, −t 2∇f(X)⟩= 2t(f(X) −f ⋆) −2t⟨X −x⋆, ∇f(X)⟩≤0, where the inequality follows from the convexity of f. Hence by monotonicity of E and nonnegativity of 2∥X + t ˙X/2 −x⋆∥2, the gap obeys f(X(t)) −f ⋆≤E(t)/t2 ≤E(0)/t2 = 2∥x0 −x⋆∥2/t2. 4 A family of generalized Nesterov’s schemes In this section we show how to exploit the power of the ODE for deriving variants of Nesterov’s scheme. One would be interested in studying the ODE (1.2) with the number 3 appearing in the coefficient of ˙X/t replaced by a general constant r as in ¨X + r t ˙X + ∇f(X) = 0, X(0) = x0, ˙X(0) = 0. (4.1) Using arguments similar to those in the proof of Theorem 2.1, this new ODE is guaranteed to assume a unique global solution for any f ∈F∞. 4.1 Continuous optimization To begin with, we consider a modified energy functional defined as E(t) = 2t2 r −1(f(X(t)) −f ⋆) + (r −1) X(t) + t r −1 ˙ X(t) −x⋆ 2 . Since r ˙X + t ¨X = −t∇f(X), the time derivative ˙E is equal to 4t r −1(f(X) −f ⋆) + 2t2 r −1⟨∇f, ˙X⟩+ 2⟨X + t r −1 ˙X −x⋆, r ˙X + t ¨X⟩ = 4t r −1(f(X) −f ⋆) −2t⟨X −x⋆, ∇f(X)⟩. (4.2) A consequence of (4.2) is this: Theorem 4.1. Suppose r > 3 and let X be the unique solution to (4.1) for some f ∈F∞. Then X obeys f(X(t)) −f ⋆≤(r −1)2∥x0 −x⋆∥2 2t2 and Z ∞ 0 t(f(X(t)) −f ⋆)dt ≤(r −1)2∥x0 −x⋆∥2 2(r −3) . Proof of Theorem 4.1. By (4.2), the derivative dE/dt equals 2t(f(X)−f ⋆)−2t⟨X −x⋆, ∇f(X)⟩−2(r −3)t r −1 (f(X)−f ⋆) ≤−2(r −3)t r −1 (f(X)−f ⋆), (4.3) where the inequality follows from the convexity of f. Since f(X) ≥f ⋆, (4.3) implies that E is non-increasing. Hence 2t2 r −1(f(X(t)) −f ⋆) ≤E(t) ≤E(0) = (r −1)∥x0 −x⋆∥2, 4 yielding the first inequality of the theorem as desired. To complete the proof, by (4.2) it follows that Z ∞ 0 2(r −3)t r −1 (f(X) −f ⋆)dt ≤− Z ∞ 0 dE dt dt = E(0) −E(∞) ≤(r −1)∥x0 −x⋆∥2, as desired for establishing the second inequality. We now demonstrate faster convergence rates under the assumption of strong convexity. Given a strongly convex function f, consider a new energy functional defined as ˜E(t) = t3(f(X(t)) −f ⋆) + (2r −3)2t 8 X(t) + 2t 2r −3 ˙X(t) −x⋆ 2 . As in Theorem 4.1, a more refined study of the derivative of ˜E(t) gives Theorem 4.2. For any f ∈Sµ,L(Rn), the unique solution X to (4.1) with r ≥9/2 obeys f(X(t)) −f ⋆≤Cr 5 2 ∥x0 −x⋆∥2 t3√µ for any t > 0 and a universal constant C > 1/2. The restriction r ≥9/2 is an artifact required in the proof. We believe that this theorem should be valid as long as r ≥3. For example, the solution to (4.1) with f(x) = ∥x∥2/2 is X(t) = 2 r−1 2 Γ((r + 1)/2)J(r−1)/2(t) t r−1 2 x0, (4.4) where J(r−1)/2(·) is the first kind Bessel function of order (r−1)/2. For large t, this Bessel function obeys J(r−1)/2(t) = p 2/(πt)(cos(t −(r −1)π/4 −π/4) + O(1/t)). Hence, f(X(t)) −f ⋆≲∥x0 −x⋆∥2/tr, in which the inequality fails if 1/tr is replaced by any higher order rate. For general strongly convex functions, such refinement, if possible, might require a construction of a more sophisticated energy functional and careful analysis. We leave this problem for future research. 4.2 Composite optimization Inspired by Theorem 4.2, it is tempting to obtain such analogies for the discrete Nesterov’s scheme as well. Following the formulation of [1], we consider the composite minimization: minimize x∈Rn f(x) = g(x) + h(x), where g ∈FL for some L > 0 and h is convex on Rn with possible extended value ∞. Define the proximal subgradient Gs(x) ≜ x −argminz h ∥z −(x −s∇g(x))∥2/(2s) + h(z) i s . Parametrizing by a constant r, we propose a generalized Nesterov’s scheme, xk = yk−1 −sGs(yk−1) yk = xk + k −1 k + r −1(xk −xk−1), (4.5) starting from y0 = x0. The discrete analog of Theorem 4.1 is below, whose proof is also deferred to the supplementary materials as well. Theorem 4.3. The sequence {xk} given by (4.5) with r > 3 and 0 < s ≤1/L obeys f(xk) −f ⋆≤(r −1)2∥x0 −x⋆∥2 2s(k + r −2)2 and ∞ X k=1 (k + r −1)(f(xk) −f ⋆) ≤(r −1)2∥x0 −x⋆∥2 2s(r −3) . 5 The idea behind the proof is the same as that employed for Theorem 4.1; here, however, the energy functional is defined as E(k) = 2s(k + r −2)2(f(xk) −f ⋆)/(r −1) + ∥(k + r −1)yk −kxk −(r −1)x⋆∥2/(r −1). The first inequality in Theorem 4.3 suggests that the generalized Nesterov’s scheme still achieves O(1/k2) convergence rate. However, if the error bound satisfies f(xk′) −f ⋆≥c k′2 for some c > 0 and a dense subsequence {k′}, i.e., |{k′} ∩{1, . . . , m}| ≥αm for any positive integer m and some α > 0, then the second inequality of the theorem is violated. Hence, the second inequality is not trivial because it implies the error bound is in some sense O(1/k2) suboptimal. In closing, we would like to point out this new scheme is equivalent to setting θk = (r−1)/(k+r−1) and letting θk(θ−1 k−1 −1) replace the momentum coefficient (k −1)/(k + r −1). Then, the equal sign “ = ” in (2.3) has to be replaced by “ ≥”. In examining the proof of Theorem 1(b) in [20], we can get an alternative proof of Theorem 4.3 by allowing (2.3), which appears in Eq. (36) in [20], to be an inequality. 5 Accelerating to linear convergence by restarting Although an O(1/k3) convergence rate is guaranteed for generalized Nesterov’s schemes (4.5), the example (4.4) provides evidence that O(1/poly(k)) is the best rate achievable under strong convexity. In contrast, the vanilla gradient method achieves linear convergence O((1 −µ/L)k) and [12] proposed a first-order method with a convergence rate of O((1 − p µ/L)k), which, however, requires knowledge of the condition number µ/L. While it is relatively easy to bound the Lipschitz constant L by the use of backtracking [3, 19], estimating the strong convexity parameter µ, if not impossible, is very challenging. Among many approaches to gain acceleration via adaptively estimating µ/L, [15] proposes a restarting procedure for Nesterov’s scheme in which (1.1) is restarted with x0 = y0 := xk whenever ∇f(yk)T (xk+1 −xk) > 0. In the language of ODEs, this gradient based restarting essentially keeps ⟨∇f, ˙X⟩negative along the trajectory. Although it has been empirically observed that this method significantly boosts convergence, there is no general theory characterizing the convergence rate. In this section, we propose a new restarting scheme we call the speed restarting scheme. The underlying motivation is to maintain a relatively high velocity ˙X along the trajectory. Throughout this section we assume f ∈Sµ,L for some 0 < µ ≤L. Definition 5.1. For ODE (1.2) with X(0) = x0, ˙X(0) = 0, let T = T(f, x0) = sup{t > 0 : ∀u ∈(0, t), d∥˙X(u)∥2 du > 0} be the speed restarting time. In words, T is the first time the velocity ∥˙X∥decreases. The definition itself does not imply that 0 < T < ∞, which is proven in the supplementary materials. Indeed, f(X(t)) is a decreasing function before time T; for t ≤T, df(X(t)) dt = ⟨∇f(X), ˙X⟩= −3 t ∥˙X∥2 −1 2 d∥˙X∥2 dt ≤0. The speed restarted ODE is thus ¨X(t) + 3 tsr ˙X(t) + ∇f(X(t)) = 0, (5.1) where tsr is set to zero whenever ⟨˙X, ¨X⟩= 0 and between two consecutive restarts, tsr grows just as t. That is, tsr = t −τ, where τ is the latest restart time. In particular, tsr = 0 at t = 0. The theorem below guarantees linear convergence of the solution to (5.1). This is a new result in the literature [15, 10]. Theorem 5.2. There exists positive constants c1 and c2, which only depend on the condition number L/µ, such that for any f ∈Sµ,L, we have f(Xsr(t)) −f(x⋆) ≤c1L∥x0 −x⋆∥2 2 e−c2t √ L. 6 5.1 Numerical examples Below we present a discrete analog to the restarted scheme. There, kmin is introduced to avoid having consecutive restarts that are too close. To compare the performance of the restarted scheme with the original (1.1), we conduct four simulation studies, including both smooth and non-smooth objective functions. Note that the computational costs of the restarted and non-restarted schemes are the same. Algorithm 1 Speed Restarting Nesterov’s Scheme input: x0 ∈Rn, y0 = x0, x−1 = x0, 0 < s ≤1/L, kmax ∈N+ and kmin ∈N+ j ←1 for k = 1 to kmax do xk ←argminx( 1 2s∥x −yk−1 + s∇g(yk−1)∥2 + h(x)) yk ←xk + j−1 j+2(xk −xk−1) if ∥xk −xk−1∥< ∥xk−1 −xk−2∥and j ≥kmin then j ←1 else j ←j + 1 end if end for Quadratic. f(x) = 1 2xT Ax+bT x is a strongly convex function, in which A is a 500×500 random positive definite matrix and b a random vector. The eigenvalues of A are between 0.001 and 1. The vector b is generated as i. i. d. Gaussian random variables with mean 0 and variance 25. Log-sum-exp. f(x) = ρ log h m X i=1 exp((aT i x −bi)/ρ) i , where n = 50, m = 200, ρ = 20. The matrix A = {aij} is a random matrix with i. i. d. standard Gaussian entries, and b = {bi} has i. i. d. Gaussian entries with mean 0 and variance 2. This function is not strongly convex. Matrix completion. f(X) = 1 2∥Xobs −Mobs∥2 F + λ∥X∥∗, in which the ground truth M is a rank-5 random matrix of size 300 × 300. The regularization parameter is set to λ = 0.05. The 5 singular values of M are 1, . . . , 5. The observed set is independently sampled among the 300 × 300 entries so that 10% of the entries are actually observed. Lasso in ℓ1–constrained form with large sparse design. f = 1 2∥Ax −b∥2 s.t. ∥x∥1 ≤δ, where A is a 5000 × 50000 random sparse matrix with nonzero probability 0.5% for each entry and b is generated as b = Ax0 + z. The nonzero entries of A independently follow the Gaussian distribution with mean 0 and variance 1/25. The signal x0 is a vector with 250 nonzeros and z is i. i. d. standard Gaussian noise. The parameter δ is set to ∥x0∥1. In these examples, kmin is set to be 10 and the step sizes are fixed to be 1/L. If the objective is in composite form, the Lipschitz bound applies to the smooth part. Figures 1(a), 1(b), 1(c) and 1(d) present the performance of the speed restarting scheme, the gradient restarting scheme proposed in [15], the original Nesterov’s scheme and the proximal gradient method. The objective functions include strongly convex, non-strongly convex and non-smooth functions, violating the assumptions in Theorem 5.2. Among all the examples, it is interesting to note that both speed restarting scheme empirically exhibit linear convergence by significantly reducing bumps in the objective values. This leaves us an open problem of whether there exists provable linear convergence rate for the gradient restarting scheme as in Theorem 5.2. It is also worth pointing that compared with gradient restarting, the speed restarting scheme empirically exhibits more stable linear convergence rate. 6 Discussion This paper introduces a second-order ODE and accompanying tools for characterizing Nesterov’s accelerated gradient method. This ODE is applied to study variants of Nesterov’s scheme. Our 7 0 200 400 600 800 1000 1200 1400 10 −6 10 −4 10 −2 10 0 10 2 10 4 10 6 10 8 iterations f − f* srN grN oN PG (a) min 1 2xT Ax + bx 0 500 1000 1500 10 −12 10 −10 10 −8 10 −6 10 −4 10 −2 10 0 10 2 iterations f − f* srN grN oN PG (b) min ρ log(Pm i=1 e(aT i x−bi)/ρ) 0 20 40 60 80 100 120 140 160 180 200 10 −12 10 −10 10 −8 10 −6 10 −4 10 −2 10 0 10 2 iterations f − f* srN grN oN PG (c) min 1 2∥Xobs −Mobs∥2 F + λ∥X∥∗ 0 200 400 600 800 1000 1200 1400 10 −10 10 −5 10 0 10 5 iterations f − f* srN grN oN PG (d) min 1 2∥Ax −b∥2 s.t. ∥x∥1 ≤C Figure 1: Numerical performance of speed restarting (srN), gradient restarting (grN) proposed in [15], the original Nesterov’s scheme (oN) and the proximal gradient (PG) approach suggests (1) a large family of generalized Nesterov’s schemes that are all guaranteed to converge at the rate 1/k2, and (2) a restarted scheme provably achieving a linear convergence rate whenever f is strongly convex. In this paper, we often utilize ideas from continuous-time ODEs, and then apply these ideas to discrete schemes. The translation, however, involves parameter tuning and tedious calculations. This is the reason why a general theory mapping properties of ODEs into corresponding properties for discrete updates would be a welcome advance. Indeed, this would allow researchers to only study the simpler and more user-friendly ODEs. 7 Acknowledgements We would like to thank Carlos Sing-Long and Zhou Fan for helpful discussions about parts of this paper, and anonymous reviewers for their insightful comments and suggestions. 8 References [1] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM J. Imaging Sci., 2(1):183–202, 2009. [2] S. Becker, J. Bobin, and E. J. Cand`es. NESTA: a fast and accurate first-order method for sparse recovery. SIAM Journal on Imaging Sciences, 4(1):1–39, 2011. [3] S. Becker, E. J. Cand`es, and M. Grant. Templates for convex cone problems with applications to sparse signal recovery. Mathematical Programming Computation, 3(3):165–218, 2011. [4] A. Bloch (Editor). Hamiltonian and gradient flows, algorithms, and control, volume 3. American Mathematical Soc., 1994. [5] F. H. Branin. Widely convergent method for finding multiple solutions of simultaneous nonlinear equations. IBM Journal of Research and Development, 16(5):504–522, 1972. [6] A. A. Brown and M. C. Bartholomew-Biggs. Some effective methods for unconstrained optimization based on the solution of systems of ordinary differential equations. Journal of Optimization Theory and Applications, 62(2):211–224, 1989. [7] R. Hauser and J. Nedic. The continuous Newton–Raphson method can look ahead. SIAM Journal on Optimization, 15(3):915–925, 2005. [8] U. Helmke and J. Moore. Optimization and dynamical systems. Proceedings of the IEEE, 84(6):907, 1996. [9] J. J. Leader. Numerical Analysis and Scientific Computation. Pearson Addison Wesley, 2004. [10] R. Monteiro, C. Ortiz, and B. Svaiter. An adaptive accelerated first-order method for convex optimization, 2012. [11] Y. Nesterov. A method of solving a convex programming problem with convergence rate O(1/k2). In Soviet Mathematics Doklady, volume 27, pages 372–376, 1983. [12] Y. Nesterov. Introductory lectures on convex optimization: A basic course, volume 87 of Applied Optimization. Kluwer Academic Publishers, Boston, MA, 2004. [13] Y. Nesterov. Smooth minimization of non-smooth functions. Mathematical programming, 103(1):127–152, 2005. [14] Y. Nesterov. Gradient methods for minimizing composite objective function. CORE Discussion Papers, 2007. [15] B. O’Donoghue and E. J. Cand`es. Adaptive restart for accelerated gradient schemes. Found. Comput. Math., 2013. [16] Y.-G. Ou. A nonmonotone ODE-based method for unconstrained optimization. International Journal of Computer Mathematics, (ahead-of-print):1–21, 2014. [17] R. T. Rockafellar. Convex analysis. Princeton Landmarks in Mathematics. Princeton University Press, Princeton, NJ, 1997. Reprint of the 1970 original, Princeton Paperbacks. [18] J. Schropp and I. Singer. A dynamical systems approach to constrained minimization. Numerical functional analysis and optimization, 21(3-4):537–551, 2000. [19] P. Tseng. On accelerated proximal gradient methods for convex-concave optimization. submitted to SIAM J. 2008. [20] P. Tseng. Approximation accuracy, gradient methods, and error bound for structured convex optimization. Mathematical Programming, 125(2):263–295, 2010. 9
2014
385
5,497
Sparse PCA with Oracle Property Quanquan Gu Department of Operations Research and Financial Engineering Princeton University Princeton, NJ 08544, USA qgu@princeton.edu Zhaoran Wang Department of Operations Research and Financial Engineering Princeton University Princeton, NJ 08544, USA zhaoran@princeton.edu Han Liu Department of Operations Research and Financial Engineering Princeton University Princeton, NJ 08544, USA hanliu@princeton.edu Abstract In this paper, we study the estimation of the k-dimensional sparse principal subspace of covariance matrix Σ in the high-dimensional setting. We aim to recover the oracle principal subspace solution, i.e., the principal subspace estimator obtained assuming the true support is known a priori. To this end, we propose a family of estimators based on the semidefinite relaxation of sparse PCA with novel regularizations. In particular, under a weak assumption on the magnitude of the population projection matrix, one estimator within this family exactly recovers the true support with high probability, has exact rank-k, and attains a p s/n statistical rate of convergence with s being the subspace sparsity level and n the sample size. Compared to existing support recovery results for sparse PCA, our approach does not hinge on the spiked covariance model or the limited correlation condition. As a complement to the first estimator that enjoys the oracle property, we prove that, another estimator within the family achieves a sharper statistical rate of convergence than the standard semidefinite relaxation of sparse PCA, even when the previous assumption on the magnitude of the projection matrix is violated. We validate the theoretical results by numerical experiments on synthetic datasets. 1 Introduction Principal Component Analysis (PCA) aims at recovering the top k leading eigenvectors u1, . . . , uk of the covariance matrix Σ from sample covariance matrix bΣ. In applications where the dimension p is much larger than the sample size n, classical PCA could be inconsistent [12]. To avoid this problem, one common assumption is that the leading eigenvector u1 of the population covariance matrix Σ is sparse, i.e., the number of nonzero elements in u1 is less than the sample size, s = supp(u1) < n. This gives rise to Sparse Principal Component Analysis (SPCA). In the past decade, significant progress has been made toward the methodological development [13, 8, 30, 22, 7, 14, 28, 19, 27] as well as theoretical understanding [12, 20, 1, 24, 21, 4, 6, 3, 2, 18, 15] of sparse PCA. However, all the above studies focused on estimating the leading eigenvector u1. When the top k eigenvalues of Σ are not distinct, there exist multiple groups of leading eigenvectors that are equivalent up to rotation. In order to address this problem, it is reasonable to de-emphasize eigenvectors and to instead focus on their span U, i.e., the principal subspace of variation. [23, 25, 16, 27] 1 proposed Subspace Sparsity, which defines sparsity on the projection matrix onto subspace U, i.e., Π∗= UU ⊤, as the number of nonzero entries on the diagonal of Π∗, i.e., s = |supp(diag(Π∗))|. They proposed to estimate the principal subspace instead of principal eigenvectors of Σ, based ℓ1,1-norm regularization on a convex set called Fantope [9], that provides a tight relaxation for simultaneous rank and orthogonality constraints on the positive semidefinite cone. The convergence rate of their estimator is O(λ1/(λk −λk+1)s p log p/n), where λk, k = 1, . . . , p is the k-th largest eigenvalue of Σ. Moreover, their support recovery relies on limited correlation condition (LCC) [16], which is similar to irrepresentable condition in sparse linear regression. We notice that [1] also analyzed the semidefinite relaxation of sparse PCA. However, they only considered rank-1 principal subspace and the stringent spiked covariance model, where the population covariance matrix is block diagonal. In this paper, we aim to recover the oracle principal subspace solution, i.e., the principal subspace estimator obtained assuming the true support is known a priori. Based on recent progress made on penalized M-estimators with nonconvex penalty functions [17, 26], we propose a family of estimators based on the semidefinite relaxation of sparse PCA with novel regularizations. It estimates the k-dimensional principal subspace of a population matrix Σ based on its empirical version bΣ. In particular, under a weak assumption on the magnitude of the projection matrix, i.e, min (i,j)∈T |Π∗ ij| ≥ν + C √ kλ1 λk −λk+1 r s n, where T is the support of Π∗, ν is a parameter from nonconvex penalty and C is an universal constant, one estimator within this family exactly recovers the oracle solution with high probability, and is exactly of rank k. It is worth noting that unlike the linear regression setting, where the estimators that can recover the oracle solution often have nonconvex formulations, our estimator here is obtained from a convex optimization1, and has unique global solution. Compared to existing support recovery results for sparse PCA, our approach does not hinge on the spiked covariance model [1] or the limited correlation condition [16]. Moreover, it attains the same convergence rate as standard PCA as if the support of the true projection matrix is provided a priori. More specifically, the Frobenius norm error of the estimator bΠ is bounded with high probability as follows ∥bΠ −Π∗∥F ≤ Cλ1 λk −λk+1 r ks n , where k is the dimension of the subspace. As a complement to the first estimator that enjoys the oracle property, we prove that, another estimator within the family achieves a sharper statistical rate of convergence than the standard semidefinite relaxation of sparse PCA, even when the previous assumption on the magnitude of the projection matrix is violated. This estimator is based on nonconvex optimizaiton. With a suitable choice of the regularization parameter, we show that any local optima to the optimization problem is a good estimator for the projection matrix of the true principal subspace. In particular, we show that the Frobenius norm error of the estimator bΠ is bounded with high probability as ∥bΠ −Π∗∥F ≤ Cλ1 λk −λk+1 rs1s n + r m1m2 log p n ! , where s1, m1, m2 are all no larger than s. Evidently, it is sharper than the convergence rate proved in [23]. Note that the above rate consists of two terms, the O( p s1s/n) term corresponds to the entries of projection matrix satisfying the previous assumption (i.e., with large magnitude), while O( p m1m2 log p/n) corresponds to the entries of projection matrix violating the previous assumption (i.e., with small magnitude). Finally, we demonstrate the numerical experiments on synthetic datasets, which support our theoretical analysis. The rest of this paper is arranged as follows. Section 2 introduces two estimators for the principal subspace of a covariance matrix. Section 3 analyzes the statistical properties of the two estimators. 1Even though we use nonconvex penalty, the resulting problem as a whole is still a convex optimization problem, because we add another strongly convex term in the regularization part, i.e., τ/2∥Π∥F . 2 We present an algorithm for solving the estimators in Section 4. Section 5 shows the experiments on synthetic datasets. Section 6 concludes this work with remarks. Notation. Let [p] be the shorthand for {1, . . . , p}. For matrices A, B of compatible dimension, ⟨A, B⟩:= tr(A⊤B) is the Frobenius inner product, and ∥A∥F = ⟨A, A⟩is the squared Frobenius norm. ∥x∥q is the usual ℓq norm with ∥x∥0 defined as the number of nonzero entries of x. ∥A∥a,b is the (a, b)-norm defined to be the ℓb norm of the vector of rowwise ℓa norms of A, e.g. ∥A∥1,∞ is the maximum absolute row sum. ∥A∥2 is the spectral norm of A, and ∥A∥∗is the trace norm (nuclear norm) of A. For a symmetric matrix A, we define λ1(A) ≥λ2(A) ≥. . . ≥λp(A) to be the eigenvalues of A with multiplicity. When the context is obvious we write λj = λj(A) as shorthand. 2 The Proposed Estimators In this section, we present a family of estimators based on the semidefinite relaxation of sparse PCA with novel regularizations, for the principal subspace of the population covariance matrix. Before going into the details of the proposed estimators, we first present the formal definition of principal subspace estimation. 2.1 Problem Definition Let Σ ∈Rp×p be an unknown covariance matrix, with eigen-decomposition as follows Σ = p X i=1 λiuiu⊤ i , where λ1 ≥. . . ≥λp are eigenvalues (with multiplicity) and u1, . . . , up ∈Rp are the associated eigenvectors. The k-dimensional principal subspace of Σ is the subspace spanned by u1, . . . , uk. The projection matrix to the k-dimensional principal subspace is Π∗= k X i=1 uiu⊤ i = UU ⊤, where U = [u1, . . . , uk] is an orthonormal matrix. The reason why principal subspace is more appealing is that it avoids the problem of un-identifiability of eigenvectors when the eigenvalues are not distinct. In fact, we only need to assume λk −λk+1 > 0 instead of λ1 > . . . > λk > λk+1. Then the principal subspace Π∗is unique and identifiable. We also assume that k is fixed. Next, we introduce the definition of Subspace Sparsity [25], which can be seen as the extension of conventional Eigenvector Sparsity used in sparse PCA. Definition 1. [25] (Subspace Sparsity) The projection Π∗onto the subspace spanned by the eigenvectors of Σ corresponding to its k largest eigenvalues satisfies ∥U∥2,0 ≤s, or equivalently ∥diag(Π)∥0 ≤s. In the extreme case that k = 1, the support of the projection matrix onto the rank-1 principal subspace is the same as the support of the sparse leading eigenvector. The problem definition of principal subspace estimation is: given an i.i.d. sample {x1, x2, . . . , xn} ⊂ Rp which are drawn from an unknown distribution of zero mean and covariance matrix Σ, we aim to estimate Π∗based on the empirical covariance matrix S ∈Rp×p, that is given by bΣ = 1/n Pn i=1 xix⊤ i . We are particularly interested in the high dimensional setting, where p →∞as n →∞, in sharp contrast to conventional setting where p is fixed and n →∞. Now we are ready to design a family of estimators for Π∗. 2.2 A Family of Sparse PCA Estimators Given a sample covariance matrix bΣ ∈Rp×p, we propose a family of sparse principal subspace estimator bΠ that is defined to be a solution of the semidefinite relaxation of sparse PCA bΠτ = argmin Π −⟨bΣ, Π⟩+ τ 2∥Π∥2 F + Pλ(Π), subject to Π ∈Fk, (1) 3 where τ > 0, λ > 0 is a regularization parameter, Fk is a convex body called the Fantope [9, 23], that is defined as follows Fk = {X : 0 ≺X ≺I and tr(X) = k }, and Pλ(Π) is a decomposable nonconvex penalty, i.e., Pλ(Π) = Pp i,j=1 pλ(Πij). Typical nonconvex penalties include the smoothly clipped absolute deviation (SCAD) penalty [10] and minimax concave penalty MCP [29], which can eliminate the estimation bias and attain more refined statistical rates of convergence [17, 26]. For example, MCP penalty is defined as pλ(t) = λ Z |t| 0  1 −z λb  dz =  λ|t| −t2 2b  1(|t| ≤bλ) + bλ2 2 1(|t| > bλ), (2) where b > 0 is a fixed parameter. An important property of the nonconvex penalties pλ(t) is that they can be formulated as the sum of the ℓ1 penalty and a concave part qλ(t): pλ(t) = λ|t| + qλ(t). For example, if pλ(t) is chosen to be the MCP penalty, then the corresponding qλ(t) is: qλ(t) = −t2 2b1(|t| ≤bλ) + bλ2 2 −λ|t|  1(|t| > bλ), We rely on the following regularity conditions on pλ(t) and its concave component qλ(t): (a) pλ(t) satisfies p′ λ(t) = 0, for |t| ≥ν > 0. (b) q′ λ(t) is monotone and Lipschitz continuous, i.e., for t′ ≥t, there exists a constant ζ−≥0 such that −ζ−≤q′ λ(t′) −q′ λ(t) t′ −t . (c) qλ(t) and q′ λ(t) pass through the origin, i.e., qλ(0) = q′ λ(0) = 0. (d) q′ λ(t) is bounded, i.e., |q′ λ(t)| ≤λ for any t. The above conditions apply to a variety of nonconvex penalty functions. For example, for MCP in (2), we have ν = bλ and ζ−= 1/b. It is easy to show that when τ > ζ−, the problem in (1) is strongly convex, and therefore its solution is unique. We notice that [16] also introduced the same regularization term τ/2∥Π∥2 F in their estimator. However, our motivation is quite different from theirs. We introduce this term because it is essential for the estimator in (1) to achieve the oracle property provided that the magnitude of all the entries in the population projection matrix is sufficiently large. We call (1) Convex Sparse PCA Estimator. Note that constraint Π ∈Fk only guarantees that the rank of bΠ is ≥k. However, we can prove that our estimator is of rank k exactly. This is in contrast to [23], where some post projection is needed, to make sure their estimator is of rank k. 2.3 Nonconvex Sparse PCA Estimator In the case that the magnitude of entries in the population projection matrix Π∗violates the previous assumption, (1) with τ > ζ−no longer enjoys the desired oracle property. To this end, we consider another estimator from the family of estimators in (1) with τ = 0, bΠτ=0 = argmin Π −⟨bΣ, Π⟩+ Pλ(Π), subject to Π ∈Fk. (3) Since −⟨bΣ, Π⟩is an affine function, and Pλ(Π) is nonconvex, the estimator in (3) is nonconvex. We simply refer to it as Nonconvex Sparse PCA Estimator. We will prove that it achieves a sharper statistical rate of convergence than the standard semidefinite relaxation of sparse PCA [23], even when the previous assumption on the magnitude of the projection matrix is violated. It is worth noting that although our estimators in (1) and (3) are for the projection matrix Π of the principal subspace, we can also provide an estimator of U. By definition, the true subspace satisfies 4 Π∗= UU ⊤. Thus, the estimator bU can be computed from bΠ using eigenvalue decomposition. In detail, we can set the columns of bU to be the top k leading eigenvectors of bΠ. In case that the top k eigenvalues of bΠ are the same, we can follow the standard PCA convention by rotating the eigenvectors with a rotation matrix R, such that (bUR)T bΣ(bUR) is diagonal. Then bUR is the orthonormal basis for the estimated principal subspace, and can be used for visualization and dimension reduction. 3 Statistical Properties of the Proposed Estimators In this section, we present the statistical properties of the two estimators in the family (1). One is with τ > ζ−, the other is with τ = 0. The proofs are all included in the longer version of this paper. To evaluate the statistical performance of the principal subspace estimators, we need to define the estimator error between the estimated projection matrix and the true projection matrix. In our study, we use the Frobenius norm error ∥bΠ −Π∗∥F . 3.1 Oracle Property and Convergence Rate of Convex Sparse PCA We first analyze the estimator in (1) when τ > ζ−. We prove that, the estimator bΠ in (1) recovers the support of Π∗under suitable conditions on its magnitude. Before we present this theorem, we introduce the definition of an oracle estimator, denoted by bΠO. Recall that S = supp(diag(Π∗)). The oracle estimator bΠO is defined as bΠO = argmin supp(diag(Π))⊂S,Π∈Fk L(Π). (4) where L(Π) = −⟨bΣ, Π⟩+ τ 2∥Π∥2 F . Note that the above oracle estimator is not a practical estimator, because we do not know the true support S in practice. The following theorem shows that, under suitable conditions, bΠ in (1) is the same as the oracle estimator bΠO with high probability, and therefore exactly recovers the support of Π∗. Theorem 1. (Support Recovery) Suppose the nonconvex penalty Pλ(Π) = Pp i,j=1 pλ(Π) satisfies conditions (a) and (b). If Π∗satisfies min(i,j)∈T |Π∗ ij| ≥ν + C √ kλ1/(λk −λk+1) p s/n. For the estimator in (1) with the regularization parameter λ = Cλ1 p log p/n and τ > ζ−, we have with probability at least 1 −1/n2 that bΠ = bΠO, which further implies supp(diag(bΠ)) = supp(diag(bΠO)) = supp(diag(Π∗)) and rank(bΠ) = rank(bΠO) = k. For example, if we use MCP penalty, the magnitude assumption turns out to be min(i,j)∈T |Π∗ ij| ≥ Cbλ1 p log p/n + C √ kλ1/(λk −λk+1) p s/n. Note that in our proposed estimator in (1), we do not rely on any oracle knowledge on the true support. Our theory in Theorem 1 shows that, with high probability, the estimator is identical to the oracle estimator, and thus exactly recovers the true support. Compared to existing support recovery results for sparse PCA [1, 16], our condition on the magnitude is weaker. Note that the limited correlation condition [16] and the even stronger spiked covariance condition [1] impose constraints not only on the principal subspace corresponding to λ1, . . . , λk, but also on the “non-signal” part, i.e., the subspace corresponding to λk+1, . . . , λp. Unlike these conditions, we only impose conditions on the “signal” part, i.e., the magnitude of the projection matrix Π∗corresponding to λ1, . . . , λk. We attribute the oracle property of our estimator to novel regularizations (τ/2∥Π∥2 F plus nonconvex penalty). The oracle property immediately implies that under the above conditions on the magnitude, the estimator in (1) achieves the convergence rate of standard PCA as if we know the true support S a priori. This is summarized in the following theorem. Theorem 2. Under the same conditions of Theorem 1, we have with probability at least 1 −1/n2 that ∥bΠ −Π∗∥F ≤ C √ kλ1 λk −λk+1 r s n, 5 for some universal constant C. Evidently, the estimator attains a much sharper statistical rate of convergence than the state-of-the-art result proved in [23]. 3.2 Convergence Rate of Nonconvex Sparse PCA We now analyze the estimator in (3), which is a special case of (1) when τ = 0. We basically show that any local optima of the non-convex optimization problem in (3) is a good estimator. In other words, our theory applies to any projection matrix bΠτ=0 ∈Rp×p that satisfies the first-order necessary conditions (variational inequality) to be a local minimum of (3): ⟨bΠτ=0 −Π′, −bΣ + ∇Pλ(bΠ)⟩≤0, ∀Π′ ∈Fk Recall that S = supp(diag(Π∗)) with |S| = s, T = S × S with |T| = s2, and T c = [p] × [p] \ T. For (i, j) ∈T1 ⊂T with |T1| = t1, we assume |Π∗ ij| ≥ν, while for (i, j) ∈T2 ⊂T with |T2| = t2, we assume |Π∗ ij| < ν. Clearly, we have s2 = t1 + t2. There exists a minimal submatrix A ∈Rn1×n2 of Π∗, which contains all the elements in T1, with s1 = min{n1, n2}. There also exists a minimal submatrix B ∈Rm1×m2 of Π∗, that contains all the elements in T2. Note that in general, s1 ≤s, m1 ≤s and m2 ≤s. In the worst case, we have s1 = m1 = m2 = s. Theorem 3. Suppose the nonconvex penalty Pλ(Π) = Pp i,j=1 pλ(Π) satisfies conditions (b) (c) and (d). For the estimator in (3) with regularization parameter λ = Cλ1 p log p/n and ζ−≤ (λk −λk+1)/4, with probability at least 1 −4/p2, any local optimal solution bΠτ=0 satisfies ∥bΠτ=0 −Π∗∥F ≤ 4Cλ1√s1 (λk −λk+1) r s n | {z } T1:|Π∗ ij|≥ν + 12Cλ1√m1m2 (λk −λk+1) r log p n | {z } T2:|Π∗ ij|<ν . Note that the upper bound can be decomposed into two parts according to the magnitude of the entries in the true projection matrix, i.e., |Π∗ ij|, 1 ≤i, j ≤p. We have the following comments: On the one hand, for those strong “signals”, i.e., |Π∗ ij| ≥ν, we are able to achieve the convergence rate of O(λ1√s1/(λk −λk+1) p s/n). Since s1 is at most equal to s, the worst-case rate is O(λ1/(λk − λk+1)s/√n), which is sharper than the rate proved in [23], i.e., O(λ1/(λk −λk+1)s p log p/n). In the other case that s1 < s, the convergence rate could be even sharper. On the other hand, for those weak “signals”, i.e., |Π∗ ij| < ν, we are able to achieve the convergence rate of O(λ1√m1m2/(λk −λk+1) p log p/n). Since both m1 and m2 are at most equal to s, the worst-case rate is O(λ1/(λk −λk+1)s p log p/n), which is the same as the rate proved in [23]. In the other case that √m1m2 < s, the convergence rate will be sharper than that in [23]. The above discussions clearly demonstrate the advantage of our estimator, which essentially benefits from non-convex penalty. 4 Optimization Algorithm In this section, we present an optimization algorithm to solve (1) and (3). Since (3) is a special case of (1) with τ = 0, it is sufficient to develop an algorithm for solving (1). Observing that (1) has both nonsmooth regularization term and nontrivial constraint set Fk, it is difficult to directly apply gradient descent and its variants. Following [23], we present an alternating direction method of multipliers (ADMM) algorithm. The proposed ADMM algorithm can efficiently compute the global optimum of (1). It can also find a local optimum to (3). It is worth noting that other algorithms such as Peaceman Rachford Splitting Method [11] can also be used to solve (1). We introduce an auxiliary variable Φ ∈Rp×p, and consider an equivalent form of (1) as follows argmin Π,Φ −⟨bΣ, Π⟩+ τ 2∥Π∥2 F + Pλ(Φ), subject to Π = Φ, Π ∈Fk. (5) 6 The augmented Lagrangian function corresponding to (5) is L(Π, Φ, Θ) = ∞1Fk(Π) −⟨bΣ, Π⟩+ τ 2∥Π∥2 F + Pλ(Φ) + ⟨Θ, Π −Φ⟩+ ρ 2∥Π −Φ∥2 F , (6) where Θ ∈Rd×d is the Lagrange multiplier associated with the equality constraint Π = Φ in (5), and ρ > 0 is a penalty parameter that enforces the equality constraint Π = Φ. The detailed update scheme is described in Algorithm 1. In details, the first subproblem (Line 5 of Algorithm 1) can be solved by projecting ρ/(ρ + τ)Φ(t) −1/(ρ + τ)Θ(t) + 1/(ρ + τ)bΣ onto Fantope Fk. This projection has a simple form solution as shown by [23, 16]. The second subproblem (Line 6 of Algorithm 1) can be solved by generalized soft-thresholding operator as shown by [5] [17]. Algorithm 1 Solving Convex Relaxation (5) using ADMM. 1: Input: Covariance Matrix Estimator bΣ 2: Parameter: Regularization parameters λ>0, τ ≥0, Penalty parameter ρ>0 of the augmented Lagrangian, Maximum number of iterations T 3: Π(0) ←0, Φ(0) ←0, Θ(0) ←0 4: For t = 0, . . . , T −1 5: Π(t+1) ←arg minΠ∈Fk 1 2∥Π −( ρ ρ+τ Φ(t) − 1 ρ+τ Θ(t) + 1 ρ+τ bΣ)∥2 F 6: Φ(t+1) ←arg minΦ 1 2∥Φ −(Π(t+1) + 1 ρΘ(t))∥2 F + P λ ρ (Φ) 7: Θ(t+1) ←Θ(t) + ρ(Π(t+1) −Φ(t+1)) 8: End For 9: Output: Π(T ) 5 Experiments In this section, we conduct simulations on synthetic datasets to validate the effectiveness of the proposed estimators in Section 2. We generate two synthetic datasets via designing two covariance matrices. The covariance matrix Σ is basically constructed through the eigenvalue decomposition. In detail, for synthetic dataset I, we set s = 5 and k = 1. The leading eigenvalue of its covariance matrix Σ is set as λ1 = 100, and its corresponding eigenvector is sparse in the sense that only the first s = 5 entries are nonzero and set be to 1/ √ 5. The other eigenvalues are set as λ2 = . . . = λp = 1, and their eigenvectors are chosen arbitrarily. For synthetic dataset II, we set s = 10 and k = 5. The top-5 eigenvalues are set as λ1 = . . . = λ4 = 100 and λ5 = 10. We generate their corresponding eigenvectors by sampling its nonzero entries from a standard Gaussian distribution, and then orthnormalizing them while retaining the first s = 10 rows nonzero. The other eigenvalues are set as λ6 = . . . = λp = 1, and the associated eigenvectors are chosen arbitrarily. Based on the covariance matrix, the groundtruth rank-k projection matrix Π∗can be immediately calculated. Note that synthetic dataset II is more challenging than synthetic dataset I, because the smallest magnitude of Π∗in synthetic dataset I is 0.2, while that in synthetic dataset II is much smaller (about 10−3). We sample n = 80 i.i.d. observations from a normal distribution N(0, Σ) with p = 128, and then calculate the sample covariance matrix bΣ. Since the focus of this paper is principal subspace estimation rather than principal eigenvectors estimation, it is sufficient to compare our proposed estimators (Convex SPCA in (1) and Nonconvex SPCA in 3) with the estimator proposed in [23], which is referred to as Fantope SPCA. Note that Fantope PCA is the pioneering and the state-of-the-art estimator for principal subspace estimation of SPCA. However, since Fantope SPCA uses convex penalty ∥Π∥1,1on the projection matrix Π, the estimator is biased [29]. We also compare our proposed estimators with the oracle estimator in (4), which is not a practical estimator but provides the optimal results that we could achieve. In our experiments, we need to compare the estimator attained by the algorithmic procedure and the oracle estimator. To obtain the oracle estimator, we apply standard PCA on the submatrix (supported on the true support) of the sample covariance bΣ. Note that the true support is known because we use synthetic datasets here. In order to evaluate the performance of the above estimators, we look at the Frobenius norm error ∥bΠ −Π∗∥F . We also use True Positive Rate (TPR) and False Positive Rate (FPR) to evaluate the 7 support recovery result. The larger the TPR and the smaller the FPR, the better the support recovery result. Both of our estimators use MCP penalty, though other nonconvex penalties such as SCAD could be used as well. In particular, we set b = 3. For Convex SPCA, we set τ = 2 b. The regularization parameter λ in our estimators as well as Fantope SPCA is tuned by 5-fold cross validation on a held-out dataset. The experiments are repeated 20 times, and the mean as well as the standard errors are reported. The empirical results on synthetic datasets I and II are displayed in Table 1. Table 1: Empirical results for subspace estimation on synthetic datasets I and II. Synthetic I ∥bΠ −Π∗∥F TPR FPR n = 80 Oracle 0.0289±0.0134 1 0 p = 128 Fantope SPCA 0.0317±0.0149 1.0000±0.0000 0.0146±0.0218 s = 5 Convex SPCA 0.0290±0.0132 1.0000±0.0000 0.0000±0.0000 k = 1 Nonconvex SPCA 0.0290±0.0133 1.0000±0.0000 0.0000±0.0000 Synthetic II ∥bΠ −Π∗∥F TPR FPR n = 80 Oracle 0.1487±0.0208 1 0 p = 128 Fantope SPCA 0.2788±0.0437 1.0000±0.0000 0.8695±0.1634 s = 10 Convex SPCA 0.2031±0.0331 1.0000±0.0000 0.5814±0.0674 k = 5 Nonconvex SPCA 0.2041±0.0326 1.0000±0.0000 0.6000±0.0829 It can be observed that both Convex SPCA and Nonconvex SPCA estimators outperform Fantope SPCA estimator [23] greatly in both datasets. In details, on synthetic dataset I with relatively large magnitude of Π∗, our Convex SPCA estimator achieves the same estimation error and perfect support recovery as the oracle estimator. This is consistent with our theoretical results in Theorems 1 and 2. In addition, our Nonconvex SPCA estimator achieves very similar results with Convex SPCA. This is not very surprising, because provided that the magnitude of all the entries in Π∗is large, Nonconvex SPCA attains a rate which is only 1/√s slower than Convex SPCA. Fantope SPCA cannot recover the support perfectly because it detected several false positive supports. This implies that the LCC condition is stronger than our large magnitude assumption, and does not hold on this dataset. On synthetic dataset II, our Convex SPCA estimator does not perform as well as the oracle estimator. This is because the magnitude of Π∗is small (about 10−3). Given the sample size n = 80, the conditions of Theorems 1 are violated. But note that Convex SPCA is still slightly better than Nonconvex SPCA. And both of them are much better than Fantope SPCA. This again illustrates the superiority of our estimators over existing best approach, i.e., Fantope SPCA [23]. 6 Conclusion In this paper, we study the estimation of the k-dimensional principal subspace of a population matrix Σ based on sample covariance matrix bΣ. We proposed a family of estimators based on novel regularizations. The first estimator is based on convex optimization, which is suitable for projection matrix with large magnitude entries. It enjoys oracle property and the same convergence rate as standard PCA. The second estimator is based on nonconvex optimization, and it also attains faster rate than existing principal subspace estimator, even when the large magnitude assumption is violated. Numerical experiments on synthetic datasets support our theoretical results. Acknowledgement We would like to thank the anonymous reviewers for their helpful comments. This research is partially supported by the grants NSF IIS1408910, NSF IIS1332109, NIH R01MH102339, NIH R01GM083084, and NIH R01HG06841. 8 References [1] A. Amini and M. Wainwright. High-dimensional analysis of semidefinite relaxations for sparse principal components. The Annals of Statistics, 37(5B):2877–2921, 2009. [2] Q. Berthet and P. Rigollet. Computational lower bounds for sparse PCA. arXiv preprint arXiv:1304.0828, 2013. [3] Q. Berthet and P. Rigollet. Optimal detection of sparse principal components in high dimension. The Annals of Statistics, 41(4):1780–1815, 2013. [4] A. Birnbaum, I. M. Johnstone, B. Nadler, D. Paul, et al. Minimax bounds for sparse PCA with noisy high-dimensional data. The Annals of Statistics, 41(3):1055–1084, 2013. [5] P. Breheny and J. Huang. Coordinate descent algorithms for nonconvex penalized regression, with applications to biological feature selection. The Annals of Applied Statistics, 5(1):232–253, 03 2011. [6] T. T. Cai, Z. Ma, Y. Wu, et al. Sparse PCA: Optimal rates and adaptive estimation. The Annals of Statistics, 41(6):3074–3110, 2013. [7] A. d’Aspremont, F. Bach, and L. Ghaoui. Optimal solutions for sparse principal component analysis. The Journal of Machine Learning Research, 9:1269–1294, 2008. [8] A. d’Aspremont, L. E. Ghaoui, M. I. Jordan, and G. R. Lanckriet. A direct formulation for sparse PCA using semidefinite programming. SIAM Review, pages 434–448, 2007. [9] J. Dattorro. Convex Optimization & Euclidean Distance Geometry. Meboo Publishing USA, 2011. [10] J. Fan and R. Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American Statistical Association, 96(456):1348–1360, 2001. [11] B. He, H. Liu, Z. Wang, and X. Yuan. A strictly contractive peaceman–rachford splitting method for convex programming. SIAM Journal on Optimization, 24(3):1011–1040, 2014. [12] I. Johnstone and A. Lu. On consistency and sparsity for principal components analysis in high dimensions. Journal of the American Statistical Association, 104(486):682–693, 2009. [13] I. Jolliffe, N. Trendafilov, and M. Uddin. A modified principal component technique based on the lasso. Journal of Computational and Graphical Statistics, 12(3):531–547, 2003. [14] 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. [15] R. Krauthgamer, B. Nadler, and D. Vilenchik. Do semidefinite relaxations really solve sparse PCA? arXiv preprint arXiv:1306.3690, 2013. [16] J. Lei and V. Q. Vu. Sparsistency and agnostic inference in sparse PCA. arXiv preprint arXiv:1401.6978, 2014. [17] P.-L. Loh and M. J. Wainwright. Regularized m-estimators with nonconvexity: Statistical and algorithmic theory for local optima. arXiv preprint arXiv:1305.2436, 2013. [18] K. Lounici. Sparse principal component analysis with missing observations. In High Dimensional Probability VI, pages 327–356. Springer, 2013. [19] Z. Ma. Sparse principal component analysis and iterative thresholding. The Annals of Statistics, 41(2):772– 801, 2013. [20] D. Paul and I. M. Johnstone. Augmented sparse principal component analysis for high dimensional data. arXiv preprint arXiv:1202.1242, 2012. [21] D. Shen, H. Shen, and J. Marron. Consistency of sparse PCA in high dimension, low sample size contexts. Journal of Multivariate Analysis, 115:317–333, 2013. [22] H. Shen and J. Huang. Sparse principal component analysis via regularized low rank matrix approximation. Journal of multivariate analysis, 99(6):1015–1034, 2008. [23] V. Q. Vu, J. Cho, J. Lei, and K. Rohe. Fantope projection and selection: A near-optimal convex relaxation of sparse pca. In NIPS, pages 2670–2678, 2013. [24] V. Q. Vu and J. Lei. Minimax rates of estimation for sparse PCA in high dimensions. In International Conference on Artificial Intelligence and Statistics, pages 1278–1286, 2012. [25] V. Q. Vu and J. Lei. Minimax sparse principal subspace estimation in high dimensions. The Annals of Statistics, 41(6):2905–2947, 2013. [26] Z. Wang, H. Liu, and T. Zhang. Optimal computational and statistical rates of convergence for sparse nonconvex learning problems. The Annals of Statistics, 42(6):2164–2201, 12 2014. [27] Z. Wang, H. Lu, and H. Liu. Nonconvex statistical optimization: minimax-optimal sparse pca in polynomial time. arXiv preprint arXiv:1408.5352, 2014. [28] X.-T. Yuan and T. Zhang. Truncated power method for sparse eigenvalue problems. The Journal of Machine Learning Research, 14(1):899–925, 2013. [29] C.-H. Zhang. Nearly unbiased variable selection under minimax concave penalty. Ann. Statist., 38(2):894– 942, 2010. [30] H. Zou, T. Hastie, and R. Tibshirani. Sparse principal component analysis. Journal of computational and graphical statistics, 15(2):265–286, 2006. 9
2014
386
5,498
SerialRank: Spectral Ranking using Seriation Fajwel Fogel C.M.A.P., ´Ecole Polytechnique, Palaiseau, France fogel@cmap.polytechnique.fr Alexandre d’Aspremont CNRS & D.I., ´Ecole Normale Sup´erieure Paris, France aspremon@ens.fr Milan Vojnovic Microsoft Research, Cambridge, UK milanv@microsoft.com Abstract We describe a seriation algorithm for ranking a set of n items given pairwise comparisons between these items. Intuitively, the algorithm assigns similar rankings to items that compare similarly with all others. It does so by constructing a similarity matrix from pairwise comparisons, using seriation methods to reorder this matrix and construct a ranking. We first show that this spectral seriation algorithm recovers the true ranking when all pairwise comparisons are observed and consistent with a total order. We then show that ranking reconstruction is still exact even when some pairwise comparisons are corrupted or missing, and that seriation based spectral ranking is more robust to noise than other scoring methods. An additional benefit of the seriation formulation is that it allows us to solve semi-supervised ranking problems. Experiments on both synthetic and real datasets demonstrate that seriation based spectral ranking achieves competitive and in some cases superior performance compared to classical ranking methods. 1 Introduction We study the problem of ranking a set of n items given pairwise comparisons between these items. In practice, the information about pairwise comparisons is usually incomplete, especially in the case of a large set of items, and the data may also be noisy, that is some pairwise comparisons could be incorrectly measured and incompatible with the existence of a total ordering. Ranking is a classic problem but its formulations vary widely. For example, website ranking methods such as PageRank [Page et al., 1998] and HITS [Kleinberg, 1999] seek to rank web pages based on the hyperlink structure of the web, where links do not necessarily express consistent preference relationships (e.g. a can link to b and b can link c, and c can link to a). The setting we study here goes back at least to [Kendall and Smith, 1940] and seeks to reconstruct a ranking between items from pairwise comparisons reflecting a total ordering. In this case, the directed graph of all pairwise comparisons, where every pair of vertices is connected by exactly one of two possible directed edges, is usually called a tournament graph in the theoretical computer science literature or a “round robin” in sports, where every player plays every other player once and each preference marks victory or defeat. The motivation for this formulation often stems from the fact that in many applications, e.g. music, images, and movies, preferences are easier to express in relative terms (e.g. a is better than b) rather than absolute ones (e.g. a should be ranked fourth, and b seventh). 1 Assumptions about how the pairwise preference information is obtained also vary widely. A subset of preferences is measured adaptively in [Ailon, 2011; Jamieson and Nowak, 2011], while [Negahban et al., 2012], for example, assume that preferences are observed iteratively, and [Freund et al., 2003] extract them at random. In other settings, the full preference matrix is observed, but is perturbed by noise: in e.g. [Bradley and Terry, 1952; Luce, 1959; Herbrich et al., 2006], a parametric model is assumed over the set of permutations, which reformulates ranking as a maximum likelihood problem. Loss function and algorithmic approaches vary as well. Kenyon-Mathieu and Schudy [2007], for example, derive a PTAS for the minimum feedback arc set problem on tournaments, i.e. the problem of finding a ranking that minimizes the number of upsets (a pair of players where the player ranked lower on the ranking beats the player ranked higher). In practice, the complexity of this method is relatively high, and other authors [see e.g. Keener, 1993; Negahban et al., 2012] have been using spectral methods to produce more efficient algorithms (each pairwise comparison is understood as a link pointing to the preferred item). Simple scoring methods such as the point difference rule [Huber, 1963; Wauthier et al., 2013] produce efficient estimates at very low computational cost. Ranking has also been approached as a prediction problem, i.e. learning to rank [Schapire and Singer, 1998], with [Joachims, 2002] for example using support vector machines to learn a score function. Finally, in the Bradley-Terry-Luce framework, the maximum likelihood problem is usually solved using fixed point algorithms or EM-like majorization-minimization techniques [Hunter, 2004] for which no precise computational complexity bounds are known. Here, we show that the ranking problem is directly related to another classical ordering problem, namely seriation: we are given a similarity matrix between a set of n items and assume that the items can be ordered along a chain such that the similarity between items decreases with their distance within this chain (i.e. a total order exists). The seriation problem then seeks to reconstruct the underlying linear ordering based on unsorted, possibly noisy, pairwise similarity information. Atkins et al. [1998] produced a spectral algorithm that exactly solves the seriation problem in the noiseless case, by showing that for similarity matrices computed from serial variables, the ordering of the second eigenvector of the Laplacian matrix (a.k.a. the Fiedler vector) matches that of the variables. In practice, this means that spectral clustering exactly reconstructs the correct ordering provided items are organized in a chain. Here, adapting these results to ranking produces a very efficient polynomial-time ranking algorithm with provable recovery and robustness guarantees. Furthermore, the seriation formulation allows us to handle semi-supervised ranking problems. Fogel et al. [2013] show that seriation is equivalent to the 2-SUM problem and study convex relaxations to seriation in a semi-supervised setting, where additional structural constraints are imposed on the solution. Several authors [Blum et al., 2000; Feige and Lee, 2007] have also focused on the directly related Minimum Linear Arrangement (MLA) problem, for which excellent approximation guarantees exist in the noisy case, albeit with very high polynomial complexity. The main contributions of this paper can be summarized as follows. We link seriation and ranking by showing how to construct a consistent similarity matrix based on consistent pairwise comparisons. We then recover the true ranking by applying the spectral seriation algorithm in [Atkins et al., 1998] to this similarity matrix (we call this method SerialRank in what follows). In the noisy case, we then show that spectral seriation can perfectly recover the true ranking even when some of the pairwise comparisons are either corrupted or missing, provided that the pattern of errors is relatively unstructured. We show in particular that, in a regime where a high proportion of comparions are observed, some incorrectly, the spectral solution is more robust to noise than classical scoring based methods. Finally, we use the seriation results in [Fogel et al., 2013] to produce semi-supervised ranking solutions. The paper is organized as follows. In Section 2 we recall definitions related to seriation, and link ranking and seriation by showing how to construct well ordered similarity matrices from well ranked items. In Section 3 we apply the spectral algorithm of [Atkins et al., 1998] to reorder these similarity matrices and reconstruct the true ranking in the noiseless case. In Section 4 we then show that this spectral solution remains exact in a noisy regime where a random subset of comparisons is corrupted. Finally, in Section 5 we illustrate our results on both synthetic and real datasets, and compare ranking performance with classical maximum likelihood, spectral and scoring based approaches. Auxiliary technical results are detailed in Appendix A. 2 2 Seriation, Similarities & Ranking In this section we first introduce the seriation problem, i.e. reordering items based on pairwise similarities. We then show how to write the problem of ranking given pairwise comparisons as a seriation problem. 2.1 The Seriation Problem The seriation problem seeks to reorder n items given a similarity matrix between these items, such that the more similar two items are, the closer they should be. This is equivalent to supposing that items can be placed on a chain where the similarity between two items decreases with the distance between these items in the chain. We formalize this below, following [Atkins et al., 1998]. Definition 2.1 We say that the matrix A 2 Sn is an R-matrix (or Robinson matrix) if and only if it is symmetric and Ai,j Ai,j+1 and Ai+1,j Ai,j in the lower triangle, where 1 j < i n. Another way to formulate R-matrix conditions is to impose Aij Akl if |i −j| |k −l| offdiagonal, i.e. the coefficients of A decrease as we move away from the diagonal. We also introduce a definition for strict R-matrices A, whose rows/columns cannot be permuted without breaking the R-matrix monotonicity conditions. We call reverse identity permutation the permutation that puts rows and columns {1, . . . , n} of a matrix A in reverse order {n, n −1, . . . , 1}. Definition 2.2 An R-matrix A 2 Sn is called strict-R if and only if the identity and reverse identity permutations of A are the only permutations producing R-matrices. Any R-matrix with only strict R-constraints is a strict R-matrix. Following [Atkins et al., 1998], we will say that A is pre-R if there is a permutation matrix ⇧such that ⇧A⇧T is a R-matrix. Given a pre-R matrix A, the seriation problem consists in finding a permutation ⇧such that ⇧A⇧T is a R-matrix. Note that there might be several solutions to this problem. In particular, if a permutation ⇧is a solution, then the reverse permutation is also a solution. When only two permutations of A produce R-matrices, A will be called pre-strict-R. 2.2 Constructing Similarity Matrices from Pairwise Comparisons Given an ordered input pairwise comparison matrix, we now show how to construct a similarity matrix which is strict-R when all comparisons are given and consistent with the identity ranking (i.e. items are ranked in the increasing order of indices). This means that the similarity between two items decreases with the distance between their ranks. We will then be able to use the spectral seriation algorithm by [Atkins et al., 1998] described in Section 3 to recover the true ranking from a disordered similarity matrix. We first explain how to compute a pairwise similarity from binary comparisons between items by counting the number of matching comparisons. Another formulation allows to handle the generalized linear model. 2.2.1 Similarities from Pairwise Comparisons Suppose we are given a matrix of pairwise comparisons C 2 {−1, 0, 1}n⇥n such that Ci,j+Cj,i = 0 for every i 6= j and Ci,j = ( 1 if i is ranked higher than j 0 if i and j are not compared or in a draw −1 if j is ranked higher than i (1) and, by convention, we define Ci,i = 1 for all i 2 {1, . . . , n} (Ci,i values have no effect in the ranking method presented in algorithm SerialRank). We also define the pairwise similarity matrix Smatch as Smatch i,j = n X k=1 ✓1 + Ci,kCj,k 2 ◆ . (2) 3 Since Ci,kCj,k = 1 if Ci,k and Cj,k have same signs, and Ci,kCj,k = −1 if they have opposite signs, Smatch i,j counts the number of matching comparisons between i and j with other reference items k. If i or j is not compared with k, then Ci,kCj,k = 0 and the term (1 + Ci,kCj,k)/2 has an average effect on the similarity of 1/2. The intuition behind this construction is easy to understand in a tournament setting: players that beat the same players and are beaten by the same players should have a similar ranking. We can write Smatch in the following equivalent form Smatch = 1 2 % n11T + CCT & . (3) Without loss of generality, we assume in the following propositions that items are ranked in increasing order of their indices (identity ranking). In the general case, we simply replace the strict-R property by the pre-strict-R property. The next result shows that when all comparisons are given and consistent with the identity ranking, then the similarity matrix Smatch is a strict R-matrix. Proposition 2.3 Given all pairwise comparisons Ci,j 2 {−1, 0, 1} between items ranked according to the identity permutation (with no ties), the similarity matrix Smatch constructed as given in (2) is a strict R-matrix and Smatch ij = n −(max{i, j} −min{i, j}) (4) for all i, j = 1, . . . , n. 2.2.2 Similarities in the Generalized Linear Model Suppose that paired comparisons are generated according to a generalized linear model (GLM), i.e. we assume that the outcomes of paired comparisons are independent and for any pair of distinct items, item i is observed to be preferred over item j with probability Pi,j = H(⌫i −⌫j) (5) where ⌫2 Rn is a vector of strengths or skills parameters and H : R ! [0, 1] is a function that is increasing on R and such that H(−x) = 1 −H(x) for all x 2 R, and limx!−1 H(x) = 0 and limx!1 H(x) = 1. A well known special instance of the generalized linear model is the Bradley-Terry-Luce model for which H(x) = 1/(1 + e−x), for x 2 R. Let mi,j be the number of times items i and j were compared, Cs i,j 2 {−1, 1} be the outcome of comparison s and Q be the matrix of corresponding empirical probabilities, i.e. if mi,j > 0 we have Qi,j = 1 mi,j mi,j X s=1 Cs i,j + 1 2 and Qi,j = 1/2 in case mi,j = 0. We then define the similarity matrix Sglm from the observations Q as Sglm i,j = n X k=1 {mi,kmj,k>0} ✓ 1 −|Qi,k −Qj,k| 2 ◆ + {mi,kmj,k=0} 2 . (6) Since the comparisons are independent we have that Qi,j converges to Pi,j as mi,j goes to infinity and Sglm i,j ! n X k=1 ✓ 1 −|Pi,k −Pj,k| 2 ◆ . The result below shows that this limit similarity matrix is a strict R-matrix when the variables are properly ordered. Proposition 2.4 If the items are ordered according to the order in decreasing values of the skill parameters, in the limit of large number of observations, the similarity matrix Sglm is a strict R matrix. Notice that we recover the original definition of Smatch in the case of binary probabilities, though it does not fit in the Generalized Linear Model. Note also that these definitions can be directly extended to the setting where multiple comparisons are available for each pair and aggregated in comparisons that take fractional values (e.g. in a tournament setting where participants play several times against each other). 4 Algorithm 1 Using Seriation for Spectral Ranking (SerialRank) Input: A set of pairwise comparisons Ci,j 2 {−1, 0, 1} or [−1, 1]. 1: Compute a similarity matrix S as in §2.2 2: Compute the Laplacian matrix LS = diag(S1) −S (SerialRank) 3: Compute the Fiedler vector of S. Output: A ranking induced by sorting the Fiedler vector of S (choose either increasing or decreasing order to minimize the number of upsets). 3 Spectral Algorithms We first recall how the spectral clustering approach can be used to recover the true ordering in seriation problems by computing an eigenvector, with computational complexity O(n2 log n) [Kuczynski and Wozniakowski, 1992]. We then apply this method to the ranking problem. 3.1 Spectral Seriation Algorithm We use the spectral computation method originally introduced in [Atkins et al., 1998] to solve the seriation problem based on the similarity matrices defined in the previous section. We first recall the definition of the Fiedler vector. Definition 3.1 The Fiedler value of a symmetric, nonnegative and irreducible matrix A is the smallest non-zero eigenvalue of its Laplacian matrix LA = diag(A1) −A. The corresponding eigenvector is called Fiedler vector and is the optimal solution to min{yT LAy : y 2 Rn, yT 1 = 0, kyk2 = 1}. The main result from [Atkins et al., 1998], detailed below, shows how to reorder pre-R matrices in a noise free case. Proposition 3.2 [Atkins et al., 1998, Th. 3.3] Let A 2 Sn be an irreducible pre-R-matrix with a simple Fiedler value and a Fiedler vector v with no repeated values. Let ⇧1 2 P (respectively, ⇧2) be the permutation such that the permuted Fiedler vector ⇧1v is strictly increasing (decreasing). Then ⇧1A⇧T 1 and ⇧2A⇧T 2 are R-matrices, and no other permutations of A produce R-matrices. 3.2 SerialRank: a Spectral Ranking Algorithm In Section 2, we showed that similarities Smatch and Sglm are pre-strict-R when all comparisons are available and consistent with an underlying ranking of items. We now use the spectral seriation method in [Atkins et al., 1998] to reorder these matrices and produce an output ranking. We call this algorithm SerialRank and prove the following result. Proposition 3.3 Given all pairwise comparisons for a set of totally ordered items and assuming there are no ties between items, performing algorithm SerialRank, i.e. sorting the Fiedler vector of the matrix Smatch defined in (3) recovers the true ranking of items. Similar results apply for Sglm when we are given enough comparisons in the Generalized Linear Model. This last result guarantees recovery of the true ranking of items in the noiseless case. In the next section, we will study the impact of corrupted or missing comparisons on the inferred ranking of items. 3.3 Hierarchical Ranking In a large dataset, the goal may be to rank only a subset of top rank items. In this case, we can first perform spectral ranking (cheap) and then refine the ranking of the top set of items using either the SerialRank algorithm on the top comparison submatrix, or another seriation algorithm such as 5 the convex relaxation in [Fogel et al., 2013]. This last method would also allow us to solve semisupervised ranking problems, given additional information on the structure of the solution. 4 Robustness to Corrupted and Missing Comparisons In this section we study the robustness of SerialRank using Smatch with respect to noisy and missing pairwise comparisons. We will see that noisy comparisons cause ranking ambiguities for the standard point score method and that such ambiguities can be lifted by the spectral ranking algorithm. We show in particular that the SerialRank algorithm recovers the exact ranking when the pattern of errors is random and errors are not too numerous. We define here the point score wi of an item i, also known as point-difference, or row-sum, as wi = Pn k=1 Ck,i which corresponds to the number of wins minus the number of losses in a tournament setting. Proposition 4.1 Given all pairwise comparisons Cs,t 2 {−1, 1} between items ranked according to their indices, suppose the signs of m comparisons indexed (i1, j1), . . . , (im, jm) are switched. 1. For the case of one corrupted comparison, if j1 −i1 > 2 then the spectral ranking recovers the true ranking whereas the standard point score method induces ties between the pairs of items (i1, i1 + 1) and (j1 −1, j1). 2. For the general case of m ≥1 corrupted comparisons, suppose that the following condition holds true |i −j| > 2, for all i, j 2 {i1, . . . , im, j1, . . . , jm} such that i 6= j, (7) then, Smatch is a strict R-matrix, and thus the spectral ranking recovers the true ranking whereas the standard point score method induces ties between 2m pairs of items. For the case of one corrupted comparison, note that the separation condition on the pair of items (i, j) is necessary. When the comparison Ci,j between two adjacent items according to the true ranking is corrupted, no ranking method can break the resulting tie. For the case of arbitrary number of corrupted comparisons, condition (7) is a sufficient condition only. Using similar arguments, we can also study conditions for recovering the true ranking in the case with missing comparisons. These scenarios are actually slightly less restrictive than the noisy cases and are covered in the supplementary material. We now estimate the number of randomly corrupted entries that can be tolerated for perfect recovery of the true ranking. Proposition 4.2 Given a comparison matrix for a set of n items with m corrupted comparisons selected uniformly at random from the set of all possible item pairs. Algorithm SerialRank guarantees that the probability of recovery p(n, m) satisfies p(n, m) ≥1 −δ, provided that m = O( p δn). In particular, this implies that p(n, m) = 1 −o(1) provided that m = o(pn). Shift by +1 Shift by -1 i i+1 j j-1 i i+1 j j-1 Strict R-constraints Figure 1: The matrix of pairwise comparisons C (far left) when the rows are ordered according to the true ranking. The corresponding similarity matrix Smatch is a strict R-matrix (center left). The same Smatch similarity matrix with comparison (3,8) corrupted (center right). With one corrupted comparison, Smatch keeps enough strict R-constraints to recover the right permutation. In the noiseless case, the difference between all coefficients is at least one and after introducing an error, the coefficients inside the green rectangles still enforce strict R-constraints (far right). 6 5 Numerical Experiments We conducted numerical experiments using both synthetic and real datasets to compare the performance of SerialRank with several classical ranking methods. Synthetic Datasets The first synthetic dataset consists of a binary matrix of pairwise comparisons derived from a given ranking of n items with uniform, randomly distributed corrupted or missing entries. A second synthetic dataset consists of a full matrix of pairwise comparisons derived from a given ranking of n items, with added uncertainty for items which are sufficiently close in the true ranking of items. Specifically, given a positive integer m, we let Ci,j = 1 if i < j −m, Ci,j ⇠Unif[−1, 1] if |i−j| m, and Ci,j = −1 if i > j+m. In Figure 2, we measure the Kendall ⌧ correlation coefficient between the true ranking and the retrieved ranking, when varying either the percentage of corrupted comparisons or the percentage of missing comparisons. Kendall’s ⌧counts the number of agreeing pairs minus the number of disagreeing pairs between two rankings, scaled by the total number of pairs, so that it takes values between -1 and 1. Experiments were performed with n = 100 and reported Kendall ⌧values were averaged over 50 experiments, with standard deviation less than 0.02 for points of interest (i.e. here with Kendall ⌧> 0.8). 0 50 100 0.6 0.7 0.8 0.9 1 SR PS RC BTL Kendall τ % corrupted 0 50 100 0.6 0.7 0.8 0.9 1 Kendall τ % missing 0 50 100 0.6 0.7 0.8 0.9 1 Kendall τ % missing 0 50 100 0.6 0.7 0.8 0.9 1 Kendall τ Range m Figure 2: Kendall ⌧(higher is better) for SerialRank (SR, full red line), row-sum (PS, [Wauthier et al., 2013] dashed blue line), rank centrality (RC [Negahban et al., 2012] dashed green line), and maximum likelihood (BTL [Bradley and Terry, 1952], dashed magenta line). In the first synthetic dataset, we vary the proportion of corrupted comparisons (top left), the proportion of observed comparisons (top right) and the proportion of observed comparisons, with 20% of comparisons being corrupted (bottom left). We also vary the parameter m in the second synthetic dataset (bottom right). Real Datasets The first real dataset consists of pairwise comparisons derived from outcomes in the TopCoder algorithm competitions. We collected data from 103 competitions among 2742 coders over a period of about one year. Pairwise comparisons are extracted from the ranking of each competition and then averaged for each pair. TopCoder maintains ratings for each participant, updated in an online scheme after each competition, which were also included in the benchmarks. To measure performance in Figure 3, we compute the percentage of upsets (i.e. comparisons disagreeing with the computed ranking), which is closely related to the Kendall ⌧(by an affine transformation if comparisons were coming from a consistent ranking). We refine this metric by considering only the participants appearing in the top k, for various values of k, i.e. computing lk = 1 |Ck| X i,j2Ck {r(i)>r(j)} {Ci,j<0}, (8) 7 where C are the pairs (i, j) that are compared and such that i, j are both ranked in the top k, and r(i) is the rank of i. Up to scaling, this is the loss considered in [Kenyon-Mathieu and Schudy, 2007]. 500 1000 1500 2000 2500 0.25 0.3 0.35 0.4 0.45 TopCoder PS RC BTL SR % upsets in top k k 5 10 15 20 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Official PS RC BTL SR Semi-sup. % upsets in top k k Figure 3: Percentage of upsets (i.e. disagreeing comparisons, lower is better) defined in (8), for various values of k and ranking methods, on TopCoder (left) and football data (right). Semi-Supervised Ranking We illustrate here how, in a semi-supervised setting, one can interactively enforce some constraints on the retrieved ranking, using e.g. the semi-supervised seriation algorithm in [Fogel et al., 2013]. We compute rankings of England Football Premier League teams for season 2013-2014 (cf. figure 4 in Appendix for previous seasons). Comparisons are defined as the averaged outcome (win, loss, or tie) of home and away games for each pair of teams. As shown in Table 1, the top half of SerialRank ranking is very close to the official ranking calculated by sorting the sum of points for each team (3 points for a win, 1 point for a tie). However, there are significant variations in the bottom half, though the number of upsets is roughly the same as for the official ranking. To test semi-supervised ranking, suppose for example that we are not satisfied with the ranking of Aston Villa (last team when ranked by the spectral algorithm), we can explicitly enforce that Aston Villa appears before Cardiff, as in the official ranking. In the ranking based on the semi-supervised corresponding seriation problem, Aston Villa is not last anymore, though the number of disagreeing comparisons remains just as low (cf. Figure 3, right). Table 1: Ranking of teams in the England premier league season 2013-2014. Official Row-sum RC BTL SerialRank Semi-Supervised Man City (86) Man City Liverpool Man City Man City Man City Liverpool (84) Liverpool Arsenal Liverpool Chelsea Chelsea Chelsea (82) Chelsea Man City Chelsea Liverpool Liverpool Arsenal (79) Arsenal Chelsea Arsenal Arsenal Everton Everton (72) Everton Everton Everton Everton Arsenal Tottenham (69) Tottenham Tottenham Tottenham Tottenham Tottenham Man United (64) Man United Man United Man United Southampton Man United Southampton (56) Southampton Southampton Southampton Man United Southampton Stoke (50) Stoke Stoke Stoke Stoke Newcastle Newcastle (49) Newcastle Newcastle Newcastle Swansea Stoke Crystal Palace (45) Crystal Palace Swansea Crystal Palace Newcastle West Brom Swansea (42) Swansea Crystal Palace Swansea West Brom Swansea West Ham (40) West Brom West Ham West Brom Hull Crystal Palace Aston Villa (38) West Ham Hull West Ham West Ham Hull Sunderland (38) Aston Villa Aston Villa Aston Villa Cardiff West Ham Hull (37) Sunderland West Brom Sunderland Crystal Palace Fulham West Brom (36) Hull Sunderland Hull Fulham Norwich Norwich (33) Norwich Fulham Norwich Norwich Sunderland Fulham (32) Fulham Norwich Fulham Sunderland Aston Villa Cardiff (30) Cardiff Cardiff Cardiff Aston Villa Cardiff Acknowledgments FF, AA and MV would like to acknowledge support from a European Research Council starting grant (project SIPA) and support from the MSR-INRIA joint centre. 8 References Ailon, N. [2011], Active learning ranking from pairwise preferences with almost optimal query complexity., in ‘NIPS’, pp. 810–818. Atkins, J., Boman, E., Hendrickson, B. et al. [1998], ‘A spectral algorithm for seriation and the consecutive ones problem’, SIAM J. Comput. 28(1), 297–310. Blum, A., Konjevod, G., Ravi, R. and Vempala, S. [2000], ‘Semidefinite relaxations for minimum bandwidth and other vertex ordering problems’, Theoretical Computer Science 235(1), 25–42. Bradley, R. A. and Terry, M. E. [1952], ‘Rank analysis of incomplete block designs: I. the method of paired comparisons’, Biometrika pp. 324–345. Feige, U. and Lee, J. R. [2007], ‘An improved approximation ratio for the minimum linear arrangement problem’, Information Processing Letters 101(1), 26–29. Fogel, F., Jenatton, R., Bach, F. and d’Aspremont, A. [2013], ‘Convex relaxations for permutation problems’, NIPS 2013, arXiv:1306.4805 . Freund, Y., Iyer, R., Schapire, R. E. and Singer, Y. [2003], ‘An efficient boosting algorithm for combining preferences’, The Journal of machine learning research 4, 933–969. Herbrich, R., Minka, T. and Graepel, T. [2006], TrueskillTM: A bayesian skill rating system, in ‘Advances in Neural Information Processing Systems’, pp. 569–576. Huber, P. J. [1963], ‘Pairwise comparison and ranking: optimum properties of the row sum procedure’, The annals of mathematical statistics pp. 511–520. Hunter, D. R. [2004], ‘MM algorithms for generalized bradley-terry models’, Annals of Statistics pp. 384–406. Jamieson, K. G. and Nowak, R. D. [2011], Active ranking using pairwise comparisons., in ‘NIPS’, Vol. 24, pp. 2240–2248. Joachims, T. [2002], Optimizing search engines using clickthrough data, in ‘Proceedings of the eighth ACM SIGKDD international conference on Knowledge discovery and data mining’, ACM, pp. 133–142. Keener, J. P. [1993], ‘The perron-frobenius theorem and the ranking of football teams’, SIAM review 35(1), 80–93. Kendall, M. G. and Smith, B. B. [1940], ‘On the method of paired comparisons’, Biometrika 31(34), 324–345. Kenyon-Mathieu, C. and Schudy, W. [2007], How to rank with few errors, in ‘Proceedings of the thirty-ninth annual ACM symposium on Theory of computing’, ACM, pp. 95–103. Kleinberg, J. [1999], ‘Authoritative sources in a hyperlinked environment’, Journal of the ACM 46, 604–632. Kuczynski, J. and Wozniakowski, H. [1992], ‘Estimating the largest eigenvalue by the power and Lanczos algorithms with a random start’, SIAM J. Matrix Anal. Appl 13(4), 1094–1122. Luce, R. [1959], Individual choice behavior, Wiley. Negahban, S., Oh, S. and Shah, D. [2012], Iterative ranking from pairwise comparisons., in ‘NIPS’, pp. 2483–2491. Page, L., Brin, S., Motwani, R. and Winograd, T. [1998], ‘The pagerank citation ranking: Bringing order to the web’, Stanford CS Technical Report . Schapire, W. W. C. R. E. and Singer, Y. [1998], Learning to order things, in ‘Advances in Neural Information Processing Systems 10: Proceedings of the 1997 Conference’, Vol. 10, MIT Press, p. 451. Wauthier, F. L., Jordan, M. I. and Jojic, N. [2013], Efficient ranking from pairwise comparisons, in ‘Proceedings of the 30th International Conference on Machine Learning (ICML)’. 9
2014
387
5,499
Pre-training of Recurrent Neural Networks via Linear Autoencoders Luca Pasa, Alessandro Sperduti Department of Mathematics University of Padova, Italy {pasa,sperduti}@math.unipd.it Abstract We propose a pre-training technique for recurrent neural networks based on linear autoencoder networks for sequences, i.e. linear dynamical systems modelling the target sequences. We start by giving a closed form solution for the definition of the optimal weights of a linear autoencoder given a training set of sequences. This solution, however, is computationally very demanding, so we suggest a procedure to get an approximate solution for a given number of hidden units. The weights obtained for the linear autoencoder are then used as initial weights for the inputto-hidden connections of a recurrent neural network, which is then trained on the desired task. Using four well known datasets of sequences of polyphonic music, we show that the proposed pre-training approach is highly effective, since it allows to largely improve the state of the art results on all the considered datasets. 1 Introduction Recurrent Neural Networks (RNN) constitute a powerful computational tool for sequences modelling and prediction [1]. However, training a RNN is not an easy task, mainly because of the well known vanishing gradient problem which makes difficult to learn long-term dependencies [2]. Although alternative architectures, e.g. LSTM networks [3], and more efficient training procedures, such as Hessian Free Optimization [4], have been proposed to circumvent this problem, reliable and effective training of RNNs is still an open problem. The vanishing gradient problem is also an obstacle to Deep Learning, e.g., [5, 6, 7]. In that context, there is a growing evidence that effective learning should be based on relevant and robust internal representations developed in autonomy by the learning system. This is usually achieved in vectorial spaces by exploiting nonlinear autoencoder networks to learn rich internal representations of input data which are then used as input to shallow neural classifiers or predictors (see, for example, [8]). The importance to start gradient-based learning from a good initial point in the parameter space has also been pointed out in [9]. Relationship between autoencoder networks and Principal Component Analysis (PCA) [10] is well known since late ‘80s, especially in the case of linear hidden units [11, 12]. More recently, linear autoencoder networks for structured data have been studied in [13, 14, 15], where an exact closed-form solution for the weights is given in the case of a number of hidden units equal to the rank of the full data matrix. In this paper, we borrow the conceptual framework presented in [13, 16] to devise an effective pretraining approach, based on linear autoencoder networks for sequences, to get a good starting point into the weight space of a RNN, which can then be successfully trained even in presence of longterm dependencies. Specifically, we revise the theoretical approach presented in [13] by: i) giving a simpler and direct solution to the problem of devising an exact closed-form solution (full rank case) for the weights of a linear autoencoder network for sequences, highlighting the relationship between the proposed solution and PCA of the input data; ii) introducing a new formulation of 1 the autoencoder learning problem able to return an optimal solution also in the case of a number of hidden units which is less than the rank of the full data matrix; iii) proposing a procedure for approximate learning of the autoencoder network weights under the scenario of very large sequence datasets. More importantly, we show how to use the linear autoencoder network solution to derive a good initial point into a RNN weight space, and how the proposed approach is able to return quite impressive results when applied to prediction tasks involving long sequences of polyphonic music. 2 Linear Autoencoder Networks for Sequences In [11, 12] it is shown that principal directions of a set of vectors xi ∈Rk are related to solutions obtained by training linear autoencoder networks oi = WoutputWhiddenxi, i = 1, . . . , n, (1) where Whidden ∈Rp×k, Woutput ∈Rk×p, p ≪k, and the network is trained so to get oi = xi, ∀i. When considering a temporal sequence x1, x2, . . . , xt, . . . of input vectors, where t is a discrete time index, a linear autoencoder can be defined by considering the coupled linear dynamical systems yt = Axt + Byt−1 (2)  xt yt−1  = Cyt (3) It should be noticed that eqs. (2) and (3) extend the linear transformation defined in eq. (1) by introducing a memory term involving matrix B ∈Rp×p. In fact, yt−1 is inserted in the right part of equation (2) to keep track of the input history through time: this is done exploiting a state space representation. Eq. (3) represents the decoding part of the autoencoder: when a state yt is multiplied by C, the observed input xt at time t and state at time t −1, i.e. yt−1, are generated. Decoding can then continue from yt−1. This formulation has been proposed, for example, in [17] where an iterative procedure to learn weight matrices A and B, based on Oja’s rule, is presented. No proof of convergence for the proposed procedure is however given. More recently, an exact closed-form solution for the weights has been given in the case of a number of hidden units equal to the rank of the full data matrix (full rank case) [13, 16]. In this section, we revise this result. In addition, we give an exact solution also for the case in which the number of hidden units is strictly less than the rank of the full data matrix. The basic idea of [13, 16] is to look for directions of high variance into the state space of the dynamical linear system (2). Let start by considering a single sequence x1, x2, . . . , xt, . . . , xn and the state vectors of the corresponding induced state sequence collected as rows of a matrix Y = [y1, y2, y3, · · · , yn]T. By using the initial condition y0 = 0 (the null vector), and the dynamical linear system (2), we can rewrite the Y matrix as Y =   xT 1 0 0 0 · · · 0 xT 2 xT 1 0 0 · · · 0 xT 3 xT 2 xT 1 0 · · · 0 ... ... ... ... ... ... xT n xT n−1 xT n−2 · · · xT 2 xT 1   | {z } Ξ   AT ATBT ATB2T ... ATBn−1T   | {z } Ω where, given s = kn, Ξ ∈Rn×s is a data matrix collecting all the (inverted) input subsequences (including the whole sequence) as rows, and Ωis the parameter matrix of the dynamical system. Now, we are interested in using a state space of dimension p ≪n, i.e. yt ∈Rp, such that as much information as contained in Ωis preserved. We start by factorizing Ξ using SVD, obtaining Ξ = VΛUT where V ∈Rn×n is an unitary matrix, Λ ∈Rn×s is a rectangular diagonal matrix with nonnegative real numbers on the diagonal with λ1,1 ≥λ2,2 ≥· · · ≥λn,n (the singular values), and UT ∈Rs×n is a unitary matrix. It is important to notice that columns of UT which correspond to nonzero singular values, apart some mathematical technicalities, basically correspond to the principal directions of data, i.e. PCA. If the rank of Ξ is p, then only the first p elements of the diagonal of Λ are not null, and the above decomposition can be reduced to Ξ = V(p)Λ(p)U(p)T where V(p) ∈Rn×p, Λ(p) ∈Rp×p, 2 and U(p)T ∈Rp×n. Now we can observe that U(p)TU(p) = I (where I is the identity matrix of dimension p), since by definition the columns of U(p) are orthogonal, and by imposing Ω= U(p), we can derive “optimal” matrices A ∈Rp×k and B ∈Rp×p for our dynamical system, which will have corresponding state space matrix Y(p) = ΞΩ= ΞU(p) = V(p)Λ(p)U(p)TU(p) = V(p)Λ(p). Thus, if we represent U(p) as composed of n submatrices U(p) i , each of size k × p, the problem reduces to find matrices A and B such that Ω=   AT ATBT ATB2T ... ATBn−1T   =   U(p) 1 U(p) 2 U(p) 3 ... U(p) n   = U(p). (4) The reason to impose Ω= U(p) is to get a state space where the coordinates are uncorrelated so to diagonalise the empirical sample covariance matrix of the states. Please, note that in this way each state (i.e., row of the Y matrix) corresponds to a row of the data matrix Ξ, i.e. the unrolled (sub)sequence read up to a given time t. If the rows of Ξ were vectors, this would correspond to compute PCA, keeping only the fist p principal directions. In the following, we demonstrate that there exists a solution to the above equation. We start by observing that Ξ owns a special structure, i.e. given Ξ = [Ξ1 Ξ2 · · · Ξn], where Ξi ∈ Rn×k, then for i = 1, . . . , n −1, Ξi+1 = RnΞi =  01×(n−1) 01×1 I(n−1)×(n−1) 0(n−1)×1  Ξi , and RnΞn = 0, i.e. the null matrix of size n × k. Moreover, by singular value decomposition, we have Ξi = V(p)Λ(p)U(p) i T, for i = 1, . . . , n. Using the fact that V(p)TV(p) = I, and combining the above equations, we get U(p) i+t = U(p) i Qt, for i = 1, . . . , n −1, and t = 1, . . . , n −i, where Q = Λ(p)V(p)TRT nV(p)Λ(p)−1. Moreover, we have that U(p) n Q = 0 since U(p) n Q = U(p) n Λ(p)V(p)TRT nV(p)Λ(p)−1= (RnΞn | {z } =0 )TV(p)Λ(p)−1. Thus, eq. (4) is satisfied by A = U(p) 1 T and B = QT. It is interesting to note that the original data Ξ can be recovered by computing Y(p)U(p)T = V(p)Λ(p)U(p)T = Ξ, which can be achieved by running the system  xt yt−1  =  AT BT  yt starting from yn, i.e.  AT BT  is the matrix C defined in eq. (3). Finally, it is important to remark that the above construction works not only for a single sequence, but also for a set of sequences of different length. For example, let consider the two sequences (xa 1, xa 2, xa 3) and (xb1, xb2). Then, we have Ξa =   xa 1 T 0 0 xa 2 T xa 1 T 0 xa 3 T xa 2 T xa 1 T  and Ξb = " xb 1 T 0 xb 2 T xb 1 T # which can be collected together to obtain Ξ =  Ξa Ξb 02×1  , and R =  R4 R2 02×1  . As a final remark, it should be stressed that the above construction only works if p is equal to the rank of Ξ. In the next section, we treat the case in which p < rank(Ξ). 2.1 Optimal solution for low dimensional autoencoders When p < rank(Ξ) the solution given above breaks down because ˜Ξi = V(p)L(p)U(p) i T̸= Ξi, and consequently ˜Ξi+1 ̸= Rn ˜Ξi. So the question is whether the proposed solutions for A and B still hold the best reconstruction error when p < rank(Ξ). 3 In this paper, we answer in negative terms to this question by resorting to a new formulation of our problem where we introduce slack-like matrices E(p) i ∈Rk×p, i = 1, . . . , n + 1 collecting the reconstruction errors, which need to be minimised: min Q∈Rp×p,E(p) i n+1 X i=1 ∥E(p) i ∥2 F subject to :   U(p) 1 + E(p) 1 U(p) 2 + E(p) 2 U(p) 3 + E(p) 3 ... U(p) n + E(p) n   Q =   U(p) 2 + E(p) 2 U(p) 3 + E(p) 3 ... U(p) n + E(p) n E(p) n+1   (5) Notice that the problem above is convex both in the objective function and in the constraints; thus it only has global optimal solutions E∗ i and Q∗, from which we can derive AT = U(p) 1 + E∗ 1 and BT = Q∗. Specifically, when p = rank(Ξ), RT s,kU(p) is in the span of U(p) and the optimal solution is given by E∗ i = 0k×p ∀i, and Q∗= U(p)TRT s,kU(p), i.e. the solution we have already described. If p < rank(Ξ), the optimal solution cannot have ∀i, E∗ i = 0k×p. However, it is not difficult to devise an iterative procedure to reach the minimum. Since in the experimental section we do not exploit the solution to this problem for reasons that we will explain later, here we just sketch such procedure. It helps to observe that, given a fixed Q, the optimal solution for E(p) i is given by [˜E(p) 1 , ˜E(p) 2 , . . . , ˜E(p) n+1] = [U(p) 1 Q −U(p) 2 , U(p) 1 Q2 −U(p) 3 , U(p) 1 Q3 −U(p) 4 , . . .] M+ Q where M+ Q is the pseudo inverse of MQ =   −Q −Q2 −Q3 · · · I 0 0 · · · 0 I 0 · · · 0 0 I · · · ... ... ... ...   . In general, ˜E(p) = h ˜E(p)T 1 , ˜E(p)T 2 , ˜E(p)T 3 , · · · , ˜E(p)T n iT can be decomposed into a component in the span of U(p) and a component E(p)⊥orthogonal to it. Notice that E(p)⊥cannot be reduced, while (part of) the other component can be absorbed into Q by defining ˜U(p) = U(p) + E(p)⊥and taking ˜Q = ( ˜U(p))+ h ˜U(p)T 2 , ˜U(p)T 3 , · · · , ˜U(p)T n , E(p)T n+1 iT . Given ˜Q, the new optimal values for E(p) i are obtained and the process iterated till convergence. 3 Pre-training of Recurrent Neural Networks Here we define our pre-training procedure for recurrent neural networks with one hidden layer of p units, and O output units: ot = σ(Woutputh(xt)) ∈RO, h(xt) = σ(Winputxt + Whiddenh(xt−1)) ∈Rp (6) where Woutput ∈RO×p, Whidden ∈Rp×k, for a vector z ∈Rm, σ(z) = [σ(z1), . . . , σ(zm)]T, and here we consider the symmetric sigmoid function σ(zi) = 1−e−zi 1+e−zi . The idea is to exploit the hidden state representation obtained by eqs. (2) as initial hidden state representation for the RNN described by eqs. (6). This is implemented by initialising the weight matrices Winput and Whidden of (6) by using the matrices that jointly solve eqs. (2) and eqs. (3), i.e. A and B (since C is function of A and B). Specifically, we initialize Winput with A, and Whidden with B. Moreover, the use of symmetrical sigmoidal functions, which do give a very good approximation of the identity function around the origin, allows a good transferring of the linear dynamics inside 4 RNN. For what concerns Woutput, we initialise it by using the best possible solution, i.e. the pseudoinverse of H times the target matrix T, which does minimise the output squared error. Learning is then used to introduce nonlinear components that allow to improve the performance of the model. More formally, let consider a prediction task where for each sequence sq ≡(xq 1, xq 2, . . . , xq lq) of length lq in the training set, a sequence tq of target vectors is defined, i.e. a training sequence is given by ⟨sq, tq⟩≡⟨(xq 1, tq 1), (xq 2, tq 2), . . . , (xq lq, tq lq)⟩, where tq i ∈RO. Given a training set with N sequences, let define the target matrix T ∈RL×O, where L = PN q=1 lq, as T =  t1 1, t1 2, . . . , t1 l1, t2 1, . . . , tN lN T. The input matrix Ξ will have size L × k. Let p∗be the desired number of hidden units for the recurrent neural network (RNN). Then the pre-training procedure can be defined as follows: i) compute the linear autoencoder for Ξ using p∗principal directions, obtaining the optimal matrices A∗∈Rp∗×k and B∗∈Rp∗×p∗; i) set Winput = A∗and Whidden = B∗; iii) run the RNN over the training sequences, collecting the hidden activities vectors (computed using symmetrical sigmoidal functions) over time as rows of matrix H ∈RL×p∗; iv) set Woutput = H+T, where H+ is the (left) pseudoinverse of H. 3.1 Computing an approximate solution for large datasets In real world scenarios the application of our approach may turn difficult because of the size of the data matrix. In fact, stable computation of principal directions is usually obtained by SVD decomposition of the data matrix Ξ, that in typical application domains involves a number of rows and columns which is easily of the order of hundreds of thousands. Unfortunately, the computational complexity of SVD decomposition is basically cubic in the smallest of the matrix dimensions. Memory consumption is also an important issue. Algorithms for approximate computation of SVD have been suggested (e.g., [18]), however, since for our purposes we just need matrices V and Λ with a predefined number of columns (i.e. p), here we present an ad-hoc algorithm for approximate computation of these matrices. Our solution is based on the following four main ideas: i) divide Ξ in slices of k (i.e., size of input at time t) columns, so to exploit SVD decomposition at each slice separately; ii) compute approximate V and Λ matrices, with p columns, incrementally via truncated SVD of temporary matrices obtained by concatenating the current approximation of VΛ with a new slice; iii) compute the SVD decomposition of a temporary matrix via either its kernel or covariance matrix, depending on the smallest between the number of rows and the number of columns of the temporary matrix; iv) exploit QR decomposition to compute SVD decomposition. Algorithm 1 shows in pseudo-code the main steps of our procedure. It maintains a temporary matrix T which is used to collect incrementally an approximation of the principal subspace of dimension p of Ξ. Initially (line 4) T is set equal to the last slices of Ξ, in a number sufficient to get a number of columns larger than p (line 2). Matrices V and Λ from the p-truncated SVD decomposition of T are computed (line 5) via the KECO procedure, described in Algorithm 2, and used to define a new T matrix by concatenation with the last unused slice of Ξ. When all slices are processed, the current V and Λ matrices are returned. The KECO procedure, described in Algorithm 2 , reduces the computational burden by computing the p-truncated SVD decomposition of the input matrix M via its kernel matrix (lines 3-4) if the number of rows of M is no larger than the number of columns, otherwise the covariance matrix is used (lines 6-8). In both cases, the p-truncated SVD decomposition is implemented via QR decomposition by the INDIRECTSVD procedure described in Algorithm 3. This allows to reduce computation time when large matrices must be processed [19]. Finally, matrices V and S 1 2 (both kernel and covariance matrices have squared singular values of M) are returned. We use the strategy to process slices of Ξ in reverse order since, moving versus columns with larger indices, the rank as well as the norm of slices become smaller and smaller, thus giving less and less contribution to the principal subspace of dimension p. This should reduce the approximation error cumulated by dropping the components from p + 1 to p + k during computation [20]. As a final remark, we stress that since we compute an approximate solution for the principal directions of Ξ, it makes no much sense to solve the problem given in eq. (5): learning will quickly compensate for the approximations and/or sub-optimality of A and B obtained by matrices V and Λ returned by Algorithm 1. Thus, these are the matrices we have used for the experiments described in next section. 5 Algorithm 1 Approximated V and Λ with p components 1: function SVFORBIGDATA(Ξ, k, p) 2: nStart = ⌈p/k⌉ ▷Number of starting slices 3: nSlice = (Ξ.columns/k) −nStart ▷Number of remaining slices 4: T = Ξ[:, k ∗nSlice : Ξ.columns] 5: V, Λ =KECO(T, p) ▷Computation of V and Λ for starting slices 6: for i in REVERSED(range(nSlice)) do ▷Computation of V and Λ for remaining slices 7: T = [Ξ[:, i ∗k:(i + 1) ∗k], VΛ] 8: V, Λ =KECO(T, p) 9: end for 10: return V, Λ 11: end function Algorithm 2 Kernel vs covariance computation 1: function KECO(M, p) 2: if M.rows <= Ξ.columns then 3: K = MMT 4: V, Ssqr, UT =INDIRECTSVD(K, p) 5: else 6: C = MTM 7: V, Ssqr, UT =INDIRECTSVD(C, p) 8: V = MUTS −1 2 sqr 9: end if 10: return V, S 1 2sqr 11: end function Algorithm 3 Truncated SVD by QR 1: function INDIRECTSVD(M, p) 2: Q, R =QR(M) 3: Vr, S, UT =SVD(R) 4: V = QVr 5: S = S[1 : p, 1 : p] 6: V = V[1 : p, :] 7: UT = UT[:, 1 : p] 8: return V, S, UT 9: end function 4 Experiments In order to evaluate our pre-training approach, we decided to use the four polyphonic music sequences datasets used in [21] for assessing the prediction abilities of the RNN-RBM model. The prediction task consists in predicting the notes played at time t given the sequence of notes played till time t −1. The RNN-RBM model achieves state-of-the-art in such demanding prediction task. As performance measure we adopted the accuracy measure used in [21] and described in [22]. Each dataset is split in training set, validation set, and test set. Statistics on the datasets, including largest sequence length, are given in columns 2-4 of Table 1. Each sequence in the dataset represents a song having a maximum polyphony of 15 notes (average 3.9); each time step input spans the whole range of piano from A0 to C8 and it is represented by using 88 binary values (i.e. k = 88). Our pre-training approach (PreT-RNN) has been assessed by using a different number of hidden units (i.e., p is set in turn to 50, 100, 150, 200, 250) and 5000 epochs of RNN training1 using the Theano-based stochastic gradient descent software available at [23]. Random initialisation (Rnd) has also been used for networks with the same number of hidden units. Specifically, for networks with 50 hidden units, we have evaluated the performance of 6 different random initialisations. Finally, in order to verify that the nonlinearity introduced by the RNN is actually useful to solve the prediction task, we have also evaluated the performance of a network with linear units (250 hidden units) initialised with our pre-training procedure (PreT-Lin250). To give an idea of the time performance of pre-training with respect to the training of a RNN, in column 5 of Table 1 we have reported the time in seconds needed to compute pre-training matrices (Pre-) (on Intel c⃝Xeon c⃝CPU E5-2670 @2.60GHz with 128 GB) and to perform training of a RNN with p = 50 for 5000 epochs (on GPU NVidia K20). Please, note that for larger values of p, the increase in computation time of pre-training is smaller than the increment in computation time needed for training a RNN. 1Due to early overfitting, for the Muse dataset we used 1000 epochs. 6 Dataset Set # Samples Max length (Pre-)Training Time Model ACC% [21] Training 195 641 seconds RNN (w. HF) 62.93 (66.64) Nottingham (39165 × 56408) (226) 5837 RNN-RBM 75.40 Test 170 1495 p = 50 PreT-RNN 75.23 (p = 250) Validation 173 1229 5000 epochs PreT-Lin250 73.19 Training 87 4405 seconds RNN (w. HF) 19.33 (23.34) Piano-midi.de (70672 × 387640) (2971) 4147 RNN-RBM 28.92 Test 25 2305 p = 50 PreT-RNN 37.74 (p = 250) Validation 12 1740 5000 epochs PreT-Lin250 16.87 Training 524 2434 seconds RNN (w. HF) 23.25 (30.49) MuseData (248479 × 214192) (7338) 4190 RNN-RBM 34.02 Test 25 2305 p = 50 PreT-RNN 57.57 (p = 200) Validation 135 2523 5000 epochs PreT-Lin250 3.56 Training 229 259 seconds RNN (w. HF) 28.46 (29.41) JSB Chorales (27674 × 22792) (79) 6411 RNN-RBM 33.12 Test 77 320 p = 50 PreT-RNN 65.67 (p = 250) Validation 76 289 5000 epochs PreT-Lin250 38.32 Table 1: Datasets statistics including data matrix size for the training set (columns 2-4), computational times in seconds to perform pre-training and training for 5000 epochs with p = 50 (column 5), and accuracy results for state-of-the-art models [21] vs our pre-training approach (columns 6-7). The acronym (w. HF) is used to identify an RNN trained by Hessian Free Optimization [4]. Training and test curves for all the models described above are reported in Figure 1. It is evident that random initialisation does not allow the RNN to improve its performance in a reasonable amount of epochs. Specifically, for random initialisation with p = 50 (Rnd 50), we have reported the average and range of variation over the 6 different trails: different initial points do not change substantially the performance of RNN. Increasing the number of hidden units allows the RNN to slightly increase its performance. Using pre-training, on the other hand, allows the RNN to start training from a quite favourable point, as demonstrated by an early sharp improvement of performances. Moreover, the more hidden units are used, the more the improvement in performance is obtained, till overfitting is observed. In particular, early overfitting occurs for the Muse dataset. It can be noticed that the linear model (Linear) reaches performances which are in some cases better than RNN without pre-training. However, it is important to notice that while it achieves good results on the training set (e.g. JSB and Piano-midi), the corresponding performance on the test set is poor, showing a clear evidence of overfitting. Finally, in column 7 of Table 1, we have reported the accuracy obtained after validation on the number of hidden units and number of epochs for our approaches (PreT-RNN and PreT-Lin250) versus the results reported in [21] for RNN (also using Hessian Free Optimization) and RNN-RBM. In any case, the use of pre-training largely improves the performances over standard RNN (with or without Hessian Free Optimization). Moreover, with the exception of the Nottingham dataset, the proposed approach outperforms the state-of-the-art results achieved by RNN-RBM. Large improvements are observed for the Muse and JSB datasets. Performance for the Nottingham dataset is basically equivalent to the one obtained by RNN-RBM. For this dataset, also the linear model with pre-training achieves quite good results, which seems to suggest that the prediction task for this dataset is much easier than for the other datasets. The linear model outperforms RNN without pre-training on Nottingham and JSB datasets, but shows problems with the Muse dataset. 5 Conclusions We have proposed a pre-training technique for RNN based on linear autoencoders for sequences. For this kind of autoencoders it is possible to give a closed form solution for the definition of the “optimal” weights, which however, entails the computation of the SVD decomposition of the full data matrix. For large data matrices exact SVD decomposition cannot be achieved, so we proposed a computationally efficient procedure to get an approximation that turned to be effective for our goals. Experimental results for a prediction task on datasets of sequences of polyphonic music show the usefulness of the proposed pre-training approach, since it allows to largely improve the state of the art results on all the considered datasets by using simple stochastic gradient descend for learning. Even if the results are very encouraging the method needs to be assessed on data from other application domains. Moreover, it is interesting to understand whether the analysis performed in [24] on linear deep networks for vectors can be extended to recurrent architectures for sequences and, in particular, to our method. 7 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4 0 200 400 600 800 1000 Accuracy Epoch Rnd 50 (6 trials) Linear 250 Rnd 100 Rnd 150 Rnd 200 Rnd 250 PreT 50 PreT 150 PreT 100 PreT 200 PreT 250 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Accuracy Epoch Nottingham Training Set 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Accuracy Epoch Nottingham Test Set 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Accuracy Epoch Piano-Midi.de Training Set 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Accuracy Epoch Piano-Midi.de Test Set 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 200 400 600 800 1000 Accuracy Epoch Muse Dataset Training Set 0 0.1 0.2 0.3 0.4 0.5 0.6 0 200 400 600 800 1000 Accuracy Epoch Muse Dataset Test Set 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Accuracy Epoch JSB Chorales Training Set 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 Accuracy Epoch JSB Chorales Test Set Figure 1: Training (left column) and test (right column) curves for the assessed approaches on the four datasets. Curves are sampled at each epoch till epoch 100, and at steps of 100 epochs afterwards. 8 References [1] S. C. Kremer. Field Guide to Dynamical Recurrent Networks. Wiley-IEEE Press, 2001. [2] Y. Bengio, P. Simard, and P. Frasconi. Learning long-term dependencies with gradient descent is difficult. IEEE Transactions on Neural Networks, 5(2):157–166, 1994. [3] S. Hochreiter and J. Schmidhuber. Lstm can solve hard long time lag problems. In NIPS, pages 473–479, 1996. [4] J. Martens and I. Sutskever. Learning recurrent neural networks with hessian-free optimization. In ICML, pages 1033–1040, 2011. [5] G. E. Hinton and R. R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, July 2006. [6] G. E. Hinton, S. Osindero, and Y. W. Teh. A fast learning algorithm for deep belief nets. Neural Computation, 18(7):1527–1554, 2006. [7] P. di Lena, K. Nagata, and P. Baldi. Deep architectures for protein contact map prediction. Bioinformatics, 28(19):2449–2457, 2012. [8] Y. Bengio. Learning deep architectures for ai. Foundations and Trends in Machine Learning, 2(1):1–127, 2009. [9] I. Sutskever, J. Martens, G. E. Dahl, and G. E. Hinton. On the importance of initialization and momentum in deep learning. In ICML (3), pages 1139–1147, 2013. [10] I.T. Jolliffe. Principal Component Analysis. Springer-Verlag New York, Inc., 2002. [11] H. Bourlard and Y. Kamp. Auto-association by multilayer perceptrons and singular value decomposition. Biological Cybernetics, 59(4-5):291–294, 1988. [12] P. Baldi and K. Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural Networks, 2(1):53–58, 1989. [13] A. Sperduti. Exact solutions for recursive principal components analysis of sequences and trees. In ICANN (1), pages 349–356, 2006. [14] A. Micheli and A. Sperduti. Recursive principal component analysis of graphs. In ICANN (2), pages 826–835, 2007. [15] A. Sperduti. Efficient computation of recursive principal component analysis for structured input. In ECML, pages 335–346, 2007. [16] A. Sperduti. Linear autoencoder networks for structured data. In NeSy’13:Ninth International Workshop onNeural-Symbolic Learning and Reasoning, 2013. [17] T. Voegtlin. Recursive principal components analysis. Neural Netw., 18(8):1051–1063, 2005. [18] G. Martinsson et al. Randomized methods for computing the singular value decomposition (svd) of very large matrices. In Works. on Alg. for Modern Mass. Data Sets, Palo Alto, 2010. [19] E. Rabani and S. Toledo. Out-of-core svd and qr decompositions. In PPSC, 2001. [20] Z. Zhang and H. Zha. Structure and perturbation analysis of truncated svds for columnpartitioned matrices. SIAM J. on Mat. Anal. and Appl., 22(4):1245–1262, 2001. [21] N. Boulanger-Lewandowski, Y. Bengio, and P. Vincent. Modeling temporal dependencies in high-dimensional sequences: Application to polyphonic music generation and transcription. In ICML, 2012. [22] M. Bay, A. F. Ehmann, and J. S. Downie. Evaluation of multiple-f0 estimation and tracking systems. ISMIR, pages 315–320, 2009. [23] https://github.com/gwtaylor/theano-rnn. [24] A. M. Saxe, J. L. McClelland, and S. Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013. 9
2014
388